diff --git a/.gitignore b/.gitignore index 7859b4db2a..6a47caf4ae 100644 --- a/.gitignore +++ b/.gitignore @@ -175,7 +175,6 @@ BuildLog.htm !/libs/win32/ !/libs/speex/win32/ -!/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/ *.suo *.sdf x64/ diff --git a/Freeswitch.2017.sln b/Freeswitch.2017.sln index c27b1ee6fe..459419ff44 100644 --- a/Freeswitch.2017.sln +++ b/Freeswitch.2017.sln @@ -411,10 +411,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sms", "src\mod\applicat EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "xmlrpc-c", "xmlrpc-c", "{9DE35039-A8F6-4FBF-B1B6-EB527F802411}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmlib", "src\mod\endpoints\mod_gsmopen\gsmlib\gsmlib-1.10-patched-13ubuntu\win32\gsmlib.2017.vcxproj", "{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_gsmopen", "src\mod\endpoints\mod_gsmopen\mod_gsmopen.2017.vcxproj", "{74B120FF-6935-4DFE-A142-CDB6BEA99C90}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_redis", "src\mod\applications\mod_redis\mod_redis.2017.vcxproj", "{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "libs\win32\libjpeg\libjpeg.2017.vcxproj", "{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}" @@ -448,8 +444,6 @@ Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Setup.2017", "w32\Setup\Set EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_math_fixed_tables", "libs\win32\spandsp\make_math_fixed_tables.2017.vcxproj", "{2386B892-35F5-46CF-A0F0-10394D2FBF9B}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcbt", "libs\win32\libcbt\libcbt.2017.vcxproj", "{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_cielab_luts", "libs\win32\spandsp\make_cielab_luts.2017.vcxproj", "{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "opus", "opus", "{ED2CA8B5-8E91-4296-A120-02BB0B674652}" @@ -1834,28 +1828,6 @@ Global {2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Release|Win32.Build.0 = Release|Win32 {2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Release|x64.ActiveCfg = Release|x64 {2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Release|x64.Build.0 = Release|x64 - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.All|Win32.ActiveCfg = Release|x64 - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.All|x64.ActiveCfg = Release|x64 - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.All|x64.Build.0 = Release|x64 - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|Win32.ActiveCfg = Debug|Win32 - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|Win32.Build.0 = Debug|Win32 - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|x64.ActiveCfg = Debug|x64 - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|x64.Build.0 = Debug|x64 - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|Win32.ActiveCfg = Release|Win32 - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|Win32.Build.0 = Release|Win32 - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|x64.ActiveCfg = Release|x64 - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|x64.Build.0 = Release|x64 - {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|Win32.ActiveCfg = Release|x64 - {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|x64.ActiveCfg = Release|x64 - {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|x64.Build.0 = Release|x64 - {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|Win32.ActiveCfg = Debug|Win32 - {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|Win32.Build.0 = Debug|Win32 - {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|x64.ActiveCfg = Debug|x64 - {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|x64.Build.0 = Debug|x64 - {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|Win32.ActiveCfg = Release|Win32 - {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|Win32.Build.0 = Release|Win32 - {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|x64.ActiveCfg = Release|x64 - {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|x64.Build.0 = Release|x64 {886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.All|Win32.ActiveCfg = Release|x64 {886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.All|x64.ActiveCfg = Release|x64 {886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.All|x64.Build.0 = Release|x64 @@ -1956,17 +1928,6 @@ Global {2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Release|Win32.Build.0 = All|Win32 {2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Release|x64.ActiveCfg = All|Win32 {2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Release|x64.Build.0 = All|Win32 - {77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.All|Win32.ActiveCfg = Release|Win32 - {77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.All|Win32.Build.0 = Release|Win32 - {77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.All|x64.ActiveCfg = Release|Win32 - {77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Debug|Win32.ActiveCfg = Debug|Win32 - {77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Debug|Win32.Build.0 = Debug|Win32 - {77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Debug|x64.ActiveCfg = Debug|x64 - {77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Debug|x64.Build.0 = Debug|x64 - {77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Release|Win32.ActiveCfg = Release|Win32 - {77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Release|Win32.Build.0 = Release|Win32 - {77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Release|x64.ActiveCfg = Release|x64 - {77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Release|x64.Build.0 = Release|x64 {85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.All|Win32.ActiveCfg = All|Win32 {85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.All|Win32.Build.0 = All|Win32 {85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.All|x64.ActiveCfg = All|Win32 @@ -2683,8 +2644,6 @@ Global {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {2469B306-B027-4FF2-8815-C9C1EA2CAE79} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {9DE35039-A8F6-4FBF-B1B6-EB527F802411} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} - {74B120FF-6935-4DFE-A142-CDB6BEA99C90} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C} {886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9} = {9DE35039-A8F6-4FBF-B1B6-EB527F802411} @@ -2693,7 +2652,6 @@ Global {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA} = {9DE35039-A8F6-4FBF-B1B6-EB527F802411} {B535402E-38D2-4D54-8360-423ACBD17192} = {9DE35039-A8F6-4FBF-B1B6-EB527F802411} {2386B892-35F5-46CF-A0F0-10394D2FBF9B} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} - {77BC1DD2-C9A1-44D7-BFFA-1320370CACB9} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {85F0CF8C-C7AB-48F6-BA19-CC94CF87F981} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {ED2CA8B5-8E91-4296-A120-02BB0B674652} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {FD60942F-72D6-4CA1-8B57-EA1D1B95A89E} = {ED2CA8B5-8E91-4296-A120-02BB0B674652} diff --git a/LICENSE b/LICENSE index d37d77ce56..7d64386fb2 100644 --- a/LICENSE +++ b/LICENSE @@ -1513,21 +1513,6 @@ Files: src/mod/languages/mod_managed/* Copyright: 2008, Michael Giagnocavo License: MPL-1.1 -Files: src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/* - src/mod/languages/mod_lua/lua-mode.el -Copyright: 1995-2007 Free Software Foundation, Inc. -License: GPL-2+ - -Files: src/mod/endpoints/mod_gsmopen/libctb-0.16/* -Copyright: 2001-2010 Joachim Buermann -License: wxWindows - -Files: src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/getopt.cpp -Copyright: 2001 ? -License: clueless and unacceptable - FIXME -- this cannot go in Debian -- the license is stated as: - (I think Open Source) - Files: src/mod/endpoints/mod_rtmp/libamf/src/types.[ch] Copyright: 2007, 2008 Marc Noirot License: GPL-2+ @@ -1539,10 +1524,6 @@ Files: src/mod/endpoints/mod_rtmp/rtmp.c Copyright: 2011-2012, Barracuda Networks Inc. License: MPL-1.1 -Files: src/mod/endpoints/mod_gsmopen/asterisk/celliax_spandsp.[ch] -Copyright: 2001-2006 Steve Underwood -License: GPL-2 - Files: src/mod/endpoints/mod_skinny/* src/mod/asr_tts/mod_tts_commandline/mod_tts_commandline.c Copyright: 2009-2010, Mathieu Parent diff --git a/build/modules.conf.in b/build/modules.conf.in index 445ee5ade1..d114df88f5 100644 --- a/build/modules.conf.in +++ b/build/modules.conf.in @@ -86,7 +86,6 @@ dialplans/mod_dialplan_asterisk dialplans/mod_dialplan_xml #directories/mod_ldap #endpoints/mod_alsa -#endpoints/mod_gsmopen #endpoints/mod_h323 #endpoints/mod_khomp endpoints/mod_loopback diff --git a/build/modules.conf.most b/build/modules.conf.most index a8ee0d179a..43a5290057 100644 --- a/build/modules.conf.most +++ b/build/modules.conf.most @@ -83,7 +83,6 @@ dialplans/mod_dialplan_directory dialplans/mod_dialplan_xml directories/mod_ldap #endpoints/mod_alsa -#endpoints/mod_gsmopen #endpoints/mod_h323 #endpoints/mod_khomp endpoints/mod_loopback diff --git a/configure.ac b/configure.ac index 0d9c2efc1a..ed3eb4f32b 100644 --- a/configure.ac +++ b/configure.ac @@ -2183,7 +2183,6 @@ AC_CONFIG_FILES([Makefile src/mod/dialplans/mod_dialplan_xml/Makefile src/mod/directories/mod_ldap/Makefile src/mod/endpoints/mod_alsa/Makefile - src/mod/endpoints/mod_gsmopen/Makefile src/mod/endpoints/mod_h323/Makefile src/mod/endpoints/mod_khomp/Makefile src/mod/endpoints/mod_loopback/Makefile diff --git a/debian/bootstrap.sh b/debian/bootstrap.sh index da2f303d49..484ba54555 100755 --- a/debian/bootstrap.sh +++ b/debian/bootstrap.sh @@ -48,7 +48,6 @@ avoid_mods=( codecs/mod_siren codecs/mod_sangoma_codec codecs/mod_skel_codec - endpoints/mod_gsmopen endpoints/mod_h323 endpoints/mod_khomp endpoints/mod_opal diff --git a/debian/control-modules b/debian/control-modules index 7d6182d790..291ffc1940 100644 --- a/debian/control-modules +++ b/debian/control-modules @@ -428,11 +428,6 @@ Description: mod_alsa Adds mod_alsa. Build-Depends: libasound2-dev -Module: endpoints/mod_gsmopen -Description: mod_gsmopen - Adds mod_gsmopen. -Build-Depends: libx11-dev - Module: endpoints/mod_h323 Description: mod_h323 Adds mod_h323. diff --git a/debian/copyright b/debian/copyright index 2270e4a9d5..a2860ea7b9 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1513,21 +1513,6 @@ Files: src/mod/languages/mod_managed/* Copyright: 2008, Michael Giagnocavo License: MPL-1.1 -Files: src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/* - src/mod/languages/mod_lua/lua-mode.el -Copyright: 1995-2007 Free Software Foundation, Inc. -License: GPL-2+ - -Files: src/mod/endpoints/mod_gsmopen/libctb-0.16/* -Copyright: 2001-2010 Joachim Buermann -License: wxWindows - -Files: src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/getopt.cpp -Copyright: 2001 ? -License: clueless and unacceptable - FIXME -- this cannot go in Debian -- the license is stated as: - (I think Open Source) - Files: src/mod/endpoints/mod_rtmp/libamf/src/types.[ch] Copyright: 2007, 2008 Marc Noirot License: GPL-2+ @@ -1539,10 +1524,6 @@ Files: src/mod/endpoints/mod_rtmp/rtmp.c Copyright: 2011-2012, Barracuda Networks Inc. License: MPL-1.1 -Files: src/mod/endpoints/mod_gsmopen/asterisk/celliax_spandsp.[ch] -Copyright: 2001-2006 Steve Underwood -License: GPL-2 - Files: src/mod/endpoints/mod_skinny/* src/mod/asr_tts/mod_tts_commandline/mod_tts_commandline.c Copyright: 2009-2010, Mathieu Parent diff --git a/freeswitch.spec b/freeswitch.spec index 6d7ad663d4..9a28d21324 100644 --- a/freeswitch.spec +++ b/freeswitch.spec @@ -830,16 +830,6 @@ PostgreSQL native support for FreeSWITCH. # FreeSWITCH Endpoint Modules ###################################################################################################################### -#%package endpoint-gsmopen -#Summary: Generic GSM endpoint support for FreeSWITCH open source telephony platform -#Group: System/Libraries -#Requires: %{name} = %{version}-%{release} -# -#%description endpoint-gsmopen -#GSMopen is an endpoint (channel driver) that allows an SMS to be sent or -#received from FreeSWITCH as well as incoming and outgoing GSM voice calls. -#SMS is handled via the standard CHAT API in FreeSWITCH. - #%package endpoint-h323 #Summary: H.323 endpoint support for FreeSWITCH open source telephony platform #Group: System/Libraries @@ -1438,7 +1428,7 @@ ENDPOINTS_MODULES=" \ endpoints/mod_loopback endpoints/mod_portaudio endpoints/mod_rtmp \ endpoints/mod_skinny endpoints/mod_verto endpoints/mod_rtc endpoints/mod_sofia" -## DISABLED MODULES DUE TO BUILD ISSUES endpoints/mod_gsmopen endpoints/mod_h323 endpoints/mod_khomp +## DISABLED MODULES DUE TO BUILD ISSUES endpoints/mod_h323 endpoints/mod_khomp ###################################################################################################################### # @@ -2191,9 +2181,6 @@ fi # ###################################################################################################################### -#%files endpoint-gsmopen -#%{MODINSTDIR}/mod_gsmopen.so* - #%files endpoint-h323 #%{MODINSTDIR}/mod_h323.so* diff --git a/libs/win32/libcbt/libcbt.2017.vcxproj b/libs/win32/libcbt/libcbt.2017.vcxproj deleted file mode 100644 index 9df8a3d599..0000000000 --- a/libs/win32/libcbt/libcbt.2017.vcxproj +++ /dev/null @@ -1,168 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - {77BC1DD2-C9A1-44D7-BFFA-1320370CACB9} - libcbt - - - - StaticLibrary - true - $(DefaultPlatformToolset) - MultiByte - - - StaticLibrary - false - $(DefaultPlatformToolset) - true - MultiByte - - - StaticLibrary - false - MultiByte - $(DefaultPlatformToolset) - - - StaticLibrary - false - MultiByte - $(DefaultPlatformToolset) - - - - - - - - $(PlatformName)\$(Configuration)\ - $(PlatformName)\$(Configuration)\ - .lib - - - - NotUsing - Level3 - Disabled - _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;%(PreprocessorDefinitions) - true - $(SolutionDir)src\mod\endpoints\mod_gsmopen\libctb-0.16\include - 4311;4302;4800;4101;4267;%(DisableSpecificWarnings) - ProgramDatabase - - - Windows - true - - - /ignore:4042 %(AdditionalOptions) - - - - - NotUsing - Level3 - Disabled - _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;%(PreprocessorDefinitions) - true - $(SolutionDir)src\mod\endpoints\mod_gsmopen\libctb-0.16\include - 4311;4302;4800;4101;4267;%(DisableSpecificWarnings) - - - Windows - true - - - /ignore:4042 %(AdditionalOptions) - - - - - Level3 - NotUsing - MaxSpeed - true - true - _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - $(SolutionDir)src\mod\endpoints\mod_gsmopen\libctb-0.16\include - 4311;4302;4800;4101;4267;%(DisableSpecificWarnings) - - - Windows - true - true - true - - - /ignore:4042 %(AdditionalOptions) - - - - - Level3 - NotUsing - MaxSpeed - true - true - _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - $(SolutionDir)src\mod\endpoints\mod_gsmopen\libctb-0.16\include - 4311;4302;4800;4101;4267;%(DisableSpecificWarnings) - - - Windows - true - true - true - - - /ignore:4042 %(AdditionalOptions) - - - - - - \ No newline at end of file diff --git a/src/mod/Makefile.am b/src/mod/Makefile.am index 54064d49f3..e1cc13fb6d 100644 --- a/src/mod/Makefile.am +++ b/src/mod/Makefile.am @@ -7,7 +7,6 @@ uninstall: $(OUR_UNINSTALL_MODULES) $(OUR_DISABLED_UNINSTALL_MODULES) print_tests: $(OUR_TEST_MODULES) check: $(OUR_CHECK_MODULES) -mod_gsmopen-all: mod_spandsp-all $(OUR_MODULES) $(OUR_CLEAN_MODULES) $(OUR_INSTALL_MODULES) $(OUR_UNINSTALL_MODULES) $(OUR_DISABLED_MODULES) $(OUR_DISABLED_CLEAN_MODULES) $(OUR_DISABLED_INSTALL_MODULES) $(OUR_DISABLED_UNINSTALL_MODULES) $(OUR_TEST_MODULES) $(OUR_CHECK_MODULES): @set fnord $$MAKEFLAGS; amf=$$2; \ diff --git a/src/mod/endpoints/mod_gsmopen/.gitignore b/src/mod/endpoints/mod_gsmopen/.gitignore deleted file mode 100644 index 9fdeeb1412..0000000000 --- a/src/mod/endpoints/mod_gsmopen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -!/gsmlib/gsmlib-*/aclocal.m4 -!/gsmlib/gsmlib-*/configure diff --git a/src/mod/endpoints/mod_gsmopen/FREEBSD_README.txt b/src/mod/endpoints/mod_gsmopen/FREEBSD_README.txt deleted file mode 100644 index 4cbedeae63..0000000000 --- a/src/mod/endpoints/mod_gsmopen/FREEBSD_README.txt +++ /dev/null @@ -1,9 +0,0 @@ -This patch (updated to be applied today) was sent via Jira by royj@yandex.ru, with Jira issue FS-4338. - -Apply in this way: -# patch -p6 < FREEBSD_patch.diff - -I have not tested it, but it works for him. -Please open another Jira issue if anything wrong. - --giovanni diff --git a/src/mod/endpoints/mod_gsmopen/FREEBSD_patch.diff b/src/mod/endpoints/mod_gsmopen/FREEBSD_patch.diff deleted file mode 100644 index cd5613a2d7..0000000000 --- a/src/mod/endpoints/mod_gsmopen/FREEBSD_patch.diff +++ /dev/null @@ -1,171 +0,0 @@ -diff --git a/src/mod/endpoints/mod_gsmopen/Makefile b/src/mod/endpoints/mod_gsmopen/Makefile -index 18943c8..5324c52 100644 ---- a/src/mod/endpoints/mod_gsmopen/Makefile -+++ b/src/mod/endpoints/mod_gsmopen/Makefile -@@ -1,5 +1,5 @@ - MODNAME=mod_gsmopen --LOCAL_CFLAGS += -I../../../../libs/spandsp/src -I../../../..//libs/tiff-4.0.2/libtiff -DGSMOPEN_C_VER=\"`git log -1 --format="%h" gsmopen_protocol.cpp`\" -DMODGSMOPEN_C_VER=\"`git log -1 --format="%h" mod_gsmopen.cpp`\" -+LOCAL_CFLAGS += -I/usr/local/include -I../../../../libs/spandsp/src -I../../../..//libs/tiff-4.0.2/libtiff -DGSMOPEN_C_VER=\"`git log -1 --format="%h" gsmopen_protocol.cpp`\" -DMODGSMOPEN_C_VER=\"`git log -1 --format="%h" mod_gsmopen.cpp`\" - LOCAL_LDFLAGS=-L../../../../libs/spandsp/src -lspandsp -lctb-0.16 -lgsmme - LOCAL_OBJS=gsmopen_protocol.o - include ../../../../build/modmake.rules -diff --git a/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp b/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp -index 5bdda08..73ef93d 100644 ---- a/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp -+++ b/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp -@@ -2356,7 +2356,7 @@ int ucs2_to_utf8(private_t *tech_pvt, char *ucs2_in, char *utf8_out, size_t outb - iconv_t iconv_format; - int iconv_res; - char *outbuf; -- char *inbuf; -+ //char *inbuf; - size_t inbytesleft; - int c; - char stringa[5]; -@@ -2376,9 +2376,10 @@ int ucs2_to_utf8(private_t *tech_pvt, char *ucs2_in, char *utf8_out, size_t outb - } - - outbuf = utf8_out; -- inbuf = converted; -+ const char *inbuf = converted; - -- iconv_format = iconv_open("UTF8", "UCS-2BE"); -+ //iconv_format = iconv_open("UTF8", "UCS-2BE"); -+ iconv_format = iconv_open("UTF-8", "UCS-2BE"); - //iconv_format = iconv_open("UTF8", "UCS2"); - if (iconv_format == (iconv_t) -1) { - ERRORA("error: %s\n", GSMOPEN_P_LOG, strerror(errno)); -@@ -2417,12 +2418,12 @@ int utf8_to_iso_8859_1(private_t *tech_pvt, char *utf8_in, size_t inbytesleft, c - iconv_t iconv_format; - int iconv_res; - char *outbuf; -- char *inbuf; -+ //char *inbuf; - - outbuf = iso_8859_1_out; -- inbuf = utf8_in; -+ const char *inbuf = utf8_in; - -- iconv_format = iconv_open("ISO_8859-1", "UTF8"); -+ iconv_format = iconv_open("ISO_8859-1", "UTF-8"); - if (iconv_format == (iconv_t) -1) { - ERRORA("error: %s\n", GSMOPEN_P_LOG, strerror(errno)); - return -1; -@@ -2467,7 +2468,7 @@ int iso_8859_1_to_utf8(private_t *tech_pvt, char *iso_8859_1_in, char *utf8_out, - iconv_t iconv_format; - int iconv_res; - char *outbuf; -- char *inbuf; -+ //char *inbuf; - size_t inbytesleft; - //int c; - //char stringa[5]; -@@ -2477,9 +2478,9 @@ int iso_8859_1_to_utf8(private_t *tech_pvt, char *iso_8859_1_in, char *utf8_out, - DEBUGA_GSMOPEN("iso_8859_1_in=%s\n", GSMOPEN_P_LOG, iso_8859_1_in); - - outbuf = utf8_out; -- inbuf = iso_8859_1_in; -+ const char *inbuf = iso_8859_1_in; - -- iconv_format = iconv_open("UTF8", "ISO_8859-1"); -+ iconv_format = iconv_open("UTF-8", "ISO_8859-1"); - if (iconv_format == (iconv_t) -1) { - ERRORA("error: %s\n", GSMOPEN_P_LOG, strerror(errno)); - return -1; -@@ -2514,7 +2515,7 @@ int utf8_to_ucs2(private_t *tech_pvt, char *utf8_in, size_t inbytesleft, char *u - iconv_t iconv_format; - int iconv_res; - char *outbuf; -- char *inbuf; -+ //char *inbuf; - char converted[16000]; - int i; - char stringa[16]; -@@ -2523,9 +2524,9 @@ int utf8_to_ucs2(private_t *tech_pvt, char *utf8_in, size_t inbytesleft, char *u - memset(converted, '\0', sizeof(converted)); - - outbuf = converted; -- inbuf = utf8_in; -+ const char *inbuf = utf8_in; - -- iconv_format = iconv_open("UCS-2BE", "UTF8"); -+ iconv_format = iconv_open("UCS-2BE", "UTF-8"); - if (iconv_format == (iconv_t) -1) { - ERRORA("error: %s\n", GSMOPEN_P_LOG, strerror(errno)); - return -1; -diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/linux/serport.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/linux/serport.h -index d88528b..f8851cc 100644 ---- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/linux/serport.h -+++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/linux/serport.h -@@ -10,7 +10,7 @@ - ///////////////////////////////////////////////////////////////////////////// - - #include "ctb-0.16/serportx.h" --#include -+//#include - #include - - namespace ctb { -@@ -40,7 +40,7 @@ namespace ctb { - need the errors during a active connection, we must save the actual - error numbers in this separate structurs. - */ -- struct serial_icounter_struct save_info, last_info; -+ //struct serial_icounter_struct save_info, last_info; - - /*! - \brief adaptor member function, to convert the plattform independent -diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/linux/serport.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/linux/serport.cpp -index a369abc..d190567 100644 ---- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/linux/serport.cpp -+++ b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/linux/serport.cpp -@@ -136,7 +136,7 @@ namespace ctb { - // - int SerialPort::Ioctl(int cmd, void* args) - { -- int count = 0; -+ /* int count = 0; - int err = 0; - struct serial_icounter_struct info; - SerialPort_EINFO einfo; -@@ -184,7 +184,8 @@ namespace ctb { - return -1; - } - last_info = info; -- return 0; -+ return 0;*/ -+ return -1; - }; - - int SerialPort::IsOpen() -@@ -292,9 +293,9 @@ namespace ctb { - // request the actual numbers of breaks, framing, overrun - // and parity errors (because Linux summing all of them during - // system lifetime, not only while serial port is open. -- ioctl(fd,TIOCGICOUNT,&save_info); -+ //ioctl(fd,TIOCGICOUNT,&save_info); - // it's also careless, but we assume, that there was no error -- last_info = save_info; -+ //last_info = save_info; - - // in case of a non-standard rate, the termios struct have to set - // with the B38400 rate, see above! -@@ -359,7 +360,7 @@ namespace ctb { - - int SerialPort::SetBaudrateAny( int baudrate ) - { -- struct serial_struct ser_info; -+ /* struct serial_struct ser_info; - - int result = ioctl( fd, TIOCGSERIAL, &ser_info ); - -@@ -369,7 +370,8 @@ namespace ctb { - - result = ioctl( fd, TIOCSSERIAL, &ser_info ); - -- return result; -+ return result;*/ -+ return -1; - } - - int SerialPort::SetBaudrateStandard( int baudrate ) diff --git a/src/mod/endpoints/mod_gsmopen/Makefile.am b/src/mod/endpoints/mod_gsmopen/Makefile.am deleted file mode 100644 index e7c20f257c..0000000000 --- a/src/mod/endpoints/mod_gsmopen/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -include $(top_srcdir)/build/modmake.rulesam -MODNAME=mod_gsmopen - -mod_LTLIBRARIES = mod_gsmopen.la -mod_gsmopen_la_SOURCES = mod_gsmopen.cpp gsmopen_protocol.cpp -mod_gsmopen_la_CXXFLAGS = $(SWITCH_AM_CXXFLAGS) -mod_gsmopen_la_CPPFLAGS = $(SPANDSP_CFLAGS) -I. -mod_gsmopen_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(SPANDSP_LIBS) -mod_gsmopen_la_LDFLAGS = -avoid-version -module -no-undefined -lctb-0.16 -lgsmme diff --git a/src/mod/endpoints/mod_gsmopen/README b/src/mod/endpoints/mod_gsmopen/README deleted file mode 100644 index 30955a2157..0000000000 --- a/src/mod/endpoints/mod_gsmopen/README +++ /dev/null @@ -1,14 +0,0 @@ -GSMopen, GSM Endpoint and Trunk - -All documentation on compiling, using, configuring, -tricks and tweaks, possible problems at: - -http://wiki.freeswitch.org/wiki/Gsmopen - -Enjoy - --giovanni - - -< gmaruzz at gmail dot com > - diff --git a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/Makefile b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/Makefile deleted file mode 100644 index 15e3388bd2..0000000000 --- a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -MODNAME=mod_gsmopen -SVNDEF := -D'GSMOPEN_SVN_VERSION="$(shell svnversion -n .)"' -#LOCAL_CFLAGS += $(SVNDEF) -Wno-error=address -DNO_GSMLIB -I../../../../../../libs/spandsp/src -I../../../../../..//libs/tiff-4.0.2/libtiff -LOCAL_CFLAGS += $(SVNDEF) -DNO_GSMLIB -I../../../../../../libs/spandsp/src -I../../../../../..//libs/tiff-4.0.2/libtiff -LOCAL_LDFLAGS=-lasound -L../../../../../../libs/spandsp/src -lspandsp -LOCAL_OBJS=gsmopen_protocol.o -include ../../../../../../build/modmake.rules diff --git a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/asound.conf b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/asound.conf deleted file mode 100644 index c3a8068e9c..0000000000 --- a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/asound.conf +++ /dev/null @@ -1,6 +0,0 @@ -defaults.pcm.rate_converter "linear" -#defaults.pcm.rate_converter "speexrate" -#defaults.pcm.dmix.rate 16000 -#defaults.pcm.dsnoop.rate 16000 - - diff --git a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/gsmopen.conf.xml b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/gsmopen.conf.xml deleted file mode 100644 index d21a4c1969..0000000000 --- a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/gsmopen.conf.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/gsmopen.conf.xml.motorola b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/gsmopen.conf.xml.motorola deleted file mode 100644 index a38257ef1c..0000000000 --- a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/gsmopen.conf.xml.motorola +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/setmixers b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/setmixers deleted file mode 100755 index 063904b9cf..0000000000 --- a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/configs/setmixers +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# ALSA can manage a max of 8 cards -CARD_LIST="0 1 2 3 4 5 6 7" - -for i in $CARD_LIST; do - -#amixer -c ${i} -q set Mic 0% mute -amixer -c ${i} -q set Speaker 70% unmute >/dev/null 2>&1 -amixer -c ${i} -q set Mic cap mute 70% >/dev/null 2>&1 -amixer -c ${i} -q set "Auto Gain Control" off >/dev/null 2>&1 - -done diff --git a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/gsmopen.h b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/gsmopen.h deleted file mode 100644 index cf8561a683..0000000000 --- a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/gsmopen.h +++ /dev/null @@ -1,665 +0,0 @@ -/* - * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005/2012, Anthony Minessale II - * - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * - * The Initial Developer of the Original Code is - * Anthony Minessale II - * Portions created by the Initial Developer are Copyright (C) - * the Initial Developer. All Rights Reserved. - * - * This module (mod_gsmopen) has been contributed by: - * - * Giovanni Maruzzelli (gmaruzz@gmail.com) - * - * - * Further Contributors: - * - * - * - * mod_gsmopen.c -- GSM compatible Endpoint Module - * - */ - -#define __STDC_LIMIT_MACROS - -#ifdef WIN32 -#define HAVE_VSNPRINTF -#pragma warning(disable: 4290) -#endif //WIN32 - -#define MY_EVENT_INCOMING_SMS "gsmopen::incoming_sms" -#define MY_EVENT_DUMP "gsmopen::dump_event" -#define MY_EVENT_ALARM "gsmopen::alarm" - -#define ALARM_FAILED_INTERFACE 0 -#define ALARM_NO_NETWORK_REGISTRATION 1 -#define ALARM_ROAMING_NETWORK_REGISTRATION 2 -#define ALARM_NETWORK_NO_SERVICE 3 -#define ALARM_NETWORK_NO_SIGNAL 4 -#define ALARM_NETWORK_LOW_SIGNAL 5 - - - - - -#undef GIOVA48 - -#ifndef GIOVA48 -#define SAMPLES_PER_FRAME 160 -#else // GIOVA48 -#define SAMPLES_PER_FRAME 960 -#endif // GIOVA48 - - -#ifndef GIOVA48 -#define GSMOPEN_FRAME_SIZE 160 -#else //GIOVA48 -#define GSMOPEN_FRAME_SIZE 960 -#endif //GIOVA48 -#define SAMPLERATE_GSMOPEN 8000 - -#ifndef NO_ALSA -#define GSMOPEN_ALSA -#endif // NO_ALSA -#include -#ifndef WIN32 -#include -#include -#include -#endif //WIN32 -//#include - -#ifdef GSMOPEN_ALSA -#define ALSA_PCM_NEW_HW_PARAMS_API -#define ALSA_PCM_NEW_SW_PARAMS_API -#include -#endif /* GSMOPEN_ALSA */ - -#ifdef GSMOPEN_PORTAUDIO -#include "pablio.h" -#undef WANT_SPEEX -#ifdef WANT_SPEEX -#include "speex/speex_preprocess.h" -#include "speex/speex_echo.h" -#endif /* WANT_SPEEX */ -#endif// GSMOPEN_PORTAUDIO - -//#include "celliax_spandsp.h" -#ifndef WIN32 -#include -//#include -//#include -//#include -#endif //WIN32 - -#define SPANDSP_EXPOSE_INTERNAL_STRUCTURES -#include -#include - -#ifdef _MSC_VER -//Windows macro for FD_SET includes a warning C4127: conditional expression is constant -#pragma warning(push) -#pragma warning(disable:4127) -#endif - -#define PROTOCOL_ALSA_VOICEMODEM 4 -#define PROTOCOL_AT 2 -#define PROTOCOL_FBUS2 1 -#define PROTOCOL_NO_SERIAL 3 - -#define AT_BUFSIZ 8192 -//FIXME FIXME FIXME #define AT_MESG_MAX_LENGTH 2048 /* much more than 10 SMSs */ -#define AT_MESG_MAX_LENGTH 2048 /* much more than 10 SMSs */ -//FIXME FIXME FIXME #define AT_MESG_MAX_LINES 256 /* 256 lines, so it can contains the results of AT+CLAC, that gives all the AT commands the phone supports */ -#define AT_MESG_MAX_LINES 20 /* 256 lines, so it can contains the results of AT+CLAC, that gives all the AT commands the phone supports */ - -//#define SAMPLERATE_GSMOPEN 16000 -//#define SAMPLES_PER_FRAME SAMPLERATE_GSMOPEN/50 - -#ifndef GSMOPEN_SVN_VERSION -#define GSMOPEN_SVN_VERSION switch_version_full() -#endif /* GSMOPEN_SVN_VERSION */ - -typedef enum { - TFLAG_IO = (1 << 0), - TFLAG_INBOUND = (1 << 1), - TFLAG_OUTBOUND = (1 << 2), - TFLAG_DTMF = (1 << 3), - TFLAG_VOICE = (1 << 4), - TFLAG_HANGUP = (1 << 5), - TFLAG_LINEAR = (1 << 6), - TFLAG_CODEC = (1 << 7), - TFLAG_BREAK = (1 << 8) -} TFLAGS; - -typedef enum { - GFLAG_MY_CODEC_PREFS = (1 << 0) -} GFLAGS; - -#define DEBUGA_GSMOPEN(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][DEBUG_GSMOPEN %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define DEBUGA_CALL(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][DEBUG_CALL %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define DEBUGA_PBX(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][DEBUG_PBX %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define ERRORA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][ERRORA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define WARNINGA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][WARNINGA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define NOTICA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "rev "GSMOPEN_SVN_VERSION "[%p|%-7lx][NOTICA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); - -#define GSMOPEN_P_LOG (void *)NULL, (unsigned long)55, __LINE__, tech_pvt ? tech_pvt->name ? tech_pvt->name : "none" : "none", -1, tech_pvt ? tech_pvt->interface_state : -1, tech_pvt ? tech_pvt->phone_callflow : -1 - -/*********************************/ -#define GSMOPEN_CAUSE_NORMAL 1 -#define GSMOPEN_CAUSE_FAILURE 2 -#define GSMOPEN_CAUSE_NO_ANSWER 3 -/*********************************/ -#define GSMOPEN_FRAME_DTMF 1 -/*********************************/ -#define GSMOPEN_CONTROL_RINGING 1 -#define GSMOPEN_CONTROL_ANSWER 2 -#define GSMOPEN_CONTROL_HANGUP 3 -#define GSMOPEN_CONTROL_BUSY 4 - -/*********************************/ -#define GSMOPEN_STATE_IDLE 0 -#define GSMOPEN_STATE_DOWN 1 -#define GSMOPEN_STATE_RING 2 -#define GSMOPEN_STATE_DIALING 3 -#define GSMOPEN_STATE_BUSY 4 -#define GSMOPEN_STATE_UP 5 -#define GSMOPEN_STATE_RINGING 6 -#define GSMOPEN_STATE_PRERING 7 -#define GSMOPEN_STATE_ERROR_DOUBLE_CALL 8 -#define GSMOPEN_STATE_SELECTED 9 -#define GSMOPEN_STATE_HANGUP_REQUESTED 10 -#define GSMOPEN_STATE_PREANSWER 11 -/*********************************/ -/* call flow from the device */ -#define CALLFLOW_CALL_IDLE 0 -#define CALLFLOW_CALL_DOWN 1 -#define CALLFLOW_INCOMING_RING 2 -#define CALLFLOW_CALL_DIALING 3 -#define CALLFLOW_CALL_LINEBUSY 4 -#define CALLFLOW_CALL_ACTIVE 5 -#define CALLFLOW_INCOMING_HANGUP 6 -#define CALLFLOW_CALL_RELEASED 7 -#define CALLFLOW_CALL_NOCARRIER 8 -#define CALLFLOW_CALL_INFLUX 9 -#define CALLFLOW_CALL_INCOMING 10 -#define CALLFLOW_CALL_FAILED 11 -#define CALLFLOW_CALL_NOSERVICE 12 -#define CALLFLOW_CALL_OUTGOINGRESTRICTED 13 -#define CALLFLOW_CALL_SECURITYFAIL 14 -#define CALLFLOW_CALL_NOANSWER 15 -#define CALLFLOW_STATUS_FINISHED 16 -#define CALLFLOW_STATUS_CANCELLED 17 -#define CALLFLOW_STATUS_FAILED 18 -#define CALLFLOW_STATUS_REFUSED 19 -#define CALLFLOW_STATUS_RINGING 20 -#define CALLFLOW_STATUS_INPROGRESS 21 -#define CALLFLOW_STATUS_UNPLACED 22 -#define CALLFLOW_STATUS_ROUTING 23 -#define CALLFLOW_STATUS_EARLYMEDIA 24 -#define CALLFLOW_INCOMING_CALLID 25 -#define CALLFLOW_STATUS_REMOTEHOLD 26 -#define CALLFLOW_CALL_REMOTEANSWER 27 -#define CALLFLOW_CALL_HANGUP_REQUESTED 28 - -/*********************************/ - -#define AT_OK 0 -#define AT_ERROR 1 - -#define GSMOPEN_MAX_INTERFACES 64 - -#ifndef WIN32 -struct GSMopenHandles { - //Window gsmopen_win; - //Display *disp; - //Window win; - int currentuserhandle; - int api_connected; - int fdesc[2]; -}; -#else //WIN32 - -struct GSMopenHandles { - HWND win32_hInit_MainWindowHandle; - HWND win32_hGlobal_GSMAPIWindowHandle; - HINSTANCE win32_hInit_ProcessHandle; - char win32_acInit_WindowClassName[128]; - UINT win32_uiGlobal_MsgID_GSMControlAPIAttach; - UINT win32_uiGlobal_MsgID_GSMControlAPIDiscover; - int currentuserhandle; - int api_connected; - switch_file_t *fdesc[2]; -}; - -#endif //WIN32 - -/*! - * \brief structure for storing the results of AT commands, in an array of AT_MESG_MAX_LINES * AT_MESG_MAX_LENGTH chars - */ -struct s_result { - int elemcount; - char result[AT_MESG_MAX_LINES][AT_MESG_MAX_LENGTH]; -}; - -struct ciapa_struct { - int state; - int hangupcause; -}; -typedef struct ciapa_struct ciapa_t; - -struct private_object { - unsigned int flags; - switch_codec_t read_codec; - switch_codec_t write_codec; - switch_frame_t read_frame; - unsigned char databuf[SWITCH_RECOMMENDED_BUFFER_SIZE]; - char session_uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; - switch_caller_profile_t *caller_profile; - switch_mutex_t *mutex; - switch_mutex_t *flag_mutex; - - char id[80]; - char name[80]; - char dialplan[80]; - char context[80]; - char dial_regex[256]; - char fail_dial_regex[256]; - char hold_music[256]; - char type[256]; - char X11_display[256]; -#ifdef WIN32 - unsigned short tcp_cli_port; - unsigned short tcp_srv_port; -#else - int tcp_cli_port; - int tcp_srv_port; -#endif - struct GSMopenHandles GSMopenHandles; - - int interface_state; /*!< \brief 'state' of the interface (channel) */ - char language[80]; /*!< \brief default Asterisk dialplan language for this interface */ - char exten[80]; /*!< \brief default Asterisk dialplan extension for this interface */ - int gsmopen_sound_rate; /*!< \brief rate of the sound device, in Hz, eg: 8000 */ - char callid_name[50]; - char callid_number[50]; - double playback_boost; - double capture_boost; - int stripmsd; - char gsmopen_call_id[512]; - int gsmopen_call_ongoing; - char gsmopen_friends[4096]; - char gsmopen_fullname[512]; - char gsmopen_displayname[512]; - int phone_callflow; /*!< \brief 'callflow' of the gsmopen interface (as opposed to phone interface) */ - int gsmopen; /*!< \brief config flag, bool, GSM support on this interface (0 if false, -1 if true) */ - int control_to_send; -#ifdef WIN32 - switch_file_t *audiopipe[2]; - switch_file_t *audiogsmopenpipe[2]; - switch_file_t *gsmopen_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */ -#else /* WIN32 */ - int audiopipe[2]; - int audiogsmopenpipe[2]; - int gsmopen_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */ -#endif /* WIN32 */ - switch_thread_t *tcp_srv_thread; - switch_thread_t *tcp_cli_thread; - switch_thread_t *gsmopen_signaling_thread; - switch_thread_t *gsmopen_api_thread; - //short audiobuf[SAMPLES_PER_FRAME]; - //int audiobuf_is_loaded; - - //int phonebook_listing; - //int phonebook_querying; - //int phonebook_listing_received_calls; - - //int phonebook_first_entry; - //int phonebook_last_entry; - //int phonebook_number_lenght; - //int phonebook_text_lenght; - int gsmopen_dir_entry_extension_prefix; - char gsmopen_user[256]; - char gsmopen_password[256]; - char destination[256]; - struct timeval answer_time; - - struct timeval transfer_time; - char transfer_callid_number[50]; - char gsmopen_transfer_call_id[512]; - int running; - unsigned long ib_calls; - unsigned long ob_calls; - unsigned long ib_failed_calls; - unsigned long ob_failed_calls; - - - char controldevice_name[50]; /*!< \brief name of the serial device controlling the interface, possibly none */ - int controldevprotocol; /*!< \brief which protocol is used for serial control of this interface */ - char controldevprotocolname[50]; /*!< \brief name of the serial device controlling protocol, one of "at" "fbus2" "no_serial" "alsa_voicemodem" */ - int controldevfd; /*!< \brief serial controlling file descriptor for this interface */ - //pthread_t controldev_thread; /*!< \brief serial control thread for this interface, running during the call */ -#ifdef WIN32 - int controldevice_speed; -#else - speed_t controldevice_speed; -#endif// WIN32 - int controldev_dead; - - char at_dial_pre_number[64]; - char at_dial_post_number[64]; - char at_dial_expect[64]; - unsigned int at_early_audio; - char at_hangup[64]; - char at_hangup_expect[64]; - char at_answer[64]; - char at_answer_expect[64]; - unsigned int at_initial_pause; - char at_preinit_1[64]; - char at_preinit_1_expect[64]; - char at_preinit_2[64]; - char at_preinit_2_expect[64]; - char at_preinit_3[64]; - char at_preinit_3_expect[64]; - char at_preinit_4[64]; - char at_preinit_4_expect[64]; - char at_preinit_5[64]; - char at_preinit_5_expect[64]; - unsigned int at_after_preinit_pause; - - char at_postinit_1[64]; - char at_postinit_1_expect[64]; - char at_postinit_2[64]; - char at_postinit_2_expect[64]; - char at_postinit_3[64]; - char at_postinit_3_expect[64]; - char at_postinit_4[64]; - char at_postinit_4_expect[64]; - char at_postinit_5[64]; - char at_postinit_5_expect[64]; - - char at_send_dtmf[64]; - - char at_query_battchg[64]; - char at_query_battchg_expect[64]; - char at_query_signal[64]; - char at_query_signal_expect[64]; - char at_call_idle[64]; - char at_call_incoming[64]; - char at_call_active[64]; - char at_call_failed[64]; - char at_call_calling[64]; - -#define CIEV_STRING_SIZE 64 - char at_indicator_noservice_string[64]; - char at_indicator_nosignal_string[64]; - char at_indicator_lowsignal_string[64]; - char at_indicator_lowbattchg_string[64]; - char at_indicator_nobattchg_string[64]; - char at_indicator_callactive_string[64]; - char at_indicator_nocallactive_string[64]; - char at_indicator_nocallsetup_string[64]; - char at_indicator_callsetupincoming_string[64]; - char at_indicator_callsetupoutgoing_string[64]; - char at_indicator_callsetupremoteringing_string[64]; - - int at_indicator_callp; - int at_indicator_callsetupp; - int at_indicator_roamp; - int at_indicator_battchgp; - int at_indicator_servicep; - int at_indicator_signalp; - - int at_has_clcc; - int at_has_ecam; - - char at_cmgw[16]; - int no_ucs2; - time_t gsmopen_serial_sync_period; - - time_t gsmopen_serial_synced_timestamp; - struct s_result line_array; - - - int unread_sms_msg_id; - int reading_sms_msg; - char sms_message[4800]; - char sms_sender[256]; - char sms_date[256]; - char sms_userdataheader[256]; - char sms_body[4800]; - char sms_datacodingscheme[256]; - char sms_servicecentreaddress[256]; - int sms_messagetype; - int sms_cnmi_not_supported; - int sms_pdu_not_supported; - //char sms_receiving_program[256]; - - - struct timeval call_incoming_time; - switch_mutex_t *controldev_lock; - - int phonebook_listing; - int phonebook_querying; - int phonebook_listing_received_calls; - - int phonebook_first_entry; - int phonebook_last_entry; - int phonebook_number_lenght; - int phonebook_text_lenght; - FILE *phonebook_writing_fp; - - struct timeval ringtime; - ciapa_t *owner; -#ifdef GSMOPEN_ALSA - snd_pcm_t *alsac; /*!< \brief handle of the ALSA capture audio device */ - snd_pcm_t *alsap; /*!< \brief handle of the ALSA playback audio device */ - char alsacname[50]; /*!< \brief name of the ALSA capture audio device */ - char alsapname[50]; /*!< \brief name of the ALSA playback audio device */ - int alsa_period_size; /*!< \brief ALSA period_size, in byte */ - int alsa_periods_in_buffer; /*!< \brief how many periods in ALSA buffer, to calculate buffer_size */ - unsigned long int alsa_buffer_size; /*!< \brief ALSA buffer_size, in byte */ - int alsawrite_filled; - int alsa_capture_is_mono; - int alsa_play_is_mono; - struct pollfd pfd; -#endif // GSMOPEN_ALSA - - time_t audio_play_reset_timestamp; - int audio_play_reset_period; - - switch_timer_t timer_read; - switch_timer_t timer_write; - teletone_dtmf_detect_state_t dtmf_detect; - switch_time_t old_dtmf_timestamp; - - int no_sound; - -#ifdef GSMOPEN_PORTAUDIO - int speexecho; - int speexpreprocess; - int portaudiocindex; /*!< \brief Index of the Portaudio capture audio device */ - int portaudiopindex; /*!< \brief Index of the Portaudio playback audio device */ - PABLIO_Stream *stream; - -#ifdef WANT_SPEEX - SpeexPreprocessState *preprocess; - SpeexEchoState *echo_state; -#endif// WANT_SPEEX -#endif// GSMOPEN_PORTAUDIO - dtmf_rx_state_t dtmf_state; - int active; - int home_network_registered; - int roaming_registered; - int not_registered; - int got_signal; - char imei[128]; - int requesting_imei; - char imsi[128]; - int requesting_imsi; - int network_creg_not_supported; - char creg[128]; - -}; - -typedef struct private_object private_t; - -void *SWITCH_THREAD_FUNC gsmopen_api_thread_func(switch_thread_t * thread, void *obj); -int gsmopen_audio_read(private_t * tech_pvt); -int gsmopen_audio_init(private_t * tech_pvt); -int gsmopen_signaling_read(private_t * tech_pvt); - -int gsmopen_call(private_t * tech_pvt, char *idest, int timeout); -int gsmopen_senddigit(private_t * tech_pvt, char digit); - -void *gsmopen_do_tcp_srv_thread_func(void *obj); -void *SWITCH_THREAD_FUNC gsmopen_do_tcp_srv_thread(switch_thread_t * thread, void *obj); - -void *gsmopen_do_tcp_cli_thread_func(void *obj); -void *SWITCH_THREAD_FUNC gsmopen_do_tcp_cli_thread(switch_thread_t * thread, void *obj); - -void *gsmopen_do_gsmopenapi_thread_func(void *obj); -void *SWITCH_THREAD_FUNC gsmopen_do_gsmopenapi_thread(switch_thread_t * thread, void *obj); -int dtmf_received(private_t * tech_pvt, char *value); -int start_audio_threads(private_t * tech_pvt); -int new_inbound_channel(private_t * tech_pvt); -int outbound_channel_answered(private_t * tech_pvt); -//int gsmopen_signaling_write(private_t * tech_pvt, char *msg_to_gsmopen); -#if defined(WIN32) && !defined(__CYGWIN__) -int gsmopen_pipe_read(switch_file_t * pipe, short *buf, int howmany); -int gsmopen_pipe_write(switch_file_t * pipe, short *buf, int howmany); -/* Visual C do not have strsep ? */ -char *strsep(char **stringp, const char *delim); -#else -int gsmopen_pipe_read(int pipe, short *buf, int howmany); -int gsmopen_pipe_write(int pipe, short *buf, int howmany); -#endif /* WIN32 */ -int gsmopen_close_socket(unsigned int fd); -private_t *find_available_gsmopen_interface_rr(private_t * tech_pvt_calling); -int remote_party_is_ringing(private_t * tech_pvt); -int remote_party_is_early_media(private_t * tech_pvt); -//int gsmopen_answer(private_t * tech_pvt, char *id, char *value); -#if 0 -int gsmopen_transfer(private_t * tech_pvt, char *id, char *value); -#endif //0 -int gsmopen_socket_create_and_bind(private_t * tech_pvt, int *which_port); - - - - - -void *gsmopen_do_controldev_thread(void *data); -#ifdef WIN32 -int gsmopen_serial_init(private_t * tech_pvt, int controldevice_speed); -#else -int gsmopen_serial_init(private_t * tech_pvt, speed_t controldevice_speed); -#endif //WIN32 -int gsmopen_serial_monitor(private_t * tech_pvt); -int gsmopen_serial_sync(private_t * tech_pvt); -int gsmopen_serial_sync_AT(private_t * tech_pvt); -int gsmopen_serial_config(private_t * tech_pvt); -int gsmopen_serial_config_AT(private_t * tech_pvt); - -#define gsmopen_serial_write_AT_expect(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 2) -#define gsmopen_serial_write_AT_expect_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 2) -#define gsmopen_serial_write_AT_expect_noexpcr_tout(P, D, S, T) gsmopen_serial_write_AT_expect1(P, D, S, 0, T) -// 20.5 sec timeout, used for querying the SIM and sending SMSs -#define gsmopen_serial_write_AT_expect_longtime(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 20) -#define gsmopen_serial_write_AT_expect_longtime_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 20) -int gsmopen_serial_write_AT(private_t * tech_pvt, const char *data); -int gsmopen_serial_write_AT_nocr(private_t * tech_pvt, const char *data); -int gsmopen_serial_write_AT_ack(private_t * tech_pvt, const char *data); -int gsmopen_serial_write_AT_ack_nocr_longtime(private_t * tech_pvt, const char *data); -int gsmopen_serial_write_AT_noack(private_t * tech_pvt, const char *data); -int gsmopen_serial_write_AT_expect1(private_t * tech_pvt, const char *data, const char *expected_string, int expect_crlf, int seconds); -int gsmopen_serial_AT_expect(private_t * tech_pvt, const char *expected_string, int expect_crlf, int seconds); -int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_usec, int timeout_sec, const char *expected_string, int expect_crlf); -int gsmopen_serial_read(private_t * tech_pvt); -#ifdef NOTDEF -int gsmopen_serial_getstatus(private_t * tech_pvt); -int gsmopen_serial_hangup(private_t * tech_pvt); -int gsmopen_serial_answer(private_t * tech_pvt); -int gsmopen_serial_answer_AT(private_t * tech_pvt); -int gsmopen_serial_hangup_AT(private_t * tech_pvt); -int gsmopen_serial_call_AT(private_t * tech_pvt, char *dstr); -int gsmopen_serial_getstatus_AT(private_t * tech_pvt); -#endif // NOTDEF -#define RESULT_FAILURE 0 -#define RESULT_SUCCESS 1 -int utf_to_ucs2(private_t * tech_pvt, char *utf_in, size_t inbytesleft, char *ucs2_out, size_t outbytesleft); -int ucs2_to_utf8(private_t * tech_pvt, char *ucs2_in, char *utf8_out, size_t outbytesleft); -//#define PUSHA_UNLOCKA(x) pthread_cleanup_push(gsmopen_unlocka_log, (void *) x); -//#define POPPA_UNLOCKA(x) pthread_cleanup_pop(0); - -#define PUSHA_UNLOCKA(x) if(option_debug > 100) ERRORA("PUSHA_UNLOCKA: %p\n", GSMOPEN_P_LOG, (void *)x); -#define POPPA_UNLOCKA(x) if(option_debug > 100) ERRORA("POPPA_UNLOCKA: %p\n", GSMOPEN_P_LOG, (void *)x); -//#define LOKKA(x) if(option_debug > 100) ERRORA("LOKKA: %p\n", GSMOPEN_P_LOG, (void *)x); -#define LOKKA(x) switch_mutex_lock(x); -#define UNLOCKA(x) switch_mutex_unlock(x); -//#define UNLOCKA(x) if(option_debug > 100) ERRORA("UNLOCKA: %p\n", GSMOPEN_P_LOG, (void *)x); - -#define gsmopen_queue_control(x, y) ERRORA("gsmopen_queue_control: %p, %d\n", GSMOPEN_P_LOG, (void *)x, y); - -#define ast_setstate(x, y) ERRORA("ast_setstate: %p, %d\n", GSMOPEN_P_LOG, (void *)x, y); - -int gsmopen_serial_read(private_t * tech_pvt); -int gsmopen_answer(private_t * tech_pvt); -int gsmopen_serial_answer(private_t * tech_pvt); -int gsmopen_serial_answer_AT(private_t * tech_pvt); -int gsmopen_serial_hangup(private_t * tech_pvt); -int gsmopen_serial_hangup_AT(private_t * tech_pvt); -int gsmopen_hangup(private_t * tech_pvt); -int gsmopen_serial_call(private_t * tech_pvt, char *dstr); -int gsmopen_serial_call_AT(private_t * tech_pvt, char *dstr); -int gsmopen_sendsms(private_t * tech_pvt, char *dest, char *text); - -#ifdef GSMOPEN_ALSA -int alsa_init(private_t * tech_pvt); -int alsa_shutdown(private_t * tech_pvt); -snd_pcm_t *alsa_open_dev(private_t * tech_pvt, snd_pcm_stream_t stream); -int alsa_write(private_t * tech_pvt, short *data, int datalen); -int alsa_read(private_t * tech_pvt, short *data, int datalen); - -#endif /* GSMOPEN_ALSA */ - - -void gsmopen_store_boost(char *s, double *boost); -int gsmopen_sound_boost(void *data, int samples_num, double boost); -int sms_incoming(private_t * tech_pvt); -int gsmopen_ring(private_t * tech_pvt); - -int iso_8859_1_to_utf8(private_t * tech_pvt, char *iso_8859_1_in, char *utf8_out, size_t outbytesleft); -int gsmopen_serial_getstatus_AT(private_t * tech_pvt); - - -#ifdef GSMOPEN_PORTAUDIO - -int gsmopen_portaudio_devlist(private_t *tech_pvt); - -int gsmopen_portaudio_init(private_t *tech_pvt); - -int gsmopen_portaudio_write(private_t * tech_pvt, short *data, int datalen); - -int gsmopen_portaudio_read(private_t * tech_pvt, short *data, int datalen); - - -int gsmopen_portaudio_shutdown(private_t *tech_pvt); - -#endif // GSMOPEN_PORTAUDIO -int dump_event(private_t *tech_pvt); -int alarm_event(private_t * tech_pvt, int alarm_code, const char *alarm_message); -int dump_event_full(private_t * tech_pvt, int is_alarm, int alarm_code, const char *alarm_message); diff --git a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/gsmopen_protocol.c b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/gsmopen_protocol.c deleted file mode 100644 index 5a97ffa873..0000000000 --- a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/gsmopen_protocol.c +++ /dev/null @@ -1,4009 +0,0 @@ -#include "gsmopen.h" -//#include - -#ifndef NO_GSMLIB -#include -#ifdef WIN32 -#include -#else -#include -#endif -#include -#include - - -using namespace std; -using namespace gsmlib; -#endif// NO_GSMLIB - -#ifdef ASTERISK -#define gsmopen_sleep usleep -#define gsmopen_strncpy strncpy -#define tech_pvt p -extern int gsmopen_debug; -extern char *gsmopen_console_active; -#else /* FREESWITCH */ -#define gsmopen_sleep switch_sleep -#define gsmopen_strncpy switch_copy_string -extern switch_memory_pool_t *gsmopen_module_pool; -extern switch_endpoint_interface_t *gsmopen_endpoint_interface; -#endif /* ASTERISK */ -//int samplerate_gsmopen = SAMPLERATE_GSMOPEN; - -extern int running; -int gsmopen_dir_entry_extension = 1; - -int option_debug = 100; - - -#ifdef WIN32 -#define GSMLIBGIO -#else //WIN32 -#undef GSMLIBGIO -#endif //WIN32 - -#ifdef WIN32 -/***************/ -// from http://www.openasthra.com/c-tidbits/gettimeofday-function-for-windows/ - -#include - -#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) -#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 -#else /* */ -#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL -#endif /* */ -struct sk_timezone { - int tz_minuteswest; /* minutes W of Greenwich */ - int tz_dsttime; /* type of dst correction */ -}; -int gettimeofday(struct timeval *tv, struct sk_timezone *tz) -{ - FILETIME ft; - unsigned __int64 tmpres = 0; - static int tzflag; - if (NULL != tv) { - GetSystemTimeAsFileTime(&ft); - tmpres |= ft.dwHighDateTime; - tmpres <<= 32; - tmpres |= ft.dwLowDateTime; - - /*converting file time to unix epoch */ - tmpres /= 10; /*convert into microseconds */ - tmpres -= DELTA_EPOCH_IN_MICROSECS; - tv->tv_sec = (long) (tmpres / 1000000UL); - tv->tv_usec = (long) (tmpres % 1000000UL); - } - if (NULL != tz) { - if (!tzflag) { - _tzset(); - tzflag++; - } - tz->tz_minuteswest = _timezone / 60; - tz->tz_dsttime = _daylight; - } - return 0; -} - -/***************/ -#endif /* WIN32 */ - -#ifdef GSMOPEN_PORTAUDIO -#include "pablio.h" - -#ifndef GIOVA48 -#define SAMPLES_PER_FRAME 160 -#else // GIOVA48 -#define SAMPLES_PER_FRAME 960 -#endif // GIOVA48 - -int gsmopen_portaudio_devlist(private_t *tech_pvt) -{ - int i, numDevices; - const PaDeviceInfo *deviceInfo; - - numDevices = Pa_GetDeviceCount(); - if (numDevices < 0) { - return 0; - } - for (i = 0; i < numDevices; i++) { - deviceInfo = Pa_GetDeviceInfo(i); - NOTICA - ("Found PORTAUDIO device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", - GSMOPEN_P_LOG, i, deviceInfo->name, deviceInfo->maxInputChannels, - deviceInfo->maxOutputChannels); - } - - return numDevices; -} - -int gsmopen_portaudio_init(private_t *tech_pvt) -{ - PaError err; - int c; - PaStreamParameters inputParameters, outputParameters; - int numdevices; - const PaDeviceInfo *deviceInfo; - -#ifndef GIOVA48 - setenv("PA_ALSA_PLUGHW", "1", 1); -#endif // GIOVA48 - - err = Pa_Initialize(); - if (err != paNoError) - return err; - - numdevices = gsmopen_portaudio_devlist(tech_pvt); - - if (tech_pvt->portaudiocindex > (numdevices - 1)) { - ERRORA("Portaudio Capture id=%d is out of range: valid id are from 0 to %d\n", - GSMOPEN_P_LOG, tech_pvt->portaudiocindex, (numdevices - 1)); - return -1; - } - - if (tech_pvt->portaudiopindex > (numdevices - 1)) { - ERRORA("Portaudio Playback id=%d is out of range: valid id are from 0 to %d\n", - GSMOPEN_P_LOG, tech_pvt->portaudiopindex, (numdevices - 1)); - return -1; - } - //inputParameters.device = 0; - if (tech_pvt->portaudiocindex != -1) { - inputParameters.device = tech_pvt->portaudiocindex; - } else { - inputParameters.device = Pa_GetDefaultInputDevice(); - } - deviceInfo = Pa_GetDeviceInfo(inputParameters.device); - NOTICA - ("Using INPUT PORTAUDIO device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", - GSMOPEN_P_LOG, inputParameters.device, deviceInfo->name, - deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels); - if (deviceInfo->maxInputChannels == 0) { - ERRORA - ("No INPUT channels on device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", - GSMOPEN_P_LOG, inputParameters.device, deviceInfo->name, - deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels); - return -1; - } - inputParameters.channelCount = 1; - inputParameters.sampleFormat = paInt16; - //inputParameters.suggestedLatency = Pa_GetDeviceInfo(inputParameters.device)->defaultHighInputLatency; - inputParameters.suggestedLatency = 0.1; - inputParameters.hostApiSpecificStreamInfo = NULL; - - //outputParameters.device = 3; - if (tech_pvt->portaudiopindex != -1) { - outputParameters.device = tech_pvt->portaudiopindex; - } else { - outputParameters.device = Pa_GetDefaultOutputDevice(); - } - deviceInfo = Pa_GetDeviceInfo(outputParameters.device); - NOTICA - ("Using OUTPUT PORTAUDIO device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", - GSMOPEN_P_LOG, outputParameters.device, deviceInfo->name, - deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels); - if (deviceInfo->maxOutputChannels == 0) { - ERRORA - ("No OUTPUT channels on device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", - GSMOPEN_P_LOG, inputParameters.device, deviceInfo->name, - deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels); - return -1; - } -#ifndef GIOVA48 - outputParameters.channelCount = 1; -#else // GIOVA48 - outputParameters.channelCount = 2; -#endif // GIOVA48 - outputParameters.sampleFormat = paInt16; - //outputParameters.suggestedLatency = Pa_GetDeviceInfo(outputParameters.device)->defaultHighOutputLatency; - outputParameters.suggestedLatency = 0.1; - outputParameters.hostApiSpecificStreamInfo = NULL; - -/* build the pipe that will be polled on by pbx */ - c = pipe(tech_pvt->audiopipe); - if (c) { - ERRORA("Unable to create audio pipe\n", GSMOPEN_P_LOG); - return -1; - } - fcntl(tech_pvt->audiopipe[0], F_SETFL, O_NONBLOCK); - fcntl(tech_pvt->audiopipe[1], F_SETFL, O_NONBLOCK); - - err = -#ifndef GIOVA48 - OpenAudioStream(&tech_pvt->stream, &inputParameters, &outputParameters, 8000, - paClipOff|paDitherOff, SAMPLES_PER_FRAME, 0); - //&tech_pvt->speexecho, &tech_pvt->speexpreprocess, &tech_pvt->owner); - -#else // GIOVA48 - OpenAudioStream(&tech_pvt->stream, &inputParameters, &outputParameters, 48000, - paDitherOff | paClipOff, SAMPLES_PER_FRAME, tech_pvt->audiopipe[1], - &tech_pvt->speexecho, &tech_pvt->speexpreprocess, &tech_pvt->owner); - - -#endif// GIOVA48 - if (err != paNoError) { - ERRORA("Unable to open audio stream: %s\n", GSMOPEN_P_LOG, Pa_GetErrorText(err)); - return -1; - } - -/* the pipe is our audio fd for pbx to poll on */ - tech_pvt->gsmopen_sound_capt_fd = tech_pvt->audiopipe[0]; - - return 0; -} -//int gsmopen_portaudio_write(private_t *tech_pvt, struct ast_frame *f) -int gsmopen_portaudio_write(private_t * tech_pvt, short *data, int datalen) -{ - int samples; -#ifdef GIOVA48 - //short buf[GSMOPEN_FRAME_SIZE * 2]; - short buf[3840]; - short *buf2; - - //ERRORA("1 f->datalen=: %d\n", GSMOPEN_P_LOG, f->datalen); - - - - - memset(buf, '\0', GSMOPEN_FRAME_SIZE *2); - - buf2 = f->data; - - int i=0, a=0; - - for(i=0; i< f->datalen / sizeof(short); i++){ -//stereo, 2 chan 48 -> mono 8 - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - /* - */ - } - f->data = &buf; - f->datalen = f->datalen * 6; - //ERRORA("2 f->datalen=: %d\n", GSMOPEN_P_LOG, f->datalen); - //f->datalen = f->datalen; -#endif // GIOVA48 - - - samples = - WriteAudioStream(tech_pvt->stream, (short *) data, (int) (datalen / sizeof(short)), &tech_pvt->timer_write); - - if (samples != (int) (datalen / sizeof(short))) - ERRORA("WriteAudioStream wrote: %d of %d\n", GSMOPEN_P_LOG, samples, - (int) (datalen / sizeof(short))); - - return samples; -} -//struct ast_frame *gsmopen_portaudio_read(private_t *tech_pvt) -#define AST_FRIENDLY_OFFSET 0 -int gsmopen_portaudio_read(private_t * tech_pvt, short *data, int datalen) -{ -#if 0 - //static struct ast_frame f; - static short __buf[GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2]; - short *buf; - static short __buf2[GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2]; - short *buf2; - int samples; - //char c; - - memset(__buf, '\0', (GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2)); - - buf = __buf + AST_FRIENDLY_OFFSET / 2; - - memset(__buf2, '\0', (GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2)); - - buf2 = __buf2 + AST_FRIENDLY_OFFSET / 2; - -#if 0 - f.frametype = AST_FRAME_NULL; - f.subclass = 0; - f.samples = 0; - f.datalen = 0; - -#ifdef ASTERISK_VERSION_1_6_1 - f.data.ptr = NULL; -#else - f.data = NULL; -#endif /* ASTERISK_VERSION_1_6_1 */ - f.offset = 0; - f.src = gsmopen_type; - f.mallocd = 0; - f.delivery.tv_sec = 0; - f.delivery.tv_usec = 0; -#endif //0 - - //if ((samples = ReadAudioStream(tech_pvt->stream, buf, SAMPLES_PER_FRAME)) == 0) - //if ((samples = ReadAudioStream(tech_pvt->stream, data, datalen/sizeof(short))) == 0) - if (samples = ReadAudioStream(tech_pvt->stream, (short *)data, datalen, &tech_pvt->timer_read) == 0) { - //do nothing - } else { -#ifdef GIOVA48 - int i=0, a=0; - - samples = samples / 6; - for(i=0; i< samples; i++){ - buf2[i] = buf[a]; - a = a + 6; //mono, 1 chan 48 -> 8 - } - buf = buf2; - -#if 0 - /* A real frame */ - f.frametype = AST_FRAME_VOICE; - f.subclass = AST_FORMAT_SLINEAR; - f.samples = GSMOPEN_FRAME_SIZE/6; - f.datalen = GSMOPEN_FRAME_SIZE * 2/6; -#endif //0 -#else// GIOVA48 -#if 0 - /* A real frame */ - f.frametype = AST_FRAME_VOICE; - f.subclass = AST_FORMAT_SLINEAR; - f.samples = GSMOPEN_FRAME_SIZE; - f.datalen = GSMOPEN_FRAME_SIZE * 2; -#endif //0 -#endif// GIOVA48 - -#if 0 -#ifdef ASTERISK_VERSION_1_6_1 - f.data.ptr = buf; -#else - f.data = buf; -#endif /* ASTERISK_VERSION_1_6_1 */ - f.offset = AST_FRIENDLY_OFFSET; - f.src = gsmopen_type; - f.mallocd = 0; -#endif //0 - } - -#if 0 - read(tech_pvt->audiopipe[0], &c, 1); - - return &f; -#endif //0 -#endif //0 - - int samples; - samples = ReadAudioStream(tech_pvt->stream, (short *)data, datalen, &tech_pvt->timer_read); - //WARNINGA("samples=%d\n", GSMOPEN_P_LOG, samples); - - return samples; -} -int gsmopen_portaudio_shutdown(private_t *tech_pvt) -{ - PaError err; - - err = CloseAudioStream(tech_pvt->stream); - - if (err != paNoError) - ERRORA("not able to CloseAudioStream\n", GSMOPEN_P_LOG); - - Pa_Terminate(); - return 0; -} - - - - -#endif // GSMOPEN_PORTAUDIO -#ifndef GSMLIBGIO -int gsmopen_serial_init(private_t * tech_pvt, speed_t controldevice_speed) -{ - int fd; - int rt; - struct termios tp; - unsigned int status = 0; - unsigned int flags = TIOCM_DTR; - -/* if there is a file descriptor, close it. But it is probably just an old value, so don't check for close success*/ - fd = tech_pvt->controldevfd; - if (fd) { - close(fd); - } -/* open the serial port */ -//#ifdef __CYGWIN__ - fd = open(tech_pvt->controldevice_name, O_RDWR | O_NOCTTY | O_NONBLOCK); - sleep(1); - close(fd); -//#endif /* __CYGWIN__ */ - fd = open(tech_pvt->controldevice_name, O_RDWR | O_NOCTTY | O_NONBLOCK); - if (fd == -1) { - perror("open error "); - DEBUGA_GSMOPEN("serial error: %s\n", GSMOPEN_P_LOG, strerror(errno)); - tech_pvt->controldevfd = fd; - return -1; - } -/* flush it */ - rt = tcflush(fd, TCIFLUSH); - if (rt == -1) { - ERRORA("serial error: %s", GSMOPEN_P_LOG, strerror(errno)); - } -/* attributes */ - tp.c_cflag = B0 | CS8 | CLOCAL | CREAD | HUPCL; - tp.c_iflag = IGNPAR; - tp.c_cflag &= ~CRTSCTS; - tp.c_oflag = 0; - tp.c_lflag = 0; - tp.c_cc[VMIN] = 1; - tp.c_cc[VTIME] = 0; -/* set controldevice_speed */ - rt = cfsetispeed(&tp, tech_pvt->controldevice_speed); - if (rt == -1) { - ERRORA("serial error: %s, speed was: %d", GSMOPEN_P_LOG, strerror(errno), tech_pvt->controldevice_speed); - } - rt = cfsetospeed(&tp, tech_pvt->controldevice_speed); - if (rt == -1) { - ERRORA("serial error: %s", GSMOPEN_P_LOG, strerror(errno)); - } -/* set port attributes */ - if (tcsetattr(fd, TCSADRAIN, &tp) == -1) { - ERRORA("serial error: %s", GSMOPEN_P_LOG, strerror(errno)); - } - rt = tcsetattr(fd, TCSANOW, &tp); - if (rt == -1) { - ERRORA("serial error: %s", GSMOPEN_P_LOG, strerror(errno)); - } -#ifndef __CYGWIN__ - ioctl(fd, TIOCMGET, &status); - status |= TIOCM_DTR; /* Set DTR high */ - status &= ~TIOCM_RTS; /* Set RTS low */ - ioctl(fd, TIOCMSET, &status); - ioctl(fd, TIOCMGET, &status); - ioctl(fd, TIOCMBIS, &flags); - flags = TIOCM_RTS; - ioctl(fd, TIOCMBIC, &flags); - ioctl(fd, TIOCMGET, &status); -#else /* __CYGWIN__ */ - ioctl(fd, TIOCMGET, &status); - status |= TIOCM_DTR; /* Set DTR high */ - status &= ~TIOCM_RTS; /* Set RTS low */ - ioctl(fd, TIOCMSET, &status); -#endif /* __CYGWIN__ */ - tech_pvt->controldevfd = fd; - DEBUGA_GSMOPEN("Syncing Serial, fd=%d, protocol=%d\n", GSMOPEN_P_LOG, fd, tech_pvt->controldevprotocol); - rt = gsmopen_serial_sync(tech_pvt); - if (rt == -1) { - ERRORA("Serial init error\n", GSMOPEN_P_LOG); - return -1; - } - return (fd); -} -#else //GSMLIBGIO -#ifdef WIN32 -int gsmopen_serial_init(private_t * tech_pvt, int controldevice_speed) -#else -int gsmopen_serial_init(private_t * tech_pvt, speed_t controldevice_speed) -#endif //WIN32 -{ - int i; - string ciapa; - SMSMessageRef sms; - char content2[1000]; - int size; - -#ifdef WIN32 - Ref port = new Win32SerialPort((string) tech_pvt->controldevice_name, 38400); -#else - //Ref port = new UnixSerialPort((string)argv[1], B38400); - Ref < Port > port = new UnixSerialPort((string) tech_pvt->controldevice_name, B115200); -#endif - MeTa m(port); - - //cout << "Creating GsmAt object" << endl; - Ref gsmat = new GsmAt(m); - - //cout << "Using GsmAt object" << endl; - //cout << gsmat->chat("AT", "OK", false, false) << endl; - //cout << gsmat->chat("D3472665618;") << endl; - gsmat->putLine("AT+cgmm", true); - for (i = 0; i < 4; i++) { - ciapa = gsmat->getLine(); - //cout << "PRESO: |||" << ciapa << "|||" << endl; - NOTICA("PRESO %d |||%s|||\n", GSMOPEN_P_LOG, i, ciapa.c_str()); - //gsmopen_sleep(5000); - } - - sms = SMSMessage::decode("079194710167120004038571F1390099406180904480A0D41631067296EF7390383D07CD622E58CD95CB81D6EF39BDEC66BFE7207A794E2FBB4320AFB82C07E56020A8FC7D9687DBED32285C9F83A06F769A9E5EB340D7B49C3E1FA3C3663A0B24E4CBE76516680A7FCBE920725A5E5ED341F0B21C346D4E41E1BA790E4286DDE4BC0BD42CA3E5207258EE1797E5A0BA9B5E9683C86539685997EBEF61341B249BC966"); // dataCodingScheme = 0 - NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); - sms = SMSMessage::decode("0791934329002000040C9193432766658100009001211133318004D4F29C0E"); // dataCodingScheme = 0 - NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); - sms = SMSMessage::decode("0791934329002000040C919343276665810008900121612521801600CC00E800E900F900F200E00020006300690061006F"); // dataCodingScheme = 8 - NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); - sms = SMSMessage::decode("0791934329002000040C919343276665810008900172002293404C006300690061006F0020003100320033002000620065006C00E80020043D043E0432043E044104420438002005DC05E7002005E805D005EA0020FE8EFEE0FEA0FEE4FECBFE9300204EBA5927"); // dataCodingScheme = 8 , text=ciao 123 belè новости לק ראת ﺎﻠﺠﻤﻋﺓ 人大 - NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); - sms = SMSMessage::decode("07911497941902F00414D0E474989D769F5DE4320839001040122151820000"); // dataCodingScheme = 0 - NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); - -#if 0 - size = MultiByteToWideChar(CP_OEMCP, 0, username, strlen(username)+1, UserName, 0); - UserName=(wchar_t*)GlobalAlloc(GME­ M_ZEROINIT, size); - ret = MultiByteToWideChar(CP_OEMCP, 0, username, strlen(username)+1, UserName, size); - if(ret == 0) - getError(GetLastError()); -#endif //0 - return (-1); -} - -#endif //GSMLIBGIO - - -int gsmopen_serial_read(private_t * tech_pvt) -{ - if (tech_pvt->controldevprotocol == PROTOCOL_AT) - return gsmopen_serial_read_AT(tech_pvt, 0, 100000, 0, NULL, 1); // a 10th of a second timeout -#ifdef GSMOPEN_FBUS2 - if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2) - return gsmopen_serial_read_FBUS2(tech_pvt); -#endif /* GSMOPEN_FBUS2 */ -#ifdef GSMOPEN_CVM - if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return gsmopen_serial_read_CVM_BUSMAIL(tech_pvt); -#endif /* GSMOPEN_CVM */ - return -1; -} - - -int gsmopen_serial_sync(private_t * tech_pvt) -{ - if (tech_pvt->controldevprotocol == PROTOCOL_AT) - return gsmopen_serial_sync_AT(tech_pvt); -#ifdef GSMOPEN_FBUS2 - if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2) - return gsmopen_serial_sync_FBUS2(tech_pvt); -#endif /* GSMOPEN_FBUS2 */ -#ifdef GSMOPEN_CVM - if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return gsmopen_serial_sync_CVM_BUSMAIL(tech_pvt); -#endif /* GSMOPEN_CVM */ - - return -1; -} - -int gsmopen_serial_config(private_t * tech_pvt) -{ -#ifndef NO_GSMLIB - SMSMessageRef sms; - char content2[1000]; - //sms = SMSMessage::decode("079194710167120004038571F1390099406180904480A0D41631067296EF7390383D07CD622E58CD95CB81D6EF39BDEC66BFE7207A794E2FBB4320AFB82C07E56020A8FC7D9687DBED32285C9F83A06F769A9E5EB340D7B49C3E1FA3C3663A0B24E4CBE76516680A7FCBE920725A5E5ED341F0B21C346D4E41E1BA790E4286DDE4BC0BD42CA3E5207258EE1797E5A0BA9B5E9683C86539685997EBEF61341B249BC966"); // dataCodingScheme = 0 - //sms = SMSMessage::decode("0791934329002000040C9193432766658100009001211133318004D4F29C0E"); // dataCodingScheme = 0 - //sms = SMSMessage::decode("0791934329002000040C919343276665810008900121612521801600CC00E800E900F900F200E00020006300690061006F"); // dataCodingScheme = 8 - sms = SMSMessage::decode("0791934329002000040C919343276665810008900172002293404C006300690061006F0020003100320033002000620065006C00E80020043D043E0432043E044104420438002005DC05E7002005E805D005EA0020FE8EFEE0FEA0FEE4FECBFE9300204EBA5927"); // dataCodingScheme = 8 , text=ciao 123 belè новости לק ראת ﺎﻠﺠﻤﻋﺓ 人大 - //sms = SMSMessage::decode("07911497941902F00414D0E474989D769F5DE4320839001040122151820000"); // dataCodingScheme = 0 - //NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); - - memset(content2, '\0', sizeof(content2)); - if (sms->dataCodingScheme().getAlphabet() == DCS_DEFAULT_ALPHABET) { - iso_8859_1_to_utf8(tech_pvt, (char *) sms->userData().c_str(), content2, sizeof(content2)); - } else if (sms->dataCodingScheme().getAlphabet() == DCS_SIXTEEN_BIT_ALPHABET) { - ucs2_to_utf8(tech_pvt, (char *) bufToHex((unsigned char *) sms->userData().data(), sms->userData().length()).c_str(), content2, - sizeof(content2)); - } else { - ERRORA("dataCodingScheme not supported=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); - - } - //NOTICA("dataCodingScheme=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); - //NOTICA("userData= |||%s|||\n", GSMOPEN_P_LOG, content2); -#endif// NO_GSMLIB - - if (tech_pvt->controldevprotocol == PROTOCOL_AT) - return gsmopen_serial_config_AT(tech_pvt); -#ifdef GSMOPEN_FBUS2 - if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2) - return gsmopen_serial_config_FBUS2(tech_pvt); -#endif /* GSMOPEN_FBUS2 */ -#ifdef GSMOPEN_CVM - if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return gsmopen_serial_config_CVM_BUSMAIL(tech_pvt); -#endif /* GSMOPEN_CVM */ - - return -1; -} - -int gsmopen_serial_config_AT(private_t * tech_pvt) -{ - int res; - char at_command[5]; - int i; - -/* initial_pause? */ - if (tech_pvt->at_initial_pause) { - DEBUGA_GSMOPEN("sleeping for %d usec\n", GSMOPEN_P_LOG, tech_pvt->at_initial_pause); - gsmopen_sleep(tech_pvt->at_initial_pause); - } - -/* go until first empty preinit string, or last preinit string */ - while (1) { - - if (strlen(tech_pvt->at_preinit_1)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_1, tech_pvt->at_preinit_1_expect); - if (res) { - DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_preinit_1, tech_pvt->at_preinit_1_expect); - } - } else { - break; - } - - if (strlen(tech_pvt->at_preinit_2)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_2, tech_pvt->at_preinit_2_expect); - if (res) { - DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_preinit_2, tech_pvt->at_preinit_2_expect); - } - } else { - break; - } - - if (strlen(tech_pvt->at_preinit_3)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_3, tech_pvt->at_preinit_3_expect); - if (res) { - DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_preinit_3, tech_pvt->at_preinit_3_expect); - } - } else { - break; - } - - if (strlen(tech_pvt->at_preinit_4)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_4, tech_pvt->at_preinit_4_expect); - if (res) { - DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_preinit_4, tech_pvt->at_preinit_4_expect); - } - } else { - break; - } - - if (strlen(tech_pvt->at_preinit_5)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_5, tech_pvt->at_preinit_5_expect); - if (res) { - DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_preinit_5, tech_pvt->at_preinit_5_expect); - } - } else { - break; - } - - break; - } - -/* after_preinit_pause? */ - if (tech_pvt->at_after_preinit_pause) { - DEBUGA_GSMOPEN("sleeping for %d usec\n", GSMOPEN_P_LOG, tech_pvt->at_after_preinit_pause); - gsmopen_sleep(tech_pvt->at_after_preinit_pause); - } - - /* phone, brother, art you alive? */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT"); - if (res) { - ERRORA("no response to AT\n", GSMOPEN_P_LOG); - return -1; - } - /* for motorola, bring it back to "normal" mode if it happens to be in another mode */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+mode=0"); - if (res) { - DEBUGA_GSMOPEN("AT+mode=0 does not get OK from the phone. If it is NOT Motorola," " no problem.\n", GSMOPEN_P_LOG); - } - gsmopen_sleep(50000); - /* for motorola end */ - - /* reset AT configuration to phone default */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "ATZ"); - if (res) { - DEBUGA_GSMOPEN("ATZ failed\n", GSMOPEN_P_LOG); - } - - /* disable AT command echo */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "ATE0"); - if (res) { - DEBUGA_GSMOPEN("ATE0 failed\n", GSMOPEN_P_LOG); - } - - /* disable extended error reporting */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMEE=0"); - if (res) { - DEBUGA_GSMOPEN("AT+CMEE failed\n", GSMOPEN_P_LOG); - } - - /* various phone manufacturer identifier */ - for (i = 0; i < 10; i++) { - memset(at_command, 0, sizeof(at_command)); - sprintf(at_command, "ATI%d", i); - res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); - if (res) { - DEBUGA_GSMOPEN("ATI%d command failed, continue\n", GSMOPEN_P_LOG, i); - } - } - - /* phone manufacturer */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CGMI"); - if (res) { - DEBUGA_GSMOPEN("AT+CGMI failed\n", GSMOPEN_P_LOG); - } - - /* phone model */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CGMM"); - if (res) { - DEBUGA_GSMOPEN("AT+CGMM failed\n", GSMOPEN_P_LOG); - } - - /* signal network registration with a +CREG unsolicited msg */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CREG=1"); - if (res) { - DEBUGA_GSMOPEN("AT+CREG=1 failed\n", GSMOPEN_P_LOG); - tech_pvt->network_creg_not_supported = 1; - } - if(!tech_pvt->network_creg_not_supported){ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CREG?"); - if (res) { - DEBUGA_GSMOPEN("AT+CREG? failed\n", GSMOPEN_P_LOG); - } - } - /* query signal strength */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSQ"); - if (res) { - DEBUGA_GSMOPEN("AT+CSQ failed\n", GSMOPEN_P_LOG); - } - /* IMEI */ - tech_pvt->requesting_imei = 1; - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+GSN"); - tech_pvt->requesting_imei = 0; - if (res) { - DEBUGA_GSMOPEN("AT+GSN failed\n", GSMOPEN_P_LOG); - tech_pvt->requesting_imei = 1; - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CGSN"); - tech_pvt->requesting_imei = 0; - if (res) { - DEBUGA_GSMOPEN("AT+CGSN failed\n", GSMOPEN_P_LOG); - } - } - /* IMSI */ - tech_pvt->requesting_imsi = 1; - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CIMI"); - tech_pvt->requesting_imsi = 0; - if (res) { - DEBUGA_GSMOPEN("AT+CIMI failed\n", GSMOPEN_P_LOG); - } - - /* signal incoming SMS with a +CMTI unsolicited msg */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CNMI=3,1,0,0,0"); - if (res) { - DEBUGA_GSMOPEN("AT+CNMI=3,1,0,0,0 failed, continue\n", GSMOPEN_P_LOG); - tech_pvt->sms_cnmi_not_supported = 1; - tech_pvt->gsmopen_serial_sync_period = 30; //FIXME in config - } - /* what is the Message Center address (number) to which the SMS has to be sent? */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCA?"); - if (res) { - DEBUGA_GSMOPEN("AT+CSCA? failed, continue\n", GSMOPEN_P_LOG); - } - /* what is the Message Format of SMSs? */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF?"); - if (res) { - DEBUGA_GSMOPEN("AT+CMGF? failed, continue\n", GSMOPEN_P_LOG); - } -#ifdef NO_GSMLIB - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=1"); - if (res) { - ERRORA("Error setting SMS sending mode to TEXT on the cellphone, let's hope is TEXT by default. Continuing\n", GSMOPEN_P_LOG); - } - tech_pvt->sms_pdu_not_supported = 1; -#else // NO_GSMLIB - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=0"); - if (res) { - WARNINGA("Error setting SMS sending mode to PDU on the cellphone, falling back to TEXT mode. Continuing\n", GSMOPEN_P_LOG); - tech_pvt->sms_pdu_not_supported = 1; - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=1"); - if (res) { - ERRORA("Error setting SMS sending mode to TEXT on the cellphone, let's hope is TEXT by default. Continuing\n", GSMOPEN_P_LOG); - } - } -#endif // NO_GSMLIB - /* what is the Charset of SMSs? */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS?"); - if (res) { - DEBUGA_GSMOPEN("AT+CSCS? failed, continue\n", GSMOPEN_P_LOG); - } - - tech_pvt->no_ucs2 = 0; - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"UCS2\""); - if (res) { - WARNINGA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone, let's try with 'GSM'\n", GSMOPEN_P_LOG); - tech_pvt->no_ucs2 = 1; - } - - if (tech_pvt->no_ucs2) { - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"GSM\""); - if (res) { - WARNINGA("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n", GSMOPEN_P_LOG); - } - //res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,16"); //"flash", class 0 sms 7 bit - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,0"); //normal, 7 bit message - if (res) { - WARNINGA("AT+CSMP do not got OK from the phone, continuing\n", GSMOPEN_P_LOG); - } - } else { - //res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,20"); //"flash", class 0 sms 16 bit unicode - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,8"); //unicode, 16 bit message - if (res) { - WARNINGA("AT+CSMP do not got OK from the phone, continuing\n", GSMOPEN_P_LOG); - } - } - - /* is the unsolicited reporting of mobile equipment event supported? */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMER=?"); - if (res) { - DEBUGA_GSMOPEN("AT+CMER=? failed, continue\n", GSMOPEN_P_LOG); - } - /* request unsolicited reporting of mobile equipment indicators' events, to be screened by categories reported by +CIND=? */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMER=3,0,0,1"); - if (res) { - DEBUGA_GSMOPEN("AT+CMER=? failed, continue\n", GSMOPEN_P_LOG); - } - - /* is the solicited reporting of mobile equipment indications supported? */ - - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CIND=?"); - if (res) { - DEBUGA_GSMOPEN("AT+CIND=? failed, continue\n", GSMOPEN_P_LOG); - } - - /* is the unsolicited reporting of call monitoring supported? sony-ericsson specific */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT*ECAM=?"); - if (res) { - DEBUGA_GSMOPEN("AT*ECAM=? failed, continue\n", GSMOPEN_P_LOG); - } - /* enable the unsolicited reporting of call monitoring. sony-ericsson specific */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT*ECAM=1"); - if (res) { - DEBUGA_GSMOPEN("AT*ECAM=1 failed, continue\n", GSMOPEN_P_LOG); - tech_pvt->at_has_ecam = 0; - } else { - tech_pvt->at_has_ecam = 1; - } - - /* disable unsolicited signaling of call list */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CLCC=0"); - if (res) { - DEBUGA_GSMOPEN("AT+CLCC=0 failed, continue\n", GSMOPEN_P_LOG); - tech_pvt->at_has_clcc = 0; - } else { - tech_pvt->at_has_clcc = 1; - } - - /* give unsolicited caller id when incoming call */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CLIP=1"); - if (res) { - DEBUGA_GSMOPEN("AT+CLIP failed, continue\n", GSMOPEN_P_LOG); - } - /* for motorola */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+MCST=1"); /* motorola call control codes - (to know when call is disconnected (they - don't give you "no carrier") */ - if (res) { - DEBUGA_GSMOPEN("AT+MCST=1 does not get OK from the phone. If it is NOT Motorola," " no problem.\n", GSMOPEN_P_LOG); - } - /* for motorola end */ - -/* go until first empty postinit string, or last postinit string */ - while (1) { - - if (strlen(tech_pvt->at_postinit_1)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_1, tech_pvt->at_postinit_1_expect); - if (res) { - DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_postinit_1, tech_pvt->at_postinit_1_expect); - } - } else { - break; - } - - if (strlen(tech_pvt->at_postinit_2)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_2, tech_pvt->at_postinit_2_expect); - if (res) { - DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_postinit_2, tech_pvt->at_postinit_2_expect); - } - } else { - break; - } - - if (strlen(tech_pvt->at_postinit_3)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_3, tech_pvt->at_postinit_3_expect); - if (res) { - DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_postinit_3, tech_pvt->at_postinit_3_expect); - } - } else { - break; - } - - if (strlen(tech_pvt->at_postinit_4)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_4, tech_pvt->at_postinit_4_expect); - if (res) { - DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_postinit_4, tech_pvt->at_postinit_4_expect); - } - } else { - break; - } - - if (strlen(tech_pvt->at_postinit_5)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_5, tech_pvt->at_postinit_5_expect); - if (res) { - DEBUGA_GSMOPEN("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_postinit_5, tech_pvt->at_postinit_5_expect); - } - } else { - break; - } - - break; - } - - return 0; -} - - -int gsmopen_serial_sync_AT(private_t * tech_pvt) -{ - gsmopen_sleep(10000); /* 10msec */ - time(&tech_pvt->gsmopen_serial_synced_timestamp); - return 0; -} -int gsmopen_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_usec, int timeout_sec, const char *expected_string, int expect_crlf) -{ - int select_err = 1; - int res; - fd_set read_fds; - struct timeval timeout; - char tmp_answer[AT_BUFSIZ]; - char tmp_answer2[AT_BUFSIZ]; - char *tmp_answer_ptr; - char *last_line_ptr; - int i = 0; - int read_count = 0; - int la_counter = 0; - int at_ack = -1; - int la_read = 0; - - if(!running || !tech_pvt->running){ - return -1; - } - - FD_ZERO(&read_fds); - FD_SET(tech_pvt->controldevfd, &read_fds); - - //NOTICA (" INSIDE this gsmopen_serial_device %s \n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tmp_answer_ptr = tmp_answer; - memset(tmp_answer, 0, sizeof(char) * AT_BUFSIZ); - - timeout.tv_sec = timeout_sec; - timeout.tv_usec = timeout_usec; - PUSHA_UNLOCKA(tech_pvt->controldev_lock); - LOKKA(tech_pvt->controldev_lock); - - while ((!tech_pvt->controldev_dead) && ((select_err = select(tech_pvt->controldevfd + 1, &read_fds, NULL, NULL, &timeout)) > 0)) { - char *token_ptr; - timeout.tv_sec = timeout_sec; //reset the timeout, linux modify it - timeout.tv_usec = timeout_usec; //reset the timeout, linux modify it - read_count = read(tech_pvt->controldevfd, tmp_answer_ptr, AT_BUFSIZ - (tmp_answer_ptr - tmp_answer)); - - if (read_count == 0) { - ERRORA - ("read 0 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n", - GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->controldev_dead = 1; - close(tech_pvt->controldevfd); - ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->running=0; - alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); - tech_pvt->active=0; - tech_pvt->name[0]='\0'; - - UNLOCKA(tech_pvt->controldev_lock); - if (tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - switch_sleep(1000000); - return -1; - } - - if (option_debug > 90) { - //DEBUGA_GSMOPEN("1 read %d bytes, --|%s|--\n", GSMOPEN_P_LOG, read_count, tmp_answer_ptr); - //DEBUGA_GSMOPEN("2 read %d bytes, --|%s|--\n", GSMOPEN_P_LOG, read_count, tmp_answer); - } - tmp_answer_ptr = tmp_answer_ptr + read_count; - - - la_counter = 0; - memset(tmp_answer2, 0, sizeof(char) * AT_BUFSIZ); - strcpy(tmp_answer2, tmp_answer); - if ((token_ptr = strtok(tmp_answer2, "\n\r"))) { - last_line_ptr = token_ptr; - strncpy(tech_pvt->line_array.result[la_counter], token_ptr, AT_MESG_MAX_LENGTH); - if (strlen(token_ptr) > AT_MESG_MAX_LENGTH) { - WARNINGA - ("AT mesg longer than buffer, original message was: |%s|, in buffer only: |%s|\n", - GSMOPEN_P_LOG, token_ptr, tech_pvt->line_array.result[la_counter]); - } - la_counter++; - while ((token_ptr = strtok(NULL, "\n\r"))) { - last_line_ptr = token_ptr; - strncpy(tech_pvt->line_array.result[la_counter], token_ptr, AT_MESG_MAX_LENGTH); - if (strlen(token_ptr) > AT_MESG_MAX_LENGTH) { - WARNINGA - ("AT mesg longer than buffer, original message was: |%s|, in buffer only: |%s|\n", - GSMOPEN_P_LOG, token_ptr, tech_pvt->line_array.result[la_counter]); - } - la_counter++; - } - } else { - last_line_ptr = tmp_answer; - } - - if (expected_string && !expect_crlf) { - DEBUGA_GSMOPEN - ("last_line_ptr=|%s|, expected_string=|%s|, expect_crlf=%d, memcmp(last_line_ptr, expected_string, strlen(expected_string)) = %d\n", - GSMOPEN_P_LOG, last_line_ptr, expected_string, expect_crlf, memcmp(last_line_ptr, expected_string, strlen(expected_string))); - } - - if (expected_string && !expect_crlf && !memcmp(last_line_ptr, expected_string, strlen(expected_string)) - ) { - strncpy(tech_pvt->line_array.result[la_counter], last_line_ptr, AT_MESG_MAX_LENGTH); - // match expected string -> accept it withtout CRLF - la_counter++; - - } - /* if the last line read was not a complete line, we'll read the rest in the future */ - else if (tmp_answer[strlen(tmp_answer) - 1] != '\r' && tmp_answer[strlen(tmp_answer) - 1] != '\n') - la_counter--; - - /* let's list the complete lines read so far, without re-listing the lines that has yet been listed */ - if (option_debug > 1) { - for (i = la_read; i < la_counter; i++) - DEBUGA_GSMOPEN("Read line %d: |%s|\n", GSMOPEN_P_LOG, i, tech_pvt->line_array.result[i]); - } - - /* let's interpret the complete lines read so far (WITHOUT looking for OK, ERROR, and EXPECTED_STRING), without re-interpreting the lines that has been yet interpreted, so we're sure we don't miss anything */ - for (i = la_read; i < la_counter; i++) { - - if ((strcmp(tech_pvt->line_array.result[i], "RING") == 0)) { - /* with first RING we wait for callid */ - gettimeofday(&(tech_pvt->ringtime), NULL); - /* give CALLID (+CLIP) a chance, wait for the next RING before answering */ - if (tech_pvt->phone_callflow == CALLFLOW_INCOMING_RING) { - /* we're at the second ring, set the interface state, will be answered by gsmopen_do_monitor */ - DEBUGA_GSMOPEN("|%s| got second RING\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - tech_pvt->interface_state = GSMOPEN_STATE_RING; - } else { - /* we're at the first ring, so there is no CALLID yet thus clean the previous one - just in case we don't receive the caller identification in this new call */ - memset(tech_pvt->callid_name, 0, sizeof(tech_pvt->callid_name)); - memset(tech_pvt->callid_number, 0, sizeof(tech_pvt->callid_number)); - /* only send AT+CLCC? if the device previously reported its support */ - if (tech_pvt->at_has_clcc != 0) { - /* we're at the first ring, try to get CALLID (with +CLCC) */ - DEBUGA_GSMOPEN("|%s| got first RING, sending AT+CLCC?\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - res = gsmopen_serial_write_AT_noack(tech_pvt, "AT+CLCC?"); - if (res) { - ERRORA("AT+CLCC? (call list) was not correctly sent to the phone\n", GSMOPEN_P_LOG); - } - } else { - DEBUGA_GSMOPEN("|%s| got first RING, but not sending AT+CLCC? as this device " - "seems not to support\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - } - tech_pvt->phone_callflow = CALLFLOW_INCOMING_RING; - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CLCC", 5) == 0)) { - int commacount = 0; - int a = 0; - int b = 0; - int c = 0; - /* with clcc we wait for clip */ - memset(tech_pvt->callid_name, 0, sizeof(tech_pvt->callid_name)); - memset(tech_pvt->callid_number, 0, sizeof(tech_pvt->callid_number)); - - for (a = 0; a < strlen(tech_pvt->line_array.result[i]); a++) { - - if (tech_pvt->line_array.result[i][a] == ',') { - commacount++; - } - if (commacount == 5) { - if (tech_pvt->line_array.result[i][a] != ',' && tech_pvt->line_array.result[i][a] != '"') { - tech_pvt->callid_number[b] = tech_pvt->line_array.result[i][a]; - b++; - } - } - if (commacount == 7) { - if (tech_pvt->line_array.result[i][a] != ',' && tech_pvt->line_array.result[i][a] != '"') { - tech_pvt->callid_name[c] = tech_pvt->line_array.result[i][a]; - c++; - } - } - } - - tech_pvt->phone_callflow = CALLFLOW_INCOMING_RING; - DEBUGA_GSMOPEN("|%s| CLCC CALLID: name is %s, number is %s\n", GSMOPEN_P_LOG, - tech_pvt->line_array.result[i], - tech_pvt->callid_name[0] ? tech_pvt->callid_name : "not available", - tech_pvt->callid_number[0] ? tech_pvt->callid_number : "not available"); - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CLIP", 5) == 0)) { - int commacount = 0; - int a = 0; - int b = 0; - int c = 0; - /* with CLIP, we want to answer right away */ - memset(tech_pvt->callid_name, 0, sizeof(tech_pvt->callid_name)); - memset(tech_pvt->callid_number, 0, sizeof(tech_pvt->callid_number)); - - - for (a = 7; a < strlen(tech_pvt->line_array.result[i]); a++) { - if (tech_pvt->line_array.result[i][a] == ',') { - commacount++; - } - if (commacount == 0) { - if (tech_pvt->line_array.result[i][a] != ',' && tech_pvt->line_array.result[i][a] != '"') { - tech_pvt->callid_number[b] = tech_pvt->line_array.result[i][a]; - b++; - } - } - if (commacount == 4) { - if (tech_pvt->line_array.result[i][a] != ',' && tech_pvt->line_array.result[i][a] != '"') { - tech_pvt->callid_name[c] = tech_pvt->line_array.result[i][a]; - c++; - } - } - } - - if (tech_pvt->interface_state != GSMOPEN_STATE_RING) { - gettimeofday(&(tech_pvt->call_incoming_time), NULL); - DEBUGA_GSMOPEN("GSMOPEN_STATE_RING call_incoming_time.tv_sec=%ld\n", GSMOPEN_P_LOG, tech_pvt->call_incoming_time.tv_sec); - - } - - tech_pvt->interface_state = GSMOPEN_STATE_RING; - tech_pvt->phone_callflow = CALLFLOW_INCOMING_RING; - DEBUGA_GSMOPEN("|%s| CLIP INCOMING CALLID: name is %s, number is %s\n", GSMOPEN_P_LOG, - tech_pvt->line_array.result[i], - (strlen(tech_pvt->callid_name) && tech_pvt->callid_name[0] != 1) ? tech_pvt->callid_name : "not available", - strlen(tech_pvt->callid_number) ? tech_pvt->callid_number : "not available"); - - if (!strlen(tech_pvt->callid_number)) { - strcpy(tech_pvt->callid_number, "not available"); - } - - if (!strlen(tech_pvt->callid_name) && tech_pvt->callid_name[0] != 1) { - strncpy(tech_pvt->callid_name, tech_pvt->callid_number, sizeof(tech_pvt->callid_name)); - //strncpy(tech_pvt->callid_name, tech_pvt->callid_number, sizeof(tech_pvt->callid_name)) ; - snprintf(tech_pvt->callid_name, sizeof(tech_pvt->callid_name), "GSMopen: %s", tech_pvt->callid_number); - } - - DEBUGA_GSMOPEN("|%s| CLIP INCOMING CALLID: NOW name is %s, number is %s\n", GSMOPEN_P_LOG, - tech_pvt->line_array.result[i], tech_pvt->callid_name, tech_pvt->callid_number); - } - - if ((strcmp(tech_pvt->line_array.result[i], "BUSY") == 0)) { - tech_pvt->phone_callflow = CALLFLOW_CALL_LINEBUSY; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_LINEBUSY\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - //if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner && tech_pvt->phone_callflow != CALLFLOW_CALL_DOWN) { - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->phone_callflow != CALLFLOW_CALL_DOWN) { - //ast_setstate(tech_pvt->owner, GSMOPEN_STATE_BUSY); - //gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_BUSY); - //cicopet - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - tech_pvt->interface_state = GSMOPEN_STATE_DOWN; - - session = switch_core_session_locate(tech_pvt->session_uuid_str); - if (session) { - channel = switch_core_session_get_channel(session); - //gsmopen_hangup(tech_pvt); - switch_core_session_rwunlock(session); - switch_channel_hangup(channel, SWITCH_CAUSE_NONE); - } - // - //tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - //gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - - } else { - ERRORA("Why BUSY now?\n", GSMOPEN_P_LOG); - } - } - if ((strcmp(tech_pvt->line_array.result[i], "NO ANSWER") == 0)) { - tech_pvt->phone_callflow = CALLFLOW_CALL_NOANSWER; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_NOANSWER\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_NO_ANSWER; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } else { - ERRORA("Why NO ANSWER now?\n", GSMOPEN_P_LOG); - } - } - if ((strcmp(tech_pvt->line_array.result[i], "NO CARRIER") == 0)) { - tech_pvt->phone_callflow = CALLFLOW_CALL_NOCARRIER; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_NOCARRIER\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { - //cicopet - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - tech_pvt->interface_state = GSMOPEN_STATE_DOWN; - - session = switch_core_session_locate(tech_pvt->session_uuid_str); - if (session) { - channel = switch_core_session_get_channel(session); - //gsmopen_hangup(tech_pvt); - switch_core_session_rwunlock(session); - switch_channel_hangup(channel, SWITCH_CAUSE_NONE); - } - // - //tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - //gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } else { - ERRORA("Why NO CARRIER now?\n", GSMOPEN_P_LOG); - } - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CBC:", 5) == 0)) { - int power_supply, battery_strenght, err; - - power_supply = battery_strenght = 0; - - err = sscanf(&tech_pvt->line_array.result[i][6], "%d,%d", &power_supply, &battery_strenght); - if (err < 2) { - DEBUGA_GSMOPEN("|%s| is not formatted as: |+CBC: xx,yy| now trying |+CBC:xx,yy|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - err = sscanf(&tech_pvt->line_array.result[i][5], "%d,%d", &power_supply, &battery_strenght); - DEBUGA_GSMOPEN("|%s| +CBC: Powered by %s, battery strenght=%d\n", GSMOPEN_P_LOG, - tech_pvt->line_array.result[i], power_supply ? "power supply" : "battery", battery_strenght); - - } - - if (err < 2) { - DEBUGA_GSMOPEN("|%s| is not formatted as: |+CBC:xx,yy| giving up\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - else { - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| +CBC: Powered by %s, battery strenght=%d\n", GSMOPEN_P_LOG, - tech_pvt->line_array.result[i], power_supply ? "power supply" : "battery", battery_strenght); - if (!power_supply) { - if (battery_strenght < 10) { - ERRORA("|%s| BATTERY ALMOST EXHAUSTED\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } else if (battery_strenght < 20) { - WARNINGA("|%s| BATTERY LOW\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - } - - } - } - - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CSQ:", 5) == 0)) { - int signal_quality, ber, err; - - signal_quality = ber = 0; - - err = sscanf(&tech_pvt->line_array.result[i][6], "%d,%d", &signal_quality, &ber); - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| +CSQ: Signal Quality: %d, Error Rate=%d\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i], signal_quality, ber); - if (err < 2) { - ERRORA("|%s| is not formatted as: |+CSQ: xx,yy|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } else { - if (signal_quality < 11 || signal_quality == 99) { - ERRORA - ("|%s| CELLPHONE GETS ALMOST NO SIGNAL, consider to move it or additional antenna\n", - GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - tech_pvt->got_signal=0; - alarm_event(tech_pvt, ALARM_NETWORK_NO_SIGNAL, "CELLPHONE GETS ALMOST NO SIGNAL, consider to move it or additional antenna"); - } else if (signal_quality < 15) { - WARNINGA("|%s| CELLPHONE GETS SIGNAL LOW\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - tech_pvt->got_signal=1; - alarm_event(tech_pvt, ALARM_NETWORK_LOW_SIGNAL, "CELLPHONE GETS SIGNAL LOW"); - } else { - tech_pvt->got_signal=2; - } - - } - - } - if ((strncmp(tech_pvt->line_array.result[i], "+CREG:", 6) == 0)) { - int n, stat, err; - - n = stat = 0; - - err = sscanf(&tech_pvt->line_array.result[i][6], "%d,%d", &n, &stat); - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| +CREG: Display: %d, Registration=%d\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i], n, stat); - if (err < 2) { - WARNINGA("|%s| is not formatted as: |+CREG: xx,yy|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - if (stat==0) { - ERRORA - ("|%s| CELLPHONE is not registered to network, consider to move it or additional antenna\n", - GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - tech_pvt->not_registered=1; - tech_pvt->home_network_registered=0; - tech_pvt->roaming_registered=0; - alarm_event(tech_pvt, ALARM_NO_NETWORK_REGISTRATION, "CELLPHONE is not registered to network, consider to move it or additional antenna"); - } else if (stat==1) { - DEBUGA_GSMOPEN("|%s| CELLPHONE is registered to the HOME network\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - tech_pvt->not_registered=0; - tech_pvt->home_network_registered=1; - tech_pvt->roaming_registered=0; - }else { - ERRORA("|%s| CELLPHONE is registered to a ROAMING network\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - tech_pvt->not_registered=0; - tech_pvt->home_network_registered=0; - tech_pvt->roaming_registered=1; - alarm_event(tech_pvt, ALARM_ROAMING_NETWORK_REGISTRATION, "CELLPHONE is registered to a ROAMING network"); - } - - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CMGW:", 6) == 0)) { - int err; - - err = sscanf(&tech_pvt->line_array.result[i][7], "%s", tech_pvt->at_cmgw); - DEBUGA_GSMOPEN("|%s| +CMGW: %s\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i], tech_pvt->at_cmgw); - if (err < 1) { - ERRORA("|%s| is not formatted as: |+CMGW: xxxx|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - } - - /* at_call_* are unsolicited messages sent by the modem to signal us about call processing activity and events */ - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_idle) == 0)) { - tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_IDLE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { - DEBUGA_GSMOPEN("just received a remote HANGUP\n", GSMOPEN_P_LOG); - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_NORMAL; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - DEBUGA_GSMOPEN("just sent GSMOPEN_CONTROL_HANGUP\n", GSMOPEN_P_LOG); - } - - tech_pvt->phone_callflow = CALLFLOW_CALL_NOCARRIER; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_NOCARRIER\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { - //cicopet - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - tech_pvt->interface_state = GSMOPEN_STATE_DOWN; - - session = switch_core_session_locate(tech_pvt->session_uuid_str); - if (session) { - channel = switch_core_session_get_channel(session); - //gsmopen_hangup(tech_pvt); - switch_core_session_rwunlock(session); - switch_channel_hangup(channel, SWITCH_CAUSE_NONE); - } - // - //tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - //gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } else { - ERRORA("Why NO CARRIER now?\n", GSMOPEN_P_LOG); - } - - - - - - - - - - - - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_incoming) == 0)) { - - //char list_command[64]; - - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_INCOMING\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - if (tech_pvt->phone_callflow != CALLFLOW_CALL_INCOMING && tech_pvt->phone_callflow != CALLFLOW_INCOMING_RING) { - //mark the time of CALLFLOW_CALL_INCOMING - gettimeofday(&(tech_pvt->call_incoming_time), NULL); - tech_pvt->phone_callflow = CALLFLOW_CALL_INCOMING; - DEBUGA_GSMOPEN("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld\n", GSMOPEN_P_LOG, tech_pvt->call_incoming_time.tv_sec); - - } - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_active) == 0)) { - tech_pvt->phone_callflow = CALLFLOW_CALL_ACTIVE; - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_ACTIVE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - if (tech_pvt->interface_state == CALLFLOW_CALL_DIALING || tech_pvt->interface_state == CALLFLOW_STATUS_EARLYMEDIA) { - DEBUGA_PBX("just received a remote ANSWER\n", GSMOPEN_P_LOG); - if (tech_pvt->phone_callflow == GSMOPEN_STATE_UP) { - //gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_RINGING); - DEBUGA_PBX("just sent GSMOPEN_CONTROL_RINGING\n", GSMOPEN_P_LOG); - DEBUGA_PBX("going to send GSMOPEN_CONTROL_ANSWER\n", GSMOPEN_P_LOG); - //gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_ANSWER); - tech_pvt->interface_state = CALLFLOW_CALL_REMOTEANSWER; - DEBUGA_PBX("just sent GSMOPEN_CONTROL_ANSWER\n", GSMOPEN_P_LOG); - } - } else { - } - //tech_pvt->interface_state = GSMOPEN_STATE_UP; - //DEBUGA_PBX("just interface_state UP\n", GSMOPEN_P_LOG); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_calling) == 0)) { - tech_pvt->phone_callflow = CALLFLOW_CALL_DIALING; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_DIALING\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_failed) == 0)) { - tech_pvt->phone_callflow = CALLFLOW_CALL_FAILED; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_FAILED\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CSCA:", 6) == 0)) { //TODO SMS FIXME in config! - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| +CSCA: Message Center Address!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CMGF:", 6) == 0)) { //TODO SMS FIXME in config! - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| +CMGF: Message Format!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CMTI:", 6) == 0)) { //TODO SMS FIXME in config! - int err; - int pos; - - //FIXME all the following commands in config! - if (option_debug) - DEBUGA_GSMOPEN("|%s| +CMTI: Incoming SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - err = sscanf(&tech_pvt->line_array.result[i][12], "%d", &pos); - if (err < 1) { - ERRORA("|%s| is not formatted as: |+CMTI: \"MT\",xx|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } else { - DEBUGA_GSMOPEN("|%s| +CMTI: Incoming SMS in position: %d!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i], pos); - tech_pvt->unread_sms_msg_id = pos; - gsmopen_sleep(1000); - - if (tech_pvt->unread_sms_msg_id) { - char at_command[256]; - - if (tech_pvt->no_ucs2 == 0) { - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"UCS2\""); - if (res) { - ERRORA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone, continuing\n", GSMOPEN_P_LOG); - //memset(tech_pvt->sms_message, 0, sizeof(tech_pvt->sms_message)); - } - } - - memset(at_command, 0, sizeof(at_command)); - sprintf(at_command, "AT+CMGR=%d", tech_pvt->unread_sms_msg_id); - //memset(tech_pvt->sms_message, 0, sizeof(tech_pvt->sms_message)); - - tech_pvt->reading_sms_msg = 1; - res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); - tech_pvt->reading_sms_msg = 0; - if (res) { - ERRORA("AT+CMGR (read SMS) do not got OK from the phone, message sent was:|||%s|||\n", GSMOPEN_P_LOG, at_command); - } - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"GSM\""); - if (res) { - ERRORA("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n", GSMOPEN_P_LOG); - } - memset(at_command, 0, sizeof(at_command)); - sprintf(at_command, "AT+CMGD=%d", tech_pvt->unread_sms_msg_id); /* delete the message */ - tech_pvt->unread_sms_msg_id = 0; - res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); - if (res) { - ERRORA("AT+CMGD (Delete SMS) do not got OK from the phone, message sent was:|||%s|||\n", GSMOPEN_P_LOG, at_command); - } - - res = sms_incoming(tech_pvt); - -#if 0 - if (strlen(tech_pvt->sms_message)) { - //FIXME manager_event(EVENT_FLAG_SYSTEM, "GSMOPENincomingsms", - //FIXME "Interface: %s\r\nSMS_Message: %s\r\n", tech_pvt->name, - //FIXME tech_pvt->sms_message); - - res = sms_incoming(tech_pvt, tech_pvt->sms_message); - - if (strlen(tech_pvt->sms_receiving_program)) { - int fd1[2]; - pid_t pid1; - char *arg1[] = { tech_pvt->sms_receiving_program, (char *) NULL }; - int i; - - DEBUGA_GSMOPEN("incoming SMS message:>>>%s<<<\n", GSMOPEN_P_LOG, tech_pvt->sms_message); - res = pipe(fd1); - pid1 = fork(); - - if (pid1 == 0) { //child - int err; - - dup2(fd1[0], 0); // Connect stdin to pipe output - close(fd1[1]); // close input pipe side - close(tech_pvt->controldevfd); - setsid(); //session id - err = execvp(arg1[0], arg1); //exec our program, with stdin connected to pipe output - if (err) { - ERRORA - ("'sms_receiving_program' is set in config file to '%s', and it gave us back this error: %d, (%s). SMS received was:---%s---\n", - GSMOPEN_P_LOG, tech_pvt->sms_receiving_program, err, strerror(errno), tech_pvt->sms_message); - } - close(fd1[0]); // close output pipe side - } -//starting here continue the parent - close(fd1[0]); // close output pipe side - // write the msg on the pipe input - for (i = 0; i < strlen(tech_pvt->sms_message); i++) { - res = write(fd1[1], &tech_pvt->sms_message[i], 1); - } - close(fd1[1]); // close pipe input, let our program know we've finished - } else { - ERRORA - ("got SMS incoming message, but 'sms_receiving_program' is not set in config file. SMS received was:---%s---\n", - GSMOPEN_P_LOG, tech_pvt->sms_message); - } - } -#endif //0 -#if 1 //is this one needed? maybe it can interrupt an incoming call that is just to announce itself - if (tech_pvt->phone_callflow == CALLFLOW_CALL_IDLE && tech_pvt->interface_state == GSMOPEN_STATE_DOWN && tech_pvt->owner == NULL) { - /* we're not in a call, neither calling */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CKPD=\"EEE\""); - if (res) { - ERRORA("AT+CKPD=\"EEE\" (cellphone screen back to user) do not got OK from the phone\n", GSMOPEN_P_LOG); - } - } -#endif - } //unread_msg_id - - } //CMTI well formatted - - } //CMTI - - if ((strncmp(tech_pvt->line_array.result[i], "+MMGL:", 6) == 0)) { //TODO MOTOROLA SMS FIXME in config! - int err = 0; - //int unread_msg_id=0; - - if (option_debug) - DEBUGA_GSMOPEN("|%s| +MMGL: Listing Motorola SMSs!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - err = sscanf(&tech_pvt->line_array.result[i][7], "%d", &tech_pvt->unread_sms_msg_id); - if (err < 1) { - ERRORA("|%s| is not formatted as: |+MMGL: xx|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - } - if ((strncmp(tech_pvt->line_array.result[i], "+CMGL:", 6) == 0)) { //TODO SMS FIXME in config! - if (option_debug) - DEBUGA_GSMOPEN("|%s| +CMGL: Listing SMSs!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - if ((strncmp(tech_pvt->line_array.result[i], "+MMGR:", 6) == 0)) { //TODO MOTOROLA SMS FIXME in config! - if (option_debug) - DEBUGA_GSMOPEN("|%s| +MMGR: Reading Motorola SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->reading_sms_msg) - tech_pvt->reading_sms_msg++; - } - if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: \"STO U", 13) == 0)) { //TODO SMS FIXME in config! - if (option_debug) - DEBUGA_GSMOPEN("|%s| +CMGR: Reading stored UNSENT SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } else if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: \"STO S", 13) == 0)) { //TODO SMS FIXME in config! - if (option_debug) - DEBUGA_GSMOPEN("|%s| +CMGR: Reading stored SENT SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } else if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: \"REC R", 13) == 0)) { //TODO SMS FIXME in config! - if (option_debug) - DEBUGA_GSMOPEN("|%s| +CMGR: Reading received READ SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } else if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: \"REC U", 13) == 0)) { //TODO SMS FIXME in config! - if (option_debug) - DEBUGA_GSMOPEN("|%s| +CMGR: Reading received UNREAD SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->reading_sms_msg) - tech_pvt->reading_sms_msg++; - } else if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: ", 6) == 0)) { //TODO SMS FIXME in config! - if (option_debug) - DEBUGA_GSMOPEN("|%s| +CMGR: Reading SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->reading_sms_msg) - tech_pvt->reading_sms_msg++; - } - - - if ((strcmp(tech_pvt->line_array.result[i], "+MCST: 17") == 0)) { /* motorola call processing unsolicited messages */ - tech_pvt->phone_callflow = CALLFLOW_CALL_INFLUX; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_INFLUX\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strcmp(tech_pvt->line_array.result[i], "+MCST: 68") == 0)) { /* motorola call processing unsolicited messages */ - tech_pvt->phone_callflow = CALLFLOW_CALL_NOSERVICE; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_NOSERVICE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - } - if ((strcmp(tech_pvt->line_array.result[i], "+MCST: 70") == 0)) { /* motorola call processing unsolicited messages */ - tech_pvt->phone_callflow = CALLFLOW_CALL_OUTGOINGRESTRICTED; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_OUTGOINGRESTRICTED\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - } - if ((strcmp(tech_pvt->line_array.result[i], "+MCST: 72") == 0)) { /* motorola call processing unsolicited messages */ - tech_pvt->phone_callflow = CALLFLOW_CALL_SECURITYFAIL; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_SECURITYFAIL\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CPBR", 5) == 0)) { /* phonebook stuff begins */ - - if (tech_pvt->phonebook_querying) { /* probably phonebook struct begins */ - int err, first_entry, last_entry, number_lenght, text_lenght; - - if (option_debug) - DEBUGA_GSMOPEN("phonebook struct: |%s|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - err = sscanf(&tech_pvt->line_array.result[i][8], "%d-%d),%d,%d", &first_entry, &last_entry, &number_lenght, &text_lenght); - if (err < 4) { - - err = sscanf(&tech_pvt->line_array.result[i][7], "%d-%d,%d,%d", &first_entry, &last_entry, &number_lenght, &text_lenght); - } - - if (err < 4) { - ERRORA - ("phonebook struct: |%s| is nor formatted as: |+CPBR: (1-750),40,14| neither as: |+CPBR: 1-750,40,14|\n", - GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } else { - - if (option_debug) - DEBUGA_GSMOPEN - ("First entry: %d, last entry: %d, phone number max lenght: %d, text max lenght: %d\n", - GSMOPEN_P_LOG, first_entry, last_entry, number_lenght, text_lenght); - tech_pvt->phonebook_first_entry = first_entry; - tech_pvt->phonebook_last_entry = last_entry; - tech_pvt->phonebook_number_lenght = number_lenght; - tech_pvt->phonebook_text_lenght = text_lenght; - } - - } else { /* probably phonebook entry begins */ - - if (tech_pvt->phonebook_listing) { - int err, entry_id, entry_type; - - char entry_number[256]; - char entry_text[256]; - - if (option_debug) - DEBUGA_GSMOPEN("phonebook entry: |%s|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - err = - sscanf(&tech_pvt->line_array.result[i][7], "%d,\"%255[0-9+]\",%d,\"%255[^\"]\"", &entry_id, entry_number, &entry_type, - entry_text); - if (err < 4) { - ERRORA - ("err=%d, phonebook entry: |%s| is not formatted as: |+CPBR: 504,\"+39025458068\",145,\"ciao a tutti\"|\n", - GSMOPEN_P_LOG, err, tech_pvt->line_array.result[i]); - } else { - //TODO: sanitize entry_text - if (option_debug) - DEBUGA_GSMOPEN("Number: %s, Text: %s, Type: %d\n", GSMOPEN_P_LOG, entry_number, entry_text, entry_type); - /* write entry in phonebook file */ - if (tech_pvt->phonebook_writing_fp) { - gsmopen_dir_entry_extension++; - - fprintf(tech_pvt->phonebook_writing_fp, - "%s => ,%sSKO,,,hidefromdir=%s|phonebook_direct_calling_ext=%d%s%.4d|phonebook_entry_fromcell=%s|phonebook_entry_owner=%s\n", - entry_number, entry_text, "no", - tech_pvt->gsmopen_dir_entry_extension_prefix, "2", gsmopen_dir_entry_extension, "yes", "not_specified"); - fprintf(tech_pvt->phonebook_writing_fp, - "%s => ,%sDO,,,hidefromdir=%s|phonebook_direct_calling_ext=%d%s%.4d|phonebook_entry_fromcell=%s|phonebook_entry_owner=%s\n", - entry_number, entry_text, "no", - tech_pvt->gsmopen_dir_entry_extension_prefix, "3", gsmopen_dir_entry_extension, "yes", "not_specified"); - } - } - - } - - if (tech_pvt->phonebook_listing_received_calls) { - int err, entry_id, entry_type; - - char entry_number[256] = ""; - char entry_text[256] = ""; - - if (option_debug) - DEBUGA_GSMOPEN("phonebook entry: |%s|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - err = - sscanf(&tech_pvt->line_array.result[i][7], "%d,\"%255[0-9+]\",%d,\"%255[^\"]\"", &entry_id, entry_number, &entry_type, - entry_text); - if (err < 1) { //we match only on the progressive id, maybe the remote party has not sent its number, and/or there is no corresponding text entry in the phone directory - ERRORA - ("err=%d, phonebook entry: |%s| is not formatted as: |+CPBR: 504,\"+39025458068\",145,\"ciao a tutti\"|\n", - GSMOPEN_P_LOG, err, tech_pvt->line_array.result[i]); - } else { - //TODO: sanitize entry_text - - if (option_debug) - DEBUGA_GSMOPEN("Number: %s, Text: %s, Type: %d\n", GSMOPEN_P_LOG, entry_number, entry_text, entry_type); - memset(tech_pvt->callid_name, 0, sizeof(tech_pvt->callid_name)); - memset(tech_pvt->callid_number, 0, sizeof(tech_pvt->callid_number)); - strncpy(tech_pvt->callid_name, entry_text, sizeof(tech_pvt->callid_name)); - strncpy(tech_pvt->callid_number, entry_number, sizeof(tech_pvt->callid_number)); - if (option_debug) - DEBUGA_GSMOPEN("incoming callid: Text: %s, Number: %s\n", GSMOPEN_P_LOG, tech_pvt->callid_name, tech_pvt->callid_number); - - DEBUGA_GSMOPEN("|%s| CPBR INCOMING CALLID: name is %s, number is %s\n", - GSMOPEN_P_LOG, tech_pvt->line_array.result[i], - tech_pvt->callid_name[0] != 1 ? tech_pvt->callid_name : "not available", - tech_pvt->callid_number[0] ? tech_pvt->callid_number : "not available"); - - /* mark the time of RING */ - gettimeofday(&(tech_pvt->ringtime), NULL); - tech_pvt->interface_state = GSMOPEN_STATE_RING; - tech_pvt->phone_callflow = CALLFLOW_INCOMING_RING; - - } - - } - - else { - DEBUGA_GSMOPEN("phonebook entry: |%s|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - } - } - - } - - if ((strncmp(tech_pvt->line_array.result[i], "*ECAV", 5) == 0) || (strncmp(tech_pvt->line_array.result[i], "*ECAM", 5) == 0)) { /* sony-ericsson call processing unsolicited messages */ - int res, ccid, ccstatus, calltype, processid, exitcause, number, type; - res = ccid = ccstatus = calltype = processid = exitcause = number = type = 0; - res = - sscanf(&tech_pvt->line_array.result[i][6], "%d,%d,%d,%d,%d,%d,%d", &ccid, &ccstatus, &calltype, &processid, &exitcause, &number, - &type); - /* only changes the phone_callflow if enought parameters were parsed */ - if (res >= 3) { - switch (ccstatus) { - case 0: - if (tech_pvt->owner) { - ast_setstate(tech_pvt->owner, GSMOPEN_STATE_DOWN); - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_NORMAL; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; - tech_pvt->interface_state = GSMOPEN_STATE_DOWN; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| Sony-Ericsson *ECAM/*ECAV: IDLE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - break; - case 1: - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| Sony-Ericsson *ECAM/*ECAV: CALLING\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - break; - case 2: - if (tech_pvt->owner) { - ast_setstate(tech_pvt->owner, GSMOPEN_STATE_DIALING); - } - tech_pvt->interface_state = CALLFLOW_CALL_DIALING; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| Sony-Ericsson *ECAM/*ECAV: CONNECTING\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - break; - case 3: - if (tech_pvt->owner) { - ast_setstate(tech_pvt->owner, GSMOPEN_STATE_UP); - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_ANSWER); - } - tech_pvt->phone_callflow = CALLFLOW_CALL_ACTIVE; - tech_pvt->interface_state = GSMOPEN_STATE_UP; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| Sony-Ericsson *ECAM/*ECAV: ACTIVE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - break; - case 4: - if (option_debug > 1) - DEBUGA_GSMOPEN - ("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle HOLD event\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - break; - case 5: - if (option_debug > 1) - DEBUGA_GSMOPEN - ("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle WAITING event\n", GSMOPEN_P_LOG, - tech_pvt->line_array.result[i]); - break; - case 6: - if (option_debug > 1) - DEBUGA_GSMOPEN - ("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle ALERTING event\n", GSMOPEN_P_LOG, - tech_pvt->line_array.result[i]); - break; - case 7: - if (tech_pvt->owner) { - ast_setstate(tech_pvt->owner, GSMOPEN_STATE_BUSY); - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_BUSY); - } - tech_pvt->phone_callflow = CALLFLOW_CALL_LINEBUSY; - tech_pvt->interface_state = GSMOPEN_STATE_BUSY; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| Sony-Ericsson *ECAM/*ECAV: BUSY\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - break; - } - } else { - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| Sony-Ericsson *ECAM/*ECAV: could not parse parameters\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - } - - /* at_indicator_* are unsolicited messages sent by the phone to signal us that some of its visual indicators on its screen has changed, based on CIND CMER ETSI docs */ - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_noservice_string) == 0)) { - ERRORA("|%s| at_indicator_noservice_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - alarm_event(tech_pvt, ALARM_NETWORK_NO_SERVICE, "at_indicator_noservice_string"); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nosignal_string) == 0)) { - ERRORA("|%s| at_indicator_nosignal_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - alarm_event(tech_pvt, ALARM_NETWORK_NO_SIGNAL, "at_indicator_nosignal_string"); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_lowsignal_string) == 0)) { - WARNINGA("|%s| at_indicator_lowsignal_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - alarm_event(tech_pvt, ALARM_NETWORK_LOW_SIGNAL, "at_indicator_lowsignal_string"); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_lowbattchg_string) == 0)) { - WARNINGA("|%s| at_indicator_lowbattchg_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nobattchg_string) == 0)) { - ERRORA("|%s| at_indicator_nobattchg_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callactive_string) == 0)) { - DEBUGA_GSMOPEN("|%s| at_indicator_callactive_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nocallactive_string) == 0)) { - DEBUGA_GSMOPEN("|%s| at_indicator_nocallactive_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nocallsetup_string) == 0)) { - DEBUGA_GSMOPEN("|%s| at_indicator_nocallsetup_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callsetupincoming_string) == 0)) { - DEBUGA_GSMOPEN("|%s| at_indicator_callsetupincoming_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callsetupoutgoing_string) == 0)) { - DEBUGA_GSMOPEN("|%s| at_indicator_callsetupoutgoing_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callsetupremoteringing_string) - == 0)) { - DEBUGA_GSMOPEN("|%s| at_indicator_callsetupremoteringing_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - } - - /* let's look for OK, ERROR and EXPECTED_STRING in the complete lines read so far, without re-looking at the lines that has been yet looked at */ - for (i = la_read; i < la_counter; i++) { - if (expected_string) { - if ((strncmp(tech_pvt->line_array.result[i], expected_string, strlen(expected_string)) - == 0)) { - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| got what EXPECTED\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - at_ack = AT_OK; - } - } else { - if ((strcmp(tech_pvt->line_array.result[i], "OK") == 0)) { - if (option_debug > 1) - DEBUGA_GSMOPEN("got OK\n", GSMOPEN_P_LOG); - at_ack = AT_OK; - } - } - if ((strcmp(tech_pvt->line_array.result[i], "ERROR") == 0)) { - if (option_debug > 1) - DEBUGA_GSMOPEN("got ERROR\n", GSMOPEN_P_LOG); - at_ack = AT_ERROR; - } - - /* if we are requesting IMEI, put the line into the imei buffer if the line is not "OK" or "ERROR" */ - if (tech_pvt->requesting_imei && at_ack == -1) { - if (strlen(tech_pvt->line_array.result[i])) { /* we are reading the IMEI */ - strncpy(tech_pvt->imei, tech_pvt->line_array.result[i], sizeof(tech_pvt->imei)); - } - } - - /* if we are requesting IMSI, put the line into the imei buffer if the line is not "OK" or "ERROR" */ - if (tech_pvt->requesting_imsi && at_ack == -1) { - if (strlen(tech_pvt->line_array.result[i])) { /* we are reading the IMSI */ - strncpy(tech_pvt->imsi, tech_pvt->line_array.result[i], sizeof(tech_pvt->imsi)); - } - } - /* if we are reading an sms message from memory, put the line into the sms buffer if the line is not "OK" or "ERROR" */ - if (tech_pvt->reading_sms_msg > 1 && at_ack == -1) { - int c; - char sms_body[16000]; - //int err = 0; - memset(sms_body, '\0', sizeof(sms_body)); - - if (strncmp(tech_pvt->line_array.result[i], "+CMGR", 5) == 0) { /* we are reading the "header" of an SMS */ -#if 1 - char content[512]; - char content2[512]; - int inside_comma = 0; - int inside_quote = 0; - int which_field = 0; - int d = 0; - - DEBUGA_GSMOPEN("HERE\n", GSMOPEN_P_LOG); - - memset(content, '\0', sizeof(content)); - - - for (c = 0; c < strlen(tech_pvt->line_array.result[i]); c++) { - if (tech_pvt->line_array.result[i][c] == ',' && tech_pvt->line_array.result[i][c - 1] != '\\' && inside_quote == 0) { - if (inside_comma) { - inside_comma = 0; - DEBUGA_GSMOPEN("inside_comma=%d, inside_quote=%d, we're at=%s\n", GSMOPEN_P_LOG, inside_comma, inside_quote, - &tech_pvt->line_array.result[i][c]); - } else { - inside_comma = 1; - DEBUGA_GSMOPEN("inside_comma=%d, inside_quote=%d, we're at=%s\n", GSMOPEN_P_LOG, inside_comma, inside_quote, - &tech_pvt->line_array.result[i][c]); - } - } - if (tech_pvt->line_array.result[i][c] == '"' && tech_pvt->line_array.result[i][c - 1] != '\\') { - if (inside_quote) { - inside_quote = 0; - DEBUGA_GSMOPEN("END_CONTENT inside_comma=%d, inside_quote=%d, we're at=%s\n", GSMOPEN_P_LOG, inside_comma, inside_quote, - &tech_pvt->line_array.result[i][c]); - DEBUGA_GSMOPEN("%d content=%s\n", GSMOPEN_P_LOG, which_field, content); - - //strncat(tech_pvt->sms_message, "---", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - //strncat(tech_pvt->sms_message, content, ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - //strncat(tech_pvt->sms_message, "|||", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - - memset(content2, '\0', sizeof(content2)); - if (which_field == 1) { - //FIXME why this? err = ucs2_to_utf8(tech_pvt, content, content2, sizeof(content2)); - //err = ucs2_to_utf8(tech_pvt, content, content2, sizeof(content2)); - //err = 0; - strncpy(content2, content, sizeof(content2)); - } else { - //err = 0; - strncpy(content2, content, sizeof(content2)); - } - DEBUGA_GSMOPEN("%d content2=%s\n", GSMOPEN_P_LOG, which_field, content2); - DEBUGA_GSMOPEN("%d content=%s\n", GSMOPEN_P_LOG, which_field, content2); - - //strncat(tech_pvt->sms_message, "---", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - //if (!err) - //strncat(tech_pvt->sms_message, content2, ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - //strncat(tech_pvt->sms_message, "|||", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - memset(content, '\0', sizeof(content)); - d = 0; - if (which_field == 1) { - strncpy(tech_pvt->sms_sender, content2, sizeof(tech_pvt->sms_sender)); - DEBUGA_GSMOPEN("%d content=%s\n", GSMOPEN_P_LOG, which_field, content2); - - } else if (which_field == 2) { - strncpy(tech_pvt->sms_date, content2, sizeof(tech_pvt->sms_date)); - DEBUGA_GSMOPEN("%d content=%s\n", GSMOPEN_P_LOG, which_field, content2); - } else if (which_field > 2) { - WARNINGA("WHY which_field is > 2 ? (which_field is %d)\n", GSMOPEN_P_LOG, which_field); - } - which_field++; - } else { - inside_quote = 1; - DEBUGA_GSMOPEN("START_CONTENT inside_comma=%d, inside_quote=%d, we're at=%s\n", GSMOPEN_P_LOG, inside_comma, inside_quote, - &tech_pvt->line_array.result[i][c]); - } - } - if (inside_quote && tech_pvt->line_array.result[i][c] != '"') { - - content[d] = tech_pvt->line_array.result[i][c]; - d++; - - } - - } -#endif //0 - } //it was the +CMGR answer from the cellphone - else { - DEBUGA_GSMOPEN("body=%s\n", GSMOPEN_P_LOG, sms_body); - DEBUGA_GSMOPEN("tech_pvt->line_array.result[i]=%s\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->sms_pdu_not_supported) { - char content3[1000]; - strncpy(tech_pvt->sms_message, tech_pvt->line_array.result[i], sizeof(tech_pvt->sms_message)); - - //int howmanyleft; - - - DEBUGA_GSMOPEN("sms_message=%s\n", GSMOPEN_P_LOG, tech_pvt->sms_message); - ucs2_to_utf8(tech_pvt, tech_pvt->sms_message, content3, sizeof(content3)); - DEBUGA_GSMOPEN("content3=%s\n", GSMOPEN_P_LOG, content3); - strncpy(tech_pvt->sms_body, content3, sizeof(tech_pvt->sms_body)); - //sleep(10); - //cicopet - if (tech_pvt->sms_cnmi_not_supported) { - sms_incoming(tech_pvt); - DEBUGA_GSMOPEN("2 content3=%s\n", GSMOPEN_P_LOG, content3); - } - } else { -#ifndef NO_GSMLIB - char content2[1000]; - SMSMessageRef sms; -//MessageType messagetype; -//Address servicecentreaddress; -//Timestamp servicecentretimestamp; -//Address sender_recipient_address; - - sms = SMSMessage::decode(tech_pvt->line_array.result[i]); // dataCodingScheme = 8 , text=ciao 123 belè новости לק ראת ﺎﻠﺠﻤﻋﺓ 人大 - - DEBUGA_GSMOPEN("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); - - memset(content2, '\0', sizeof(content2)); - if (sms->dataCodingScheme().getAlphabet() == DCS_DEFAULT_ALPHABET) { - iso_8859_1_to_utf8(tech_pvt, (char *) sms->userData().c_str(), content2, sizeof(content2)); - } else if (sms->dataCodingScheme().getAlphabet() == DCS_SIXTEEN_BIT_ALPHABET) { - ucs2_to_utf8(tech_pvt, (char *) bufToHex((unsigned char *) sms->userData().data(), sms->userData().length()).c_str(), content2, - sizeof(content2)); - } else { - ERRORA("dataCodingScheme not supported=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); - - } - DEBUGA_GSMOPEN("dataCodingScheme=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); - DEBUGA_GSMOPEN("dataCodingScheme=%s\n", GSMOPEN_P_LOG, sms->dataCodingScheme().toString().c_str()); - DEBUGA_GSMOPEN("address=%s\n", GSMOPEN_P_LOG, sms->address().toString().c_str()); - DEBUGA_GSMOPEN("serviceCentreAddress=%s\n", GSMOPEN_P_LOG, sms->serviceCentreAddress().toString().c_str()); - DEBUGA_GSMOPEN("serviceCentreTimestamp=%s\n", GSMOPEN_P_LOG, sms->serviceCentreTimestamp().toString().c_str()); - DEBUGA_GSMOPEN("UserDataHeader=%s\n", GSMOPEN_P_LOG, (char *)bufToHex((unsigned char *) - ((string) sms->userDataHeader()).data(), sms->userDataHeader().length()).c_str()); - DEBUGA_GSMOPEN("messageType=%d\n", GSMOPEN_P_LOG, sms->messageType()); - DEBUGA_GSMOPEN("userData= |||%s|||\n", GSMOPEN_P_LOG, content2); - - - memset(sms_body, '\0', sizeof(sms_body)); - strncpy(sms_body, content2, sizeof(sms_body)); - DEBUGA_GSMOPEN("body=%s\n", GSMOPEN_P_LOG, sms_body); - strncpy(tech_pvt->sms_body, sms_body, sizeof(tech_pvt->sms_body)); - strncpy(tech_pvt->sms_sender, sms->address().toString().c_str(), sizeof(tech_pvt->sms_sender)); - strncpy(tech_pvt->sms_date, sms->serviceCentreTimestamp().toString().c_str(), sizeof(tech_pvt->sms_date)); - strncpy(tech_pvt->sms_userdataheader, (char *) - bufToHex((unsigned char *)((string) sms->userDataHeader()).data(), sms->userDataHeader().length()).c_str(), - sizeof(tech_pvt->sms_userdataheader)); - strncpy(tech_pvt->sms_datacodingscheme, sms->dataCodingScheme().toString().c_str(), sizeof(tech_pvt->sms_datacodingscheme)); - strncpy(tech_pvt->sms_servicecentreaddress, sms->serviceCentreAddress().toString().c_str(), - sizeof(tech_pvt->sms_servicecentreaddress)); - tech_pvt->sms_messagetype = sms->messageType(); -//messagetype = sms->messageType(); -//servicecentreaddress = sms->serviceCentreAddress(); -//servicecentretimestamp = sms->serviceCentreTimestamp(); -//sender_recipient_address = sms->address(); - -#endif// NO_GSMLIB - } - -#if 0 - //strncat(tech_pvt->sms_message, "---", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - //strncat(tech_pvt->sms_message, tech_pvt->line_array.result[i], ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - //strncat(tech_pvt->sms_message, "|||", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - - memset(sms_body, '\0', sizeof(sms_body)); - err = ucs2_to_utf8(tech_pvt, tech_pvt->line_array.result[i], sms_body, sizeof(sms_body)); - DEBUGA_GSMOPEN("body=%s\n", GSMOPEN_P_LOG, sms_body); - strncpy(tech_pvt->sms_body, sms_body, sizeof(tech_pvt->sms_body)); - - //strncat(tech_pvt->sms_message, "---", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - //if (!err) - //strncat(tech_pvt->sms_message, sms_body, ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - //strncat(tech_pvt->sms_message, "|||", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1)); - - //DEBUGA_GSMOPEN("sms_message=%s\n", GSMOPEN_P_LOG, tech_pvt->sms_message); -#endif //0 - } //it was the UCS2 from cellphone - - } //we were reading the SMS - - } - - la_read = la_counter; - - if (look_for_ack && at_ack > -1) - break; - - if (la_counter > AT_MESG_MAX_LINES) { - ERRORA("Too many lines in result (>%d). Stopping reader.\n", GSMOPEN_P_LOG, AT_MESG_MAX_LINES); - at_ack = AT_ERROR; - break; - } - } - - UNLOCKA(tech_pvt->controldev_lock); - POPPA_UNLOCKA(tech_pvt->controldev_lock); - if (select_err == -1) { - ERRORA("select returned -1 on %s, setting controldev_dead, error was: %s\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name, strerror(errno)); - tech_pvt->controldev_dead = 1; - close(tech_pvt->controldevfd); - - tech_pvt->running=0; - alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "select returned -1 on interface, setting controldev_dead"); - tech_pvt->active=0; - tech_pvt->name[0]='\0'; - if (tech_pvt->owner) - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - switch_sleep(1000000); - return -1; - } - - if (tech_pvt->phone_callflow == CALLFLOW_CALL_INCOMING && tech_pvt->call_incoming_time.tv_sec) { //after three sec of CALLFLOW_CALL_INCOMING, we assume the phone is incapable of notifying RING (eg: motorola c350), so we try to answer - char list_command[64]; - struct timeval call_incoming_timeout; - gettimeofday(&call_incoming_timeout, NULL); - call_incoming_timeout.tv_sec -= 3; - DEBUGA_GSMOPEN - ("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n", - GSMOPEN_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec); - if (call_incoming_timeout.tv_sec > tech_pvt->call_incoming_time.tv_sec) { - - tech_pvt->call_incoming_time.tv_sec = 0; - tech_pvt->call_incoming_time.tv_usec = 0; - DEBUGA_GSMOPEN - ("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n", - GSMOPEN_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec); - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CPBS=RC"); - if (res) { - ERRORA("AT+CPBS=RC (select memory of received calls) was not answered by the phone\n", GSMOPEN_P_LOG); - } - tech_pvt->phonebook_querying = 1; - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CPBR=?"); - if (res) { - ERRORA("AT+CPBS=RC (select memory of received calls) was not answered by the phone\n", GSMOPEN_P_LOG); - } - tech_pvt->phonebook_querying = 0; - sprintf(list_command, "AT+CPBR=%d,%d", tech_pvt->phonebook_first_entry, tech_pvt->phonebook_last_entry); - tech_pvt->phonebook_listing_received_calls = 1; - res = gsmopen_serial_write_AT_expect_longtime(tech_pvt, list_command, "OK"); - if (res) { - WARNINGA("AT+CPBR=%d,%d failed, continue\n", GSMOPEN_P_LOG, tech_pvt->phonebook_first_entry, tech_pvt->phonebook_last_entry); - } - tech_pvt->phonebook_listing_received_calls = 0; - } - } - - if (tech_pvt->phone_callflow == CALLFLOW_INCOMING_RING) { - struct timeval call_incoming_timeout; - gettimeofday(&call_incoming_timeout, NULL); - call_incoming_timeout.tv_sec -= 10; - // DEBUGA_GSMOPEN ("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n", GSMOPEN_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec); - if (call_incoming_timeout.tv_sec > tech_pvt->ringtime.tv_sec) { - ERRORA("Ringing stopped and I have not answered. Why?\n", GSMOPEN_P_LOG); - DEBUGA_GSMOPEN - ("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n", - GSMOPEN_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec); - if (tech_pvt->owner) { - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - } - } - } - tech_pvt->line_array.elemcount = la_counter; - //NOTICA (" OUTSIDE this gsmopen_serial_device %s \n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); - if (look_for_ack) - return at_ack; - else - return 0; -} - -int gsmopen_serial_write_AT(private_t * tech_pvt, const char *data) -{ - int howmany; - int i; - int res; - int count; - - howmany = strlen(data); - - for (i = 0; i < howmany; i++) { - res = write(tech_pvt->controldevfd, &data[i], 1); - - if (res != 1) { - DEBUGA_GSMOPEN("Error sending (%.1s): %d (%s)\n", GSMOPEN_P_LOG, &data[i], res, strerror(errno)); - gsmopen_sleep(100000); - for (count = 0; count < 10; count++) { - res = write(tech_pvt->controldevfd, &data[i], 1); - if (res == 1) { - DEBUGA_GSMOPEN("Successfully RE-sent (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &data[i], count, res, strerror(errno)); - break; - } else - DEBUGA_GSMOPEN("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &data[i], count, res, strerror(errno)); - gsmopen_sleep(100000); - - } - if (res != 1) { - ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &data[i], count, res, strerror(errno)); - return -1; - } - } - if (option_debug > 1) - DEBUGA_GSMOPEN("sent data... (%.1s)\n", GSMOPEN_P_LOG, &data[i]); - gsmopen_sleep(1000); /* release the cpu */ - } - - res = write(tech_pvt->controldevfd, "\r", 1); - - if (res != 1) { - DEBUGA_GSMOPEN("Error sending (carriage return): %d (%s)\n", GSMOPEN_P_LOG, res, strerror(errno)); - gsmopen_sleep(100000); - for (count = 0; count < 10; count++) { - res = write(tech_pvt->controldevfd, "\r", 1); - - if (res == 1) { - DEBUGA_GSMOPEN("Successfully RE-sent carriage return: %d %d (%s)\n", GSMOPEN_P_LOG, count, res, strerror(errno)); - break; - } else - DEBUGA_GSMOPEN("Error RE-sending (carriage return): %d %d (%s)\n", GSMOPEN_P_LOG, count, res, strerror(errno)); - gsmopen_sleep(100000); - - } - if (res != 1) { - ERRORA("Error RE-sending (carriage return): %d %d (%s)\n", GSMOPEN_P_LOG, count, res, strerror(errno)); - return -1; - } - } - if (option_debug > 1) - DEBUGA_GSMOPEN("sent (carriage return)\n", GSMOPEN_P_LOG); - gsmopen_sleep(1000); /* release the cpu */ - - return howmany; -} - -int gsmopen_serial_write_AT_nocr(private_t * tech_pvt, const char *data) -{ - int howmany; - int i; - int res; - int count; - - howmany = strlen(data); - - for (i = 0; i < howmany; i++) { - res = write(tech_pvt->controldevfd, &data[i], 1); - - if (res != 1) { - DEBUGA_GSMOPEN("Error sending (%.1s): %d (%s)\n", GSMOPEN_P_LOG, &data[i], res, strerror(errno)); - gsmopen_sleep(100000); - for (count = 0; count < 10; count++) { - res = write(tech_pvt->controldevfd, &data[i], 1); - if (res == 1) - break; - else - DEBUGA_GSMOPEN("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &data[i], count, res, strerror(errno)); - gsmopen_sleep(100000); - - } - if (res != 1) { - ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &data[i], count, res, strerror(errno)); - return -1; - } - } - if (option_debug > 1) - DEBUGA_GSMOPEN("sent data... (%.1s)\n", GSMOPEN_P_LOG, &data[i]); - gsmopen_sleep(1000); /* release the cpu */ - } - - gsmopen_sleep(1000); /* release the cpu */ - - return howmany; -} - -int gsmopen_serial_write_AT_noack(private_t * tech_pvt, const char *data) -{ - - if (option_debug > 1) - DEBUGA_GSMOPEN("gsmopen_serial_write_AT_noack: %s\n", GSMOPEN_P_LOG, data); - - PUSHA_UNLOCKA(tech_pvt->controldev_lock); - LOKKA(tech_pvt->controldev_lock); - if (gsmopen_serial_write_AT(tech_pvt, data) != strlen(data)) { - - ERRORA("Error sending data... (%s)\n", GSMOPEN_P_LOG, strerror(errno)); - UNLOCKA(tech_pvt->controldev_lock); - return -1; - } - UNLOCKA(tech_pvt->controldev_lock); - POPPA_UNLOCKA(tech_pvt->controldev_lock); - - return 0; -} - -int gsmopen_serial_write_AT_ack(private_t * tech_pvt, const char *data) -{ - int at_result = AT_ERROR; - - PUSHA_UNLOCKA(tech_pvt->controldev_lock); - LOKKA(tech_pvt->controldev_lock); - if (option_debug > 1) - DEBUGA_GSMOPEN("sending: %s\n", GSMOPEN_P_LOG, data); - if (gsmopen_serial_write_AT(tech_pvt, data) != strlen(data)) { - ERRORA("Error sending data... (%s) \n", GSMOPEN_P_LOG, strerror(errno)); - UNLOCKA(tech_pvt->controldev_lock); - return -1; - } - - at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, 2, NULL, 1); // 2.5 sec timeout - UNLOCKA(tech_pvt->controldev_lock); - POPPA_UNLOCKA(tech_pvt->controldev_lock); - - return at_result; - -} - -int gsmopen_serial_write_AT_ack_nocr_longtime(private_t * tech_pvt, const char *data) -{ - int at_result = AT_ERROR; - - PUSHA_UNLOCKA(tech_pvt->controldev_lock); - LOKKA(tech_pvt->controldev_lock); - if (option_debug > 1) - DEBUGA_GSMOPEN("sending: %s\n", GSMOPEN_P_LOG, data); - if (gsmopen_serial_write_AT_nocr(tech_pvt, data) != strlen(data)) { - ERRORA("Error sending data... (%s) \n", GSMOPEN_P_LOG, strerror(errno)); - UNLOCKA(tech_pvt->controldev_lock); - return -1; - } - - at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, 20, NULL, 1); // 20.5 sec timeout - UNLOCKA(tech_pvt->controldev_lock); - POPPA_UNLOCKA(tech_pvt->controldev_lock); - - return at_result; - -} - -int gsmopen_serial_write_AT_expect1(private_t * tech_pvt, const char *data, const char *expected_string, int expect_crlf, int seconds) -{ - int at_result = AT_ERROR; - - PUSHA_UNLOCKA(tech_pvt->controldev_lock); - LOKKA(tech_pvt->controldev_lock); - if (option_debug > 1) - DEBUGA_GSMOPEN("sending: %s, expecting: %s\n", GSMOPEN_P_LOG, data, expected_string); - if (gsmopen_serial_write_AT(tech_pvt, data) != strlen(data)) { - ERRORA("Error sending data... (%s) \n", GSMOPEN_P_LOG, strerror(errno)); - UNLOCKA(tech_pvt->controldev_lock); - return -1; - } - - at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, seconds, expected_string, expect_crlf); // 20.5 sec timeout, used for querying the SIM and sending SMSs - UNLOCKA(tech_pvt->controldev_lock); - POPPA_UNLOCKA(tech_pvt->controldev_lock); - - return at_result; - -} - -int gsmopen_serial_AT_expect(private_t * tech_pvt, const char *expected_string, int expect_crlf, int seconds) -{ - int at_result = AT_ERROR; - - PUSHA_UNLOCKA(tech_pvt->controldev_lock); - LOKKA(tech_pvt->controldev_lock); - if (option_debug > 1) - DEBUGA_GSMOPEN("expecting: %s\n", GSMOPEN_P_LOG, expected_string); - - at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, seconds, expected_string, expect_crlf); // 20.5 sec timeout, used for querying the SIM and sending SMSs - UNLOCKA(tech_pvt->controldev_lock); - POPPA_UNLOCKA(tech_pvt->controldev_lock); - - return at_result; - -} - -int gsmopen_serial_answer(private_t * tech_pvt) -{ - if (tech_pvt->controldevprotocol == PROTOCOL_AT) - return gsmopen_serial_answer_AT(tech_pvt); -#ifdef GSMOPEN_FBUS2 - if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2) - return gsmopen_serial_answer_FBUS2(tech_pvt); -#endif /* GSMOPEN_FBUS2 */ -#ifdef GSMOPEN_CVM - if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return gsmopen_serial_answer_CVM_BUSMAIL(tech_pvt); -#endif /* GSMOPEN_CVM */ - return -1; -} - - -int gsmopen_serial_answer_AT(private_t * tech_pvt) -{ - int res; - - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_answer, tech_pvt->at_answer_expect); - if (res) { - DEBUGA_GSMOPEN - ("at_answer command failed, command used: %s, expecting: %s, trying with AT+CKPD=\"S\"\n", - GSMOPEN_P_LOG, tech_pvt->at_answer, tech_pvt->at_answer_expect); - - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CKPD=\"S\""); - if (res) { - ERRORA("at_answer command failed, command used: 'AT+CKPD=\"S\"', giving up\n", GSMOPEN_P_LOG); - return -1; - } - } - //tech_pvt->interface_state = GSMOPEN_STATE_UP; - //tech_pvt->phone_callflow = CALLFLOW_CALL_ACTIVE; - DEBUGA_GSMOPEN("AT: call answered\n", GSMOPEN_P_LOG); - return 0; -} - -int gsmopen_serial_hangup(private_t * tech_pvt) -{ - if (tech_pvt->controldevprotocol == PROTOCOL_AT) - return gsmopen_serial_hangup_AT(tech_pvt); -#ifdef GSMOPEN_FBUS2 - if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2) - return gsmopen_serial_hangup_FBUS2(tech_pvt); -#endif /* GSMOPEN_FBUS2 */ -#ifdef GSMOPEN_CVM - if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return gsmopen_serial_hangup_CVM_BUSMAIL(tech_pvt); -#endif /* GSMOPEN_CVM */ - return -1; -} - - -int gsmopen_serial_hangup_AT(private_t * tech_pvt) -{ - int res; - - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_hangup, tech_pvt->at_hangup_expect); - if (res) { - DEBUGA_GSMOPEN("at_hangup command failed, command used: %s, trying to use AT+CKPD=\"EEE\"\n", GSMOPEN_P_LOG, tech_pvt->at_hangup); - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CKPD=\"EEE\""); - if (res) { - ERRORA("at_hangup command failed, command used: 'AT+CKPD=\"EEE\"'\n", GSMOPEN_P_LOG); - return -1; - } - } - } - tech_pvt->interface_state = GSMOPEN_STATE_DOWN; - tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; - return 0; -} - - -int gsmopen_serial_call(private_t * tech_pvt, char *dstr) -{ - if (tech_pvt->controldevprotocol == PROTOCOL_AT) - return gsmopen_serial_call_AT(tech_pvt, dstr); -#ifdef GSMOPEN_FBUS2 - if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2) - return gsmopen_serial_call_FBUS2(tech_pvt, dstr); -#endif /* GSMOPEN_FBUS2 */ - if (tech_pvt->controldevprotocol == PROTOCOL_NO_SERIAL) - return 0; -#ifdef GSMOPEN_CVM - if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return gsmopen_serial_call_CVM_BUSMAIL(tech_pvt, dstr); -#endif /* GSMOPEN_CVM */ - return -1; -} - -int gsmopen_serial_call_AT(private_t * tech_pvt, char *dstr) -{ - int res; - char at_command[256]; - - if (option_debug) - DEBUGA_PBX("Dialing %s\n", GSMOPEN_P_LOG, dstr); - memset(at_command, 0, sizeof(at_command)); - tech_pvt->phone_callflow = CALLFLOW_CALL_DIALING; - tech_pvt->interface_state = GSMOPEN_STATE_DIALING; - //ast_uri_decode(dstr); -/* - size_t fixdstr = strspn(dstr, AST_DIGIT_ANYDIG); - if (fixdstr == 0) { - ERRORA("dial command failed because of invalid dial number. dial string was: %s\n", - GSMOPEN_P_LOG, dstr); - return -1; - } -*/ - //dstr[fixdstr] = '\0'; - sprintf(at_command, "%s%s%s", tech_pvt->at_dial_pre_number, dstr, tech_pvt->at_dial_post_number); - DEBUGA_PBX("Dialstring %s\n", GSMOPEN_P_LOG, at_command); - res = gsmopen_serial_write_AT_expect(tech_pvt, at_command, tech_pvt->at_dial_expect); - if (res) { - ERRORA("dial command failed, dial string was: %s\n", GSMOPEN_P_LOG, at_command); - return -1; - } - // jet - early audio - //if (tech_pvt->at_early_audio) { - //ast_queue_control(tech_pvt->owner, AST_CONTROL_ANSWER); - //} - - return 0; -} - -int ucs2_to_utf8(private_t * tech_pvt, char *ucs2_in, char *utf8_out, size_t outbytesleft) -{ - char converted[16000]; -#ifndef WIN32 - iconv_t iconv_format; - int iconv_res; - char *outbuf; - char *inbuf; - size_t inbytesleft; - int c; - char stringa[5]; - double hexnum; - int i = 0; - - memset(converted, '\0', sizeof(converted)); - - DEBUGA_GSMOPEN("ucs2_in=%s\n", GSMOPEN_P_LOG, ucs2_in); - /* cicopet */ - for (c = 0; c < strlen(ucs2_in); c++) { - sprintf(stringa, "0x%c%c", ucs2_in[c], ucs2_in[c + 1]); - c++; - hexnum = strtod(stringa, NULL); - converted[i] = (char) hexnum; - i++; - } - - outbuf = utf8_out; - inbuf = converted; - - iconv_format = iconv_open("UTF8", "UCS-2BE"); - if (iconv_format == (iconv_t) - 1) { - ERRORA("error: %s\n", GSMOPEN_P_LOG, strerror(errno)); - return -1; - } - - inbytesleft = i; - DEBUGA_GSMOPEN("1 ciao in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n", - GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, converted, utf8_out); - - iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft); - if (iconv_res == (size_t) -1) { - DEBUGA_GSMOPEN("2 ciao in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n", - GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, converted, utf8_out); - DEBUGA_GSMOPEN("3 error: %s %d\n", GSMOPEN_P_LOG, strerror(errno), errno); - iconv_close(iconv_format); - return -1; - } - DEBUGA_GSMOPEN - ("iconv_res=%d, in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n", - GSMOPEN_P_LOG, iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, converted, utf8_out); - iconv_close(iconv_format); - -#endif //WIN32 - return 0; -} - -int iso_8859_1_to_utf8(private_t * tech_pvt, char *iso_8859_1_in, char *utf8_out, size_t outbytesleft) -{ - char converted[16000]; -#ifndef WIN32 - iconv_t iconv_format; - int iconv_res; - char *outbuf; - char *inbuf; - size_t inbytesleft; - //int c; - //char stringa[5]; - //double hexnum; - //int i = 0; - - memset(converted, '\0', sizeof(converted)); - - DEBUGA_GSMOPEN("iso_8859_1_in=%s\n", GSMOPEN_P_LOG, iso_8859_1_in); - - outbuf = utf8_out; - inbuf = iso_8859_1_in; - - iconv_format = iconv_open("UTF8", "ISO_8859-1"); - if (iconv_format == (iconv_t) - 1) { - ERRORA("error: %s\n", GSMOPEN_P_LOG, strerror(errno)); - return -1; - } - - - inbytesleft = strlen(iso_8859_1_in) * 2; - iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft); - if (iconv_res == (size_t) -1) { - DEBUGA_GSMOPEN("ciao in=%s, inleft=%d, out=%s, outleft=%d, utf8_out=%s\n", - GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_out); - DEBUGA_GSMOPEN("error: %s %d\n", GSMOPEN_P_LOG, strerror(errno), errno); - return -1; - } - DEBUGA_GSMOPEN - (" strlen(iso_8859_1_in)=%d, iconv_res=%d, inbuf=%s, inleft=%d, out=%s, outleft=%d, utf8_out=%s\n", - GSMOPEN_P_LOG, (int) strlen(iso_8859_1_in), iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_out); - - - - iconv_close(iconv_format); - -#endif //WIN32 - return 0; -} - - -int utf_to_ucs2(private_t * tech_pvt, char *utf_in, size_t inbytesleft, char *ucs2_out, size_t outbytesleft) -{ - /* cicopet */ -#ifndef WIN32 - iconv_t iconv_format; - int iconv_res; - char *outbuf; - char *inbuf; - char converted[16000]; - int i; - char stringa[16]; - char stringa2[16]; - - memset(converted, '\0', sizeof(converted)); - - outbuf = converted; - inbuf = utf_in; - - iconv_format = iconv_open("UCS-2BE", "UTF8"); - if (iconv_format == (iconv_t) - 1) { - ERRORA("error: %s\n", GSMOPEN_P_LOG, strerror(errno)); - return -1; - } - outbytesleft = 16000; - - DEBUGA_GSMOPEN("in=%s, inleft=%d, out=%s, outleft=%d, utf_in=%s, converted=%s\n", - GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf_in, converted); - iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft); - if (iconv_res == (size_t) -1) { - ERRORA("error: %s %d\n", GSMOPEN_P_LOG, strerror(errno), errno); - return -1; - } - DEBUGA_GSMOPEN - ("iconv_res=%d, in=%s, inleft=%d, out=%s, outleft=%d, utf_in=%s, converted=%s\n", - GSMOPEN_P_LOG, iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf_in, converted); - iconv_close(iconv_format); - - for (i = 0; i < 16000 - outbytesleft; i++) { - memset(stringa, '\0', sizeof(stringa)); - memset(stringa2, '\0', sizeof(stringa2)); - sprintf(stringa, "%02X", converted[i]); - DEBUGA_GSMOPEN("character is |%02X|\n", GSMOPEN_P_LOG, converted[i]); - stringa2[0] = stringa[strlen(stringa) - 2]; - stringa2[1] = stringa[strlen(stringa) - 1]; - strncat(ucs2_out, stringa2, ((outbytesleft - strlen(ucs2_out)) - 1)); //add the received line to the buffer - DEBUGA_GSMOPEN("stringa=%s, stringa2=%s, ucs2_out=%s\n", GSMOPEN_P_LOG, stringa, stringa2, ucs2_out); - } -#endif //WIN32 - return 0; -} - - -/*! \brief Answer incoming call, - * Part of PBX interface */ -int gsmopen_answer(private_t * tech_pvt) -{ - int res; - - if (option_debug) { - DEBUGA_PBX("ENTERING FUNC\n", GSMOPEN_P_LOG); - } - /* do something to actually answer the call, if needed (eg. pick up the phone) */ - if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL) { - if (gsmopen_serial_answer(tech_pvt)) { - ERRORA("gsmopen_answer FAILED\n", GSMOPEN_P_LOG); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", GSMOPEN_P_LOG); - } - return -1; - } - } - tech_pvt->interface_state = GSMOPEN_STATE_UP; - tech_pvt->phone_callflow = CALLFLOW_CALL_ACTIVE; - - while (tech_pvt->interface_state == GSMOPEN_STATE_RING) { - gsmopen_sleep(10000); //10msec - } - if (tech_pvt->interface_state != GSMOPEN_STATE_UP) { - ERRORA("call answering failed\n", GSMOPEN_P_LOG); - res = -1; - } else { - if (option_debug) - DEBUGA_PBX("call answered\n", GSMOPEN_P_LOG); - res = 0; -#ifdef GSMOPEN_PORTAUDIO - //speex_echo_state_reset(tech_pvt->stream->echo_state); -#endif // GSMOPEN_PORTAUDIO - - new_inbound_channel(tech_pvt); - if (tech_pvt->owner) { - DEBUGA_PBX("going to send GSMOPEN_STATE_UP\n", GSMOPEN_P_LOG); - ast_setstate(tech_pvt->owner, GSMOPEN_STATE_UP); - //ast_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_ANSWER); - //gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_ANSWER); - DEBUGA_PBX("just sent GSMOPEN_STATE_UP\n", GSMOPEN_P_LOG); - } - } - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", GSMOPEN_P_LOG); - } - return res; -} - -int gsmopen_ring(private_t * tech_pvt) -{ - int res = 0; - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - if (option_debug) { - //DEBUGA_PBX("ENTERING FUNC\n", GSMOPEN_P_LOG); - } - - session = switch_core_session_locate(tech_pvt->session_uuid_str); - if (session) { - switch_core_session_rwunlock(session); - return 0; - } - - new_inbound_channel(tech_pvt); - - gsmopen_sleep(10000); - - session = switch_core_session_locate(tech_pvt->session_uuid_str); - if (session) { - channel = switch_core_session_get_channel(session); - - switch_core_session_queue_indication(session, SWITCH_MESSAGE_INDICATE_RINGING); - if (channel) { - switch_channel_mark_ring_ready(channel); - } else { - ERRORA("no session\n", GSMOPEN_P_LOG); - } - switch_core_session_rwunlock(session); - } else { - ERRORA("no session\n", GSMOPEN_P_LOG); - - } - - - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", GSMOPEN_P_LOG); - } - return res; -} - - -/*! \brief Hangup gsmopen call - * Part of PBX interface, called from ast_hangup */ - -int gsmopen_hangup(private_t * tech_pvt) -{ - - /* if there is not gsmopen pvt why we are here ? */ - if (!tech_pvt) { - ERRORA("Asked to hangup channel not connected\n", GSMOPEN_P_LOG); - return 0; - } - - DEBUGA_GSMOPEN("ENTERING FUNC\n", GSMOPEN_P_LOG); - - - if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL) { - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { - /* actually hangup through the serial port */ - if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL) { - int res; - res = gsmopen_serial_hangup(tech_pvt); - if (res) { - ERRORA("gsmopen_serial_hangup error: %d\n", GSMOPEN_P_LOG, res); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", GSMOPEN_P_LOG); - } - return -1; - } - } - - while (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { - gsmopen_sleep(10000); //10msec - } - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { - ERRORA("call hangup failed\n", GSMOPEN_P_LOG); - return -1; - } else { - DEBUGA_GSMOPEN("call hungup\n", GSMOPEN_P_LOG); - } - } - } else { - tech_pvt->interface_state = GSMOPEN_STATE_DOWN; - tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; - } - - switch_set_flag(tech_pvt, TFLAG_HANGUP); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", GSMOPEN_P_LOG); - } - return 0; -} - - - -#ifdef GSMOPEN_ALSA -/*! \brief ALSA pcm format, according to endianess */ -#if __BYTE_ORDER == __LITTLE_ENDIAN -snd_pcm_format_t gsmopen_format = SND_PCM_FORMAT_S16_LE; -#else -snd_pcm_format_t gsmopen_format = SND_PCM_FORMAT_S16_BE; -#endif - -/*! - * \brief Initialize the ALSA soundcard channels (capture AND playback) used by one interface (a multichannel soundcard can be used by multiple interfaces) - * \param p the gsmopen_pvt of the interface - * - * This function call alsa_open_dev to initialize the ALSA soundcard for each channel (capture AND playback) used by one interface (a multichannel soundcard can be used by multiple interfaces). Called by sound_init - * - * \return zero on success, -1 on error. - */ -int alsa_init(private_t * tech_pvt) -{ - tech_pvt->alsac = alsa_open_dev(tech_pvt, SND_PCM_STREAM_CAPTURE); - if (!tech_pvt->alsac) { - ERRORA("Failed opening ALSA capture device: %s\n", GSMOPEN_P_LOG, tech_pvt->alsacname); - if (alsa_shutdown(tech_pvt)) { - ERRORA("alsa_shutdown failed\n", GSMOPEN_P_LOG); - return -1; - } - return -1; - } - tech_pvt->alsap = alsa_open_dev(tech_pvt, SND_PCM_STREAM_PLAYBACK); - if (!tech_pvt->alsap) { - ERRORA("Failed opening ALSA playback device: %s\n", GSMOPEN_P_LOG, tech_pvt->alsapname); - if (alsa_shutdown(tech_pvt)) { - ERRORA("alsa_shutdown failed\n", GSMOPEN_P_LOG); - return -1; - } - return -1; - } - - /* make valgrind very happy */ - snd_config_update_free_global(); - return 0; -} - -/*! - * \brief Shutdown the ALSA soundcard channels (input and output) used by one interface (a multichannel soundcard can be used by multiple interfaces) - * \param p the gsmopen_pvt of the interface - * - * This function shutdown the ALSA soundcard channels (input and output) used by one interface (a multichannel soundcard can be used by multiple interfaces). Called by sound_init - * - * \return zero on success, -1 on error. - */ - -int alsa_shutdown(private_t * tech_pvt) -{ - - int err; - - if (tech_pvt->alsap) { - err = snd_pcm_drop(tech_pvt->alsap); - if (err < 0) { - ERRORA("device [%s], snd_pcm_drop failed with error '%s'\n", GSMOPEN_P_LOG, tech_pvt->alsapname, snd_strerror(err)); - return -1; - } - err = snd_pcm_close(tech_pvt->alsap); - if (err < 0) { - ERRORA("device [%s], snd_pcm_close failed with error '%s'\n", GSMOPEN_P_LOG, tech_pvt->alsapname, snd_strerror(err)); - return -1; - } - tech_pvt->alsap = NULL; - } - if (tech_pvt->alsac) { - err = snd_pcm_drop(tech_pvt->alsac); - if (err < 0) { - ERRORA("device [%s], snd_pcm_drop failed with error '%s'\n", GSMOPEN_P_LOG, tech_pvt->alsacname, snd_strerror(err)); - return -1; - } - err = snd_pcm_close(tech_pvt->alsac); - if (err < 0) { - ERRORA("device [%s], snd_pcm_close failed with error '%s'\n", GSMOPEN_P_LOG, tech_pvt->alsacname, snd_strerror(err)); - return -1; - } - tech_pvt->alsac = NULL; - } - - return 0; -} - -/*! - * \brief Setup and open the ALSA device (capture OR playback) - * \param p the gsmopen_pvt of the interface - * \param stream the ALSA capture/playback definition - * - * This function setup and open the ALSA device (capture OR playback). Called by alsa_init - * - * \return zero on success, -1 on error. - */ -snd_pcm_t *alsa_open_dev(private_t * tech_pvt, snd_pcm_stream_t stream) -{ - - snd_pcm_t *handle = NULL; - snd_pcm_hw_params_t *params; - snd_pcm_sw_params_t *swparams; - snd_pcm_uframes_t buffer_size; - int err; - size_t n; - //snd_pcm_uframes_t xfer_align; - unsigned int rate; - snd_pcm_uframes_t start_threshold, stop_threshold; - snd_pcm_uframes_t period_size = 0; - snd_pcm_uframes_t chunk_size = 0; - int start_delay = 0; - int stop_delay = 0; - snd_pcm_state_t state; - snd_pcm_info_t *info; - unsigned int chan_num; - - period_size = tech_pvt->alsa_period_size; - - snd_pcm_hw_params_alloca(¶ms); - snd_pcm_sw_params_alloca(&swparams); - - if (stream == SND_PCM_STREAM_CAPTURE) { - err = snd_pcm_open(&handle, tech_pvt->alsacname, stream, 0 | SND_PCM_NONBLOCK); - } else { - err = snd_pcm_open(&handle, tech_pvt->alsapname, stream, 0 | SND_PCM_NONBLOCK); - } - if (err < 0) { - ERRORA - ("snd_pcm_open failed with error '%s' on device '%s', if you are using a plughw:n device please change it to be a default:n device (so to allow it to be shared with other concurrent programs), or maybe you are using an ALSA voicemodem and slmodemd" - " is running?\n", GSMOPEN_P_LOG, snd_strerror(err), stream == SND_PCM_STREAM_CAPTURE ? tech_pvt->alsacname : tech_pvt->alsapname); - return NULL; - } - - snd_pcm_info_alloca(&info); - - if ((err = snd_pcm_info(handle, info)) < 0) { - ERRORA("info error: %s", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - - err = snd_pcm_nonblock(handle, 1); - if (err < 0) { - ERRORA("nonblock setting error: %s", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - - err = snd_pcm_hw_params_any(handle, params); - if (err < 0) { - ERRORA("Broken configuration for this PCM, no configurations available: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - - err = snd_pcm_hw_params_set_access(handle, params, SND_PCM_ACCESS_RW_INTERLEAVED); - if (err < 0) { - ERRORA("Access type not available: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - err = snd_pcm_hw_params_set_format(handle, params, gsmopen_format); - if (err < 0) { - ERRORA("Sample format non available: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - err = snd_pcm_hw_params_set_channels(handle, params, 1); - if (err < 0) { - DEBUGA_GSMOPEN("Channels count set failed: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - } -#if 1 - err = snd_pcm_hw_params_get_channels(params, &chan_num); - if (err < 0) { - ERRORA("Channels count non available: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - if (chan_num < 1 || chan_num > 2) { - ERRORA("Channels count MUST BE 1 or 2, it is: %d\n", GSMOPEN_P_LOG, chan_num); - ERRORA("Channels count MUST BE 1 or 2, it is: %d on %s %s\n", GSMOPEN_P_LOG, chan_num, tech_pvt->alsapname, tech_pvt->alsacname); - return NULL; - } else { - if (chan_num == 1) { - if (stream == SND_PCM_STREAM_CAPTURE) - tech_pvt->alsa_capture_is_mono = 1; - else - tech_pvt->alsa_play_is_mono = 1; - } else { - if (stream == SND_PCM_STREAM_CAPTURE) - tech_pvt->alsa_capture_is_mono = 0; - else - tech_pvt->alsa_play_is_mono = 0; - } - } -#else - tech_pvt->alsa_capture_is_mono = 1; - tech_pvt->alsa_play_is_mono = 1; -#endif - -#if 1 - rate = tech_pvt->gsmopen_sound_rate; - err = snd_pcm_hw_params_set_rate_near(handle, params, &rate, 0); - if ((float) tech_pvt->gsmopen_sound_rate * 1.05 < rate || (float) tech_pvt->gsmopen_sound_rate * 0.95 > rate) { - WARNINGA("Rate is not accurate (requested = %iHz, got = %iHz)\n", GSMOPEN_P_LOG, tech_pvt->gsmopen_sound_rate, rate); - } - - if (err < 0) { - ERRORA("Error setting rate: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - tech_pvt->gsmopen_sound_rate = rate; - - err = snd_pcm_hw_params_set_period_size_near(handle, params, &period_size, 0); - - if (err < 0) { - ERRORA("Error setting period_size: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - - tech_pvt->alsa_period_size = period_size; - - tech_pvt->alsa_buffer_size = tech_pvt->alsa_period_size * tech_pvt->alsa_periods_in_buffer; - - err = snd_pcm_hw_params_set_buffer_size_near(handle, params, &tech_pvt->alsa_buffer_size); - - if (err < 0) { - ERRORA("Error setting buffer_size: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } -#endif - - err = snd_pcm_hw_params(handle, params); - if (err < 0) { - ERRORA("Unable to install hw params: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - - snd_pcm_hw_params_get_period_size(params, &chunk_size, 0); - snd_pcm_hw_params_get_buffer_size(params, &buffer_size); - if (chunk_size == buffer_size) { - ERRORA("Can't use period equal to buffer size (%lu == %lu)\n", GSMOPEN_P_LOG, chunk_size, buffer_size); - return NULL; - } - - snd_pcm_sw_params_current(handle, swparams); - - /* - if (sleep_min) - xfer_align = 1; - err = snd_pcm_sw_params_set_sleep_min(handle, swparams, - 0); - - if (err < 0) { - ERRORA("Error setting slep_min: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - } - */ - n = chunk_size; - err = snd_pcm_sw_params_set_avail_min(handle, swparams, n); - if (err < 0) { - ERRORA("Error setting avail_min: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - } - if (stream == SND_PCM_STREAM_CAPTURE) { - start_delay = 1; - } - if (start_delay <= 0) { - start_threshold = n + (snd_pcm_uframes_t) rate *start_delay / 1000000; - } else { - start_threshold = (snd_pcm_uframes_t) rate *start_delay / 1000000; - } - if (start_threshold < 1) - start_threshold = 1; - if (start_threshold > n) - start_threshold = n; - err = snd_pcm_sw_params_set_start_threshold(handle, swparams, start_threshold); - if (err < 0) { - ERRORA("Error setting start_threshold: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - } - - if (stop_delay <= 0) - stop_threshold = buffer_size + (snd_pcm_uframes_t) rate *stop_delay / 1000000; - else - stop_threshold = (snd_pcm_uframes_t) rate *stop_delay / 1000000; - - if (stream == SND_PCM_STREAM_CAPTURE) { - stop_threshold = -1; - } - - err = snd_pcm_sw_params_set_stop_threshold(handle, swparams, stop_threshold); - - if (err < 0) { - ERRORA("Error setting stop_threshold: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - } - - if (snd_pcm_sw_params(handle, swparams) < 0) { - ERRORA("Error installing software parameters: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - } - - err = snd_pcm_poll_descriptors_count(handle); - if (err <= 0) { - ERRORA("Unable to get a poll descriptors count, error is %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - - if (err != 1) { //number of poll descriptors - DEBUGA_GSMOPEN("Can't handle more than one device\n", GSMOPEN_P_LOG); - return NULL; - } - - err = snd_pcm_poll_descriptors(handle, &tech_pvt->pfd, err); - if (err != 1) { - ERRORA("snd_pcm_poll_descriptors failed, %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - DEBUGA_GSMOPEN("Acquired fd %d from the poll descriptor\n", GSMOPEN_P_LOG, tech_pvt->pfd.fd); - - if (stream == SND_PCM_STREAM_CAPTURE) { - tech_pvt->gsmopen_sound_capt_fd = tech_pvt->pfd.fd; - } - - state = snd_pcm_state(handle); - - if (state != SND_PCM_STATE_RUNNING) { - if (state != SND_PCM_STATE_PREPARED) { - err = snd_pcm_prepare(handle); - if (err) { - ERRORA("snd_pcm_prepare failed, %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - DEBUGA_GSMOPEN("prepared!\n", GSMOPEN_P_LOG); - } - if (stream == SND_PCM_STREAM_CAPTURE) { - err = snd_pcm_start(handle); - if (err) { - ERRORA("snd_pcm_start failed, %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - return NULL; - } - DEBUGA_GSMOPEN("started!\n", GSMOPEN_P_LOG); - } - } - if (option_debug > 1) { - snd_output_t *output = NULL; - err = snd_output_stdio_attach(&output, stdout, 0); - if (err < 0) { - ERRORA("snd_output_stdio_attach failed: %s\n", GSMOPEN_P_LOG, snd_strerror(err)); - } - snd_pcm_dump(handle, output); - -#ifndef NO_GSMLIB - SMSMessageRef sms; - char content2[1000]; - //sms = SMSMessage::decode("079194710167120004038571F1390099406180904480A0D41631067296EF7390383D07CD622E58CD95CB81D6EF39BDEC66BFE7207A794E2FBB4320AFB82C07E56020A8FC7D9687DBED32285C9F83A06F769A9E5EB340D7B49C3E1FA3C3663A0B24E4CBE76516680A7FCBE920725A5E5ED341F0B21C346D4E41E1BA790E4286DDE4BC0BD42CA3E5207258EE1797E5A0BA9B5E9683C86539685997EBEF61341B249BC966"); // dataCodingScheme = 0 - //sms = SMSMessage::decode("0791934329002000040C9193432766658100009001211133318004D4F29C0E"); // dataCodingScheme = 0 - //sms = SMSMessage::decode("0791934329002000040C919343276665810008900121612521801600CC00E800E900F900F200E00020006300690061006F"); // dataCodingScheme = 8 - sms = SMSMessage::decode("0791934329002000040C919343276665810008900172002293404C006300690061006F0020003100320033002000620065006C00E80020043D043E0432043E044104420438002005DC05E7002005E805D005EA0020FE8EFEE0FEA0FEE4FECBFE9300204EBA5927"); // dataCodingScheme = 8 , text=ciao 123 belè новости לק ראת ﺎﻠﺠﻤﻋﺓ 人大 - //sms = SMSMessage::decode("07911497941902F00414D0E474989D769F5DE4320839001040122151820000"); // dataCodingScheme = 0 - //NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str()); - - memset(content2, '\0', sizeof(content2)); - if (sms->dataCodingScheme().getAlphabet() == DCS_DEFAULT_ALPHABET) { - iso_8859_1_to_utf8(tech_pvt, (char *) sms->userData().c_str(), content2, sizeof(content2)); - } else if (sms->dataCodingScheme().getAlphabet() == DCS_SIXTEEN_BIT_ALPHABET) { - ucs2_to_utf8(tech_pvt, (char *) bufToHex((unsigned char *) sms->userData().data(), sms->userData().length()).c_str(), content2, - sizeof(content2)); - } else { - ERRORA("dataCodingScheme not supported=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); - - } - //NOTICA("dataCodingScheme=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); - //NOTICA("userData= |||%s|||\n", GSMOPEN_P_LOG, content2); -#endif// NO_GSMLIB - - } - if (option_debug > 1) - DEBUGA_GSMOPEN("ALSA handle = %ld\n", GSMOPEN_P_LOG, (long int) handle); - return handle; - -} - -/*! \brief Write audio frames to interface */ -#endif /* GSMOPEN_ALSA */ - -int gsmopen_call(private_t * tech_pvt, char *rdest, int timeout) -{ - - //gsmopen_sleep(5000); - DEBUGA_GSMOPEN("Calling GSM, rdest is: %s\n", GSMOPEN_P_LOG, rdest); - //gsmopen_signaling_write(tech_pvt, "SET AGC OFF"); - //gsmopen_sleep(10000); - //gsmopen_signaling_write(tech_pvt, "SET AEC OFF"); - //gsmopen_sleep(10000); - - gsmopen_serial_call(tech_pvt, rdest); - //ERRORA("failed to communicate with GSM client, now exit\n", GSMOPEN_P_LOG); - //return -1; - //} - return 0; -} - - -int gsmopen_senddigit(private_t * tech_pvt, char digit) -{ - - DEBUGA_GSMOPEN("DIGIT received: %c\n", GSMOPEN_P_LOG, digit); - if (tech_pvt->controldevprotocol == PROTOCOL_AT && tech_pvt->at_send_dtmf[0]) { - int res = 0; - char at_command[256]; - - memset(at_command, '\0', 256); - sprintf(at_command, "%s=\"%c\"", tech_pvt->at_send_dtmf, digit); - res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); - if (res) { - ERRORA("senddigit command failed, command used: '%s=\"%c\"', giving up\n", GSMOPEN_P_LOG, tech_pvt->at_send_dtmf, digit); - } - } - - return 0; -} - -#ifdef GSMOPEN_ALSA -/*! \brief Write audio frames to interface */ -int alsa_write(private_t * tech_pvt, short *data, int datalen) -{ - static char sizbuf[8000]; - static char sizbuf2[16000]; - static char silencebuf[8000]; - static int sizpos = 0; - int len = sizpos; - //int pos; - int res = 0; - time_t now_timestamp; - /* size_t frames = 0; */ - snd_pcm_state_t state; - snd_pcm_sframes_t delayp1=0; - snd_pcm_sframes_t delayp2=0; - - if(tech_pvt->no_sound==1){ - return res; - } - - - memset(sizbuf, 255, sizeof(sizbuf)); - memset(sizbuf2, 255, sizeof(sizbuf)); - memset(silencebuf, 255, sizeof(sizbuf)); - - //ERRORA("data=%p, datalen=%d\n", GSMOPEN_P_LOG, (void *)data, datalen); - /* We have to digest the frame in 160-byte portions */ - if (datalen > sizeof(sizbuf) - sizpos) { - ERRORA("Frame too large\n", GSMOPEN_P_LOG); - res = -1; - } else { - memcpy(sizbuf + sizpos, data, datalen); - memset(data, 255, datalen); - len += datalen; - //pos = 0; - - -#ifdef ALSA_MONITOR - alsa_monitor_write(sizbuf, len); -#endif - state = snd_pcm_state(tech_pvt->alsap); - if (state == SND_PCM_STATE_XRUN) { - int i; - - DEBUGA_GSMOPEN - ("You've got an ALSA write XRUN in the past (gsmopen can't fill the soundcard buffer fast enough). If this happens often (not after silence or after a pause in the speech, that's OK), and appear to damage the sound quality, first check if you have some IRQ problem, maybe sharing the soundcard IRQ with a broken or heavy loaded ethernet or graphic card. Then consider to increase the alsa_periods_in_buffer (now is set to %d) for this interface in the config file\n", - GSMOPEN_P_LOG, tech_pvt->alsa_periods_in_buffer); - res = snd_pcm_prepare(tech_pvt->alsap); - if (res) { - ERRORA("audio play prepare failed: %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - } else { - res = snd_pcm_format_set_silence(gsmopen_format, silencebuf, len / 2); - if (res < 0) { - DEBUGA_GSMOPEN("Silence error %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - res = -1; - } - for (i = 0; i < (tech_pvt->alsa_periods_in_buffer - 1); i++) { - res = snd_pcm_writei(tech_pvt->alsap, silencebuf, len / 2); - if (res != len / 2) { - DEBUGA_GSMOPEN("Write returned a different quantity: %d\n", GSMOPEN_P_LOG, res); - res = -1; - } else if (res < 0) { - DEBUGA_GSMOPEN("Write error %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - res = -1; - } - } - } - - } - - res = snd_pcm_delay(tech_pvt->alsap, &delayp1); - if (res < 0) { - DEBUGA_GSMOPEN("Error %d on snd_pcm_delay: \"%s\"\n", GSMOPEN_P_LOG, res, snd_strerror(res)); - res = snd_pcm_prepare(tech_pvt->alsap); - if (res) { - DEBUGA_GSMOPEN("snd_pcm_prepare failed: '%s'\n", GSMOPEN_P_LOG, snd_strerror(res)); - } - res = snd_pcm_delay(tech_pvt->alsap, &delayp1); - } - - delayp2 = snd_pcm_avail_update(tech_pvt->alsap); - if (delayp2 < 0) { - DEBUGA_GSMOPEN("Error %d on snd_pcm_avail_update: \"%s\"\n", GSMOPEN_P_LOG, (int) delayp2, snd_strerror(delayp2)); - - res = snd_pcm_prepare(tech_pvt->alsap); - if (res) { - DEBUGA_GSMOPEN("snd_pcm_prepare failed: '%s'\n", GSMOPEN_P_LOG, snd_strerror(res)); - } - delayp2 = snd_pcm_avail_update(tech_pvt->alsap); - } - - if ( /* delayp1 != 0 && delayp1 != 160 */ - delayp1 < 160 || delayp2 > tech_pvt->alsa_buffer_size) { - - res = snd_pcm_prepare(tech_pvt->alsap); - if (res) { - DEBUGA_GSMOPEN - ("snd_pcm_prepare failed while trying to prevent an ALSA write XRUN: %s, delayp1=%d, delayp2=%d\n", - GSMOPEN_P_LOG, snd_strerror(res), (int) delayp1, (int) delayp2); - } else { - - int i; - for (i = 0; i < (tech_pvt->alsa_periods_in_buffer - 1); i++) { - res = snd_pcm_format_set_silence(gsmopen_format, silencebuf, len / 2); - if (res < 0) { - DEBUGA_GSMOPEN("Silence error %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - res = -1; - } - res = snd_pcm_writei(tech_pvt->alsap, silencebuf, len / 2); - if (res < 0) { - DEBUGA_GSMOPEN("Write error %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - res = -1; - } else if (res != len / 2) { - DEBUGA_GSMOPEN("Write returned a different quantity: %d\n", GSMOPEN_P_LOG, res); - res = -1; - } - } - - DEBUGA_GSMOPEN - ("PREVENTING an ALSA write XRUN (gsmopen can't fill the soundcard buffer fast enough). If this happens often (not after silence or after a pause in the speech, that's OK), and appear to damage the sound quality, first check if you have some IRQ problem, maybe sharing the soundcard IRQ with a broken or heavy loaded ethernet or graphic card. Then consider to increase the alsa_periods_in_buffer (now is set to %d) for this interface in the config file. delayp1=%d, delayp2=%d\n", - GSMOPEN_P_LOG, tech_pvt->alsa_periods_in_buffer, (int) delayp1, (int) delayp2); - } - - } - - memset(sizbuf2, 0, sizeof(sizbuf2)); - if (tech_pvt->alsa_play_is_mono) { - res = snd_pcm_writei(tech_pvt->alsap, sizbuf, len / 2); - } else { - int a = 0; - int i = 0; - for (i = 0; i < 8000;) { - sizbuf2[a] = sizbuf[i]; - a++; - i++; - sizbuf2[a] = sizbuf[i]; - a++; - i--; - sizbuf2[a] = sizbuf[i]; // comment out this line to use only left - a++; - i++; - sizbuf2[a] = sizbuf[i]; // comment out this line to use only left - a++; - i++; - } - res = snd_pcm_writei(tech_pvt->alsap, sizbuf2, len); - } - if (res == -EPIPE) { - DEBUGA_GSMOPEN - ("ALSA write EPIPE (XRUN) (gsmopen can't fill the soundcard buffer fast enough). If this happens often (not after silence or after a pause in the speech, that's OK), and appear to damage the sound quality, first check if you have some IRQ problem, maybe sharing the soundcard IRQ with a broken or heavy loaded ethernet or graphic card. Then consider to increase the alsa_periods_in_buffer (now is set to %d) for this interface in the config file. delayp1=%d, delayp2=%d\n", - GSMOPEN_P_LOG, tech_pvt->alsa_periods_in_buffer, (int) delayp1, (int) delayp2); - res = snd_pcm_prepare(tech_pvt->alsap); - if (res) { - ERRORA("audio play prepare failed: %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - } else { - - if (tech_pvt->alsa_play_is_mono) { - res = snd_pcm_writei(tech_pvt->alsap, sizbuf, len / 2); - } else { - int a = 0; - int i = 0; - for (i = 0; i < 8000;) { - sizbuf2[a] = sizbuf[i]; - a++; - i++; - sizbuf2[a] = sizbuf[i]; - a++; - i--; - sizbuf2[a] = sizbuf[i]; - a++; - i++; - sizbuf2[a] = sizbuf[i]; - a++; - i++; - } - res = snd_pcm_writei(tech_pvt->alsap, sizbuf2, len); - } - - } - - } else { - if (res == -ESTRPIPE) { - ERRORA("You've got some big problems\n", GSMOPEN_P_LOG); - } else if (res == -EAGAIN) { - DEBUGA_GSMOPEN("Momentarily busy\n", GSMOPEN_P_LOG); - res = 0; - } else if (res < 0) { - ERRORA("Error %d on audio write: \"%s\"\n", GSMOPEN_P_LOG, res, snd_strerror(res)); - } - } - } - - if (tech_pvt->audio_play_reset_period) { - time(&now_timestamp); - if ((now_timestamp - tech_pvt->audio_play_reset_timestamp) > tech_pvt->audio_play_reset_period) { - if (option_debug) - DEBUGA_GSMOPEN("reset audio play\n", GSMOPEN_P_LOG); - res = snd_pcm_wait(tech_pvt->alsap, 1000); - if (res < 0) { - ERRORA("audio play wait failed: %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - } - res = snd_pcm_drop(tech_pvt->alsap); - if (res) { - ERRORA("audio play drop failed: %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - } - res = snd_pcm_prepare(tech_pvt->alsap); - if (res) { - ERRORA("audio play prepare failed: %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - } - res = snd_pcm_wait(tech_pvt->alsap, 1000); - if (res < 0) { - ERRORA("audio play wait failed: %s\n", GSMOPEN_P_LOG, snd_strerror(res)); - } - time(&tech_pvt->audio_play_reset_timestamp); - } - } - //res = 0; - //if (res > 0) - //res = 0; - return res; -} - -#define AST_FRIENDLY_OFFSET 0 -int alsa_read(private_t * tech_pvt, short *data, int datalen) -{ - //static struct ast_frame f; - static short __buf[GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2]; - static short __buf2[(GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2]; - short *buf; - short *buf2; - static int readpos = 0; - //static int left = GSMOPEN_FRAME_SIZE; - static int left; - snd_pcm_state_t state; - int r = 0; - int off = 0; - int error = 0; - //time_t now_timestamp; - - //DEBUGA_GSMOPEN("buf=%p, datalen=%d, left=%d\n", GSMOPEN_P_LOG, (void *)buf, datalen, left); - //memset(&f, 0, sizeof(struct ast_frame)); //giova - - - - if(tech_pvt->no_sound==1){ - return r; - } - - left = datalen; - - - state = snd_pcm_state(tech_pvt->alsac); - if (state != SND_PCM_STATE_RUNNING) { - DEBUGA_GSMOPEN("ALSA read state is not SND_PCM_STATE_RUNNING\n", GSMOPEN_P_LOG); - - if (state != SND_PCM_STATE_PREPARED) { - error = snd_pcm_prepare(tech_pvt->alsac); - if (error) { - ERRORA("snd_pcm_prepare failed, %s\n", GSMOPEN_P_LOG, snd_strerror(error)); - return r; - } - DEBUGA_GSMOPEN("prepared!\n", GSMOPEN_P_LOG); - } - gsmopen_sleep(1000); - error = snd_pcm_start(tech_pvt->alsac); - if (error) { - ERRORA("snd_pcm_start failed, %s\n", GSMOPEN_P_LOG, snd_strerror(error)); - return r; - } - DEBUGA_GSMOPEN("started!\n", GSMOPEN_P_LOG); - gsmopen_sleep(1000); - } - - buf = __buf + AST_FRIENDLY_OFFSET / 2; - buf2 = __buf2 + ((AST_FRIENDLY_OFFSET / 2) * 2); - - if (tech_pvt->alsa_capture_is_mono) { - r = snd_pcm_readi(tech_pvt->alsac, buf + readpos, left); - //DEBUGA_GSMOPEN("r=%d, buf=%p, buf+readpos=%p, datalen=%d, left=%d\n", GSMOPEN_P_LOG, r, (void *)buf, (void *)(buf + readpos), datalen, left); - } else { - int a = 0; - int i = 0; - r = snd_pcm_readi(tech_pvt->alsac, buf2 + (readpos * 2), left); - - for (i = 0; i < (GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2;) { - __buf[a] = (__buf2[i] + __buf2[i + 1]) / 2; //comment out this line to use only left - //__buf[a] = __buf2[i]; // enable this line to use only left - a++; - i++; - i++; - } - } - - if (r == -EPIPE) { - DEBUGA_GSMOPEN("ALSA XRUN on read\n", GSMOPEN_P_LOG); - return r; - } else if (r == -ESTRPIPE) { - ERRORA("-ESTRPIPE\n", GSMOPEN_P_LOG); - return r; - - } else if (r == -EAGAIN) { - int count=0; - while (r == -EAGAIN) { - gsmopen_sleep(10000); - DEBUGA_GSMOPEN("%d ALSA read -EAGAIN, the soundcard is not ready to be read by gsmopen\n", GSMOPEN_P_LOG, count); - count++; - - if (tech_pvt->alsa_capture_is_mono) { - r = snd_pcm_readi(tech_pvt->alsac, buf + readpos, left); - } else { - int a = 0; - int i = 0; - r = snd_pcm_readi(tech_pvt->alsac, buf2 + (readpos * 2), left); - - for (i = 0; i < (GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2;) { - __buf[a] = (__buf2[i] + __buf2[i + 1]) / 2; - a++; - i++; - i++; - } - } - - } - } else if (r < 0) { - WARNINGA("ALSA Read error: %s\n", GSMOPEN_P_LOG, snd_strerror(r)); - } else if (r >= 0) { - //DEBUGA_GSMOPEN("read: r=%d, readpos=%d, left=%d, off=%d\n", GSMOPEN_P_LOG, r, readpos, left, off); - off -= r; //what is the meaning of this? a leftover, probably - } - /* Update positions */ - readpos += r; - left -= r; - - if (readpos >= GSMOPEN_FRAME_SIZE) { - int i; - /* A real frame */ - readpos = 0; - left = GSMOPEN_FRAME_SIZE; - for (i = 0; i < r; i++) - data[i] = buf[i]; - - } - return r; -} - -#endif // GSMOPEN_ALSA - - - - - -int gsmopen_sendsms(private_t * tech_pvt, char *dest, char *text) -{ - //char *idest = data; - //char rdest[256]; - //private_t *p = NULL; - //char *device; - //char *dest; - //char *text; - //char *stringp = NULL; - //int found = 0; - int failed = 0; - int err = 0; - - //strncpy(rdest, idest, sizeof(rdest) - 1); - DEBUGA_GSMOPEN("GSMopenSendsms: dest=%s text=%s\n", GSMOPEN_P_LOG, dest, text); - DEBUGA_GSMOPEN("START\n", GSMOPEN_P_LOG); - /* we can use gsmopen_request to get the channel, but gsmopen_request would look for onowned channels, and probably we can send SMSs while a call is ongoing - * - */ - - if (tech_pvt->controldevprotocol != PROTOCOL_AT) { - ERRORA(", GSMOPEN_P_LOGGSMopenSendsms supports only AT command cellphones at the moment :-( !\n", GSMOPEN_P_LOG); - return RESULT_FAILURE; - } - - if (tech_pvt->controldevprotocol == PROTOCOL_AT) { - char smscommand[16000]; - memset(smscommand, '\0', sizeof(smscommand)); - - PUSHA_UNLOCKA(&tech_pvt->controldev_lock); - LOKKA(tech_pvt->controldev_lock); - - err = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=1"); - if (err) { - ERRORA("AT+CMGF=1 (set message sending to TEXT (as opposed to PDU) do not got OK from the phone\n", GSMOPEN_P_LOG); - } - - - if (tech_pvt->no_ucs2) { - sprintf(smscommand, "AT+CMGS=\"%s\"", dest); //TODO: support phones that only accept pdu mode - } else { - char dest2[1048]; - - err = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"UCS2\""); - if (err) { - ERRORA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone\n", GSMOPEN_P_LOG); - } - - memset(dest2, '\0', sizeof(dest2)); - utf_to_ucs2(tech_pvt, dest, strlen(dest), dest2, sizeof(dest2)); - sprintf(smscommand, "AT+CMGS=\"%s\"", dest2); //TODO: support phones that only accept pdu mode - } - //TODO: support phones that only accept pdu mode - //TODO would be better to lock controldev here - //sprintf(smscommand, "AT+CMGS=\"%s\"", dest); //FIXME: nokia e63 want this - err = gsmopen_serial_write_AT_noack(tech_pvt, smscommand); - if (err) { - ERRORA("Error sending SMS\n", GSMOPEN_P_LOG); - failed = 1; - goto uscita; - } - err = gsmopen_serial_AT_expect(tech_pvt, "> ", 0, 1); // wait 1.5s for the prompt, no crlf -#if 1 - if (err) { - DEBUGA_GSMOPEN - ("Error or timeout getting prompt '> ' for sending sms directly to the remote party. BTW, seems that we cannot do that with Motorola c350, so we'll write to cellphone memory, then send from memory\n", - GSMOPEN_P_LOG); - - err = gsmopen_serial_write_AT_ack(tech_pvt, "ATE1"); //motorola (at least c350) do not echo the '>' prompt when in ATE0... go figure!!!! - if (err) { - ERRORA("Error activating echo from modem\n", GSMOPEN_P_LOG); - } - tech_pvt->at_cmgw[0] = '\0'; - sprintf(smscommand, "AT+CMGW=\"%s\"", dest); //TODO: support phones that only accept pdu mode - err = gsmopen_serial_write_AT_noack(tech_pvt, smscommand); - if (err) { - ERRORA("Error writing SMS destination to the cellphone memory\n", GSMOPEN_P_LOG); - failed = 1; - goto uscita; - } - err = gsmopen_serial_AT_expect(tech_pvt, "> ", 0, 1); // wait 1.5s for the prompt, no crlf - if (err) { - ERRORA("Error or timeout getting prompt '> ' for writing sms text in cellphone memory\n", GSMOPEN_P_LOG); - failed = 1; - goto uscita; - } - } -#endif - - //sprintf(text,"ciao 123 belè новости לק ראת ﺎﻠﺠﻤﻋﺓ 人大"); //let's test the beauty of utf - memset(smscommand, '\0', sizeof(smscommand)); - if (tech_pvt->no_ucs2) { - sprintf(smscommand, "%s", text); - } else { - utf_to_ucs2(tech_pvt, text, strlen(text), smscommand, sizeof(smscommand)); - } - - smscommand[strlen(smscommand)] = 0x1A; - DEBUGA_GSMOPEN("smscommand len is: %d, text is:|||%s|||\n", GSMOPEN_P_LOG, (int) strlen(smscommand), smscommand); - - err = gsmopen_serial_write_AT_ack_nocr_longtime(tech_pvt, smscommand); - //TODO would be better to unlock controldev here - if (err) { - ERRORA("Error writing SMS text to the cellphone memory\n", GSMOPEN_P_LOG); - //return RESULT_FAILURE; - failed = 1; - goto uscita; - } - if (tech_pvt->at_cmgw[0]) { - sprintf(smscommand, "AT+CMSS=%s", tech_pvt->at_cmgw); - err = gsmopen_serial_write_AT_expect_longtime(tech_pvt, smscommand, "OK"); - if (err) { - ERRORA("Error sending SMS from the cellphone memory\n", GSMOPEN_P_LOG); - //return RESULT_FAILURE; - failed = 1; - goto uscita; - } - - err = gsmopen_serial_write_AT_ack(tech_pvt, "ATE0"); //motorola (at least c350) do not echo the '>' prompt when in ATE0... go figure!!!! - if (err) { - ERRORA("Error de-activating echo from modem\n", GSMOPEN_P_LOG); - } - } - uscita: - gsmopen_sleep(1000); - - if (tech_pvt->at_cmgw[0]) { - - /* let's see what we've sent, just for check TODO: Motorola it's not reliable! Motorola c350 tells that all was sent, but is not true! It just sends how much it fits into one SMS FIXME: need an algorithm to calculate how many ucs2 chars fits into an SMS. It make difference based, probably, on the GSM alphabet translation, or so */ - sprintf(smscommand, "AT+CMGR=%s", tech_pvt->at_cmgw); - err = gsmopen_serial_write_AT_ack(tech_pvt, smscommand); - if (err) { - ERRORA("Error reading SMS back from the cellphone memory\n", GSMOPEN_P_LOG); - } - - /* let's delete from cellphone memory what we've sent */ - sprintf(smscommand, "AT+CMGD=%s", tech_pvt->at_cmgw); - err = gsmopen_serial_write_AT_ack(tech_pvt, smscommand); - if (err) { - ERRORA("Error deleting SMS from the cellphone memory\n", GSMOPEN_P_LOG); - } - - tech_pvt->at_cmgw[0] = '\0'; - } - //gsmopen_sleep(500000); //.5 secs - UNLOCKA(tech_pvt->controldev_lock); - POPPA_UNLOCKA(&tech_pvt->controldev_lock); - } - - err = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=0"); - if (err) { - DEBUGA_GSMOPEN("AT+CMGF=0 (set message sending to PDU (as opposed to TEXT) do not got OK from the phone, continuing\n", GSMOPEN_P_LOG); - } - - - DEBUGA_GSMOPEN("FINISH\n", GSMOPEN_P_LOG); - if (failed) - return -1; - else - return RESULT_SUCCESS; -} - -/************************************************/ - -/* LUIGI RIZZO's magic */ -/* boost support. BOOST_SCALE * 10 ^(BOOST_MAX/20) must - * be representable in 16 bits to avoid overflows. - */ -#define BOOST_SCALE (1<<9) -#define BOOST_MAX 40 /* slightly less than 7 bits */ - -/* - * store the boost factor - */ -void gsmopen_store_boost(char *s, double *boost) -{ - private_t *tech_pvt = NULL; - - if (sscanf(s, "%lf", boost) != 1) { - ERRORA("invalid boost <%s>\n", GSMOPEN_P_LOG, s); - return; - } - if (*boost < -BOOST_MAX) { - WARNINGA("boost %s too small, using %d\n", GSMOPEN_P_LOG, s, -BOOST_MAX); - *boost = -BOOST_MAX; - } else if (*boost > BOOST_MAX) { - WARNINGA("boost %s too large, using %d\n", GSMOPEN_P_LOG, s, BOOST_MAX); - *boost = BOOST_MAX; - } -#ifdef WIN32 - *boost = exp(log ((double)10) * *boost / 20) * BOOST_SCALE; -#else - *boost = exp(log(10) * *boost / 20) * BOOST_SCALE; -#endif //WIN32 - if (option_debug > 1) - DEBUGA_GSMOPEN("setting boost %s to %f\n", GSMOPEN_P_LOG, s, *boost); -} - - -int gsmopen_sound_boost(void *data, int samples_num, double boost) -{ -/* LUIGI RIZZO's magic */ - if (boost != 0 && (boost < 511 || boost > 513)) { /* scale and clip values */ - int i, x; - - int16_t *ptr = (int16_t *) data; - - for (i = 0; i < samples_num; i++) { - x = (int) (ptr[i] * boost) / BOOST_SCALE; - if (x > 32767) { - x = 32767; - } else if (x < -32768) { - x = -32768; - } - ptr[i] = x; - } - } else { - //printf("BOOST=%f\n", boost); - } - - return 0; -} - - -int gsmopen_serial_getstatus_AT(private_t * tech_pvt) -{ - int res; - private_t *p = tech_pvt; - -#if 0 - if (p->owner) { - if (p->owner->_state != AST_STATE_UP && p->owner->_state != AST_STATE_DOWN) { - DEBUGA_AT("No getstatus, we're neither UP nor DOWN\n", GSMOPEN_P_LOG); - return 0; - } - } -#endif - - - PUSHA_UNLOCKA(p->controldev_lock); - LOKKA(p->controldev_lock); - res = gsmopen_serial_write_AT_ack(p, "AT"); - if (res) { - ERRORA("AT was not acknowledged, continuing but maybe there is a problem\n", GSMOPEN_P_LOG); - } - gsmopen_sleep(1000); - - if (strlen(p->at_query_battchg)) { - res = gsmopen_serial_write_AT_expect(p, p->at_query_battchg, p->at_query_battchg_expect); - if (res) { - WARNINGA("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, p->at_query_battchg, p->at_query_battchg_expect); - } - gsmopen_sleep(1000); - } - - if (strlen(p->at_query_signal)) { - res = gsmopen_serial_write_AT_expect(p, p->at_query_signal, p->at_query_signal_expect); - if (res) { - WARNINGA("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, p->at_query_signal, p->at_query_signal_expect); - } - gsmopen_sleep(1000); - } - - if (!p->network_creg_not_supported) { - res = gsmopen_serial_write_AT_ack(p, "AT+CREG?"); - if (res) { - WARNINGA("%s does not get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, "AT+CREG?", "OK"); - } - gsmopen_sleep(1000); - } - - //FIXME all the following commands in config! - - if (p->sms_cnmi_not_supported) { - res = gsmopen_serial_write_AT_ack(p, "AT+MMGL=\"HEADER ONLY\""); - if (res) { - WARNINGA - ("%s does not get %s from the phone. If your phone is not Motorola, please contact the gsmopen developers. Else, if your phone IS a Motorola, probably a long msg was incoming and ther first part was read and then deleted. The second part is now orphan. If you got this warning repeatedly, and you cannot correctly receive SMSs from this interface, please manually clean all messages (and the residual parts of them) from the cellphone/SIM. Continuing.\n", - GSMOPEN_P_LOG, "AT+MMGL=\"HEADER ONLY\"", "OK"); - } else { - gsmopen_sleep(1000); - if (p->unread_sms_msg_id) { - char at_command[256]; - - res = gsmopen_serial_write_AT_ack(p, "AT+CSCS=\"UCS2\""); - if (res) { - ERRORA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone\n", GSMOPEN_P_LOG); - memset(p->sms_message, 0, sizeof(p->sms_message)); - } - - memset(at_command, 0, sizeof(at_command)); - sprintf(at_command, "AT+CMGR=%d", p->unread_sms_msg_id); - memset(p->sms_message, 0, sizeof(p->sms_message)); - - p->reading_sms_msg = 1; - res = gsmopen_serial_write_AT_ack(p, at_command); - p->reading_sms_msg = 0; - if (res) { - ERRORA("AT+CMGR (read SMS) do not got OK from the phone, message sent was:|||%s|||\n", GSMOPEN_P_LOG, at_command); - } - res = gsmopen_serial_write_AT_ack(p, "AT+CSCS=\"GSM\""); - if (res) { - ERRORA("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n", GSMOPEN_P_LOG); - } - memset(at_command, 0, sizeof(at_command)); - sprintf(at_command, "AT+CMGD=%d", p->unread_sms_msg_id); /* delete the message */ - p->unread_sms_msg_id = 0; - res = gsmopen_serial_write_AT_ack(p, at_command); - if (res) { - ERRORA("AT+CMGD (Delete SMS) do not got OK from the phone, message sent was:|||%s|||\n", GSMOPEN_P_LOG, at_command); - } - - if (strlen(p->sms_message)) { -#if 0 - - manager_event(EVENT_FLAG_SYSTEM, "GSMOPENincomingsms", "Interface: %s\r\nSMS_Message: %s\r\n", p->name, p->sms_message); - - if (strlen(p->sms_receiving_program)) { - int fd1[2]; - pid_t pid1; - char *arg1[] = { p->sms_receiving_program, (char *) NULL }; - int i; - - DEBUGA_AT("incoming SMS message:---%s---\n", GSMOPEN_P_LOG, p->sms_message); - pipe(fd1); - pid1 = fork(); - - if (pid1 == 0) { //child - int err; - - dup2(fd1[0], 0); // Connect stdin to pipe output - close(fd1[1]); // close input pipe side - setsid(); //session id - err = execvp(arg1[0], arg1); //exec our program, with stdin connected to pipe output - if (err) { - ERRORA - ("'sms_receiving_program' is set in config file to '%s', and it gave us back this error: %d, (%s). SMS received was:---%s---\n", - GSMOPEN_P_LOG, p->sms_receiving_program, err, strerror(errno), p->sms_message); - } - close(fd1[0]); // close output pipe side - } //starting here continue the parent - close(fd1[0]); // close output pipe side - // write the msg on the pipe input - for (i = 0; i < strlen(p->sms_message); i++) { - write(fd1[1], &p->sms_message[i], 1); - } - close(fd1[1]); // close pipe input, let our program know we've finished - } else { - ERRORA - ("got SMS incoming message, but 'sms_receiving_program' is not set in config file. SMS received was:---%s---\n", - GSMOPEN_P_LOG, p->sms_message); - } -#endif //0 - DEBUGA_GSMOPEN("got SMS incoming message. SMS received was:---%s---\n", GSMOPEN_P_LOG, p->sms_message); - } -#if 0 //is this one needed? maybe it can interrupt an incoming call that is just to announce itself - if (p->phone_callflow == CALLFLOW_CALL_IDLE && p->interface_state == AST_STATE_DOWN && p->owner == NULL) { - /* we're not in a call, neither calling */ - res = gsmopen_serial_write_AT_ack(p, "AT+CKPD=\"EEE\""); - if (res) { - ERRORA("AT+CKPD=\"EEE\" (cellphone screen back to user) do not got OK from the phone\n", GSMOPEN_P_LOG); - } - } -#endif - } - } - } - - UNLOCKA(p->controldev_lock); - POPPA_UNLOCKA(p->controldev_lock); - return 0; -} diff --git a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/mod_gsmopen.c b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/mod_gsmopen.c deleted file mode 100644 index 16c83fa29c..0000000000 --- a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/mod_gsmopen.c +++ /dev/null @@ -1,3474 +0,0 @@ -/* - * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005/2012, Anthony Minessale II - * - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * - * The Initial Developer of the Original Code is - * Anthony Minessale II - * Portions created by the Initial Developer are Copyright (C) - * the Initial Developer. All Rights Reserved. - * - * This module (mod_gsmopen) has been contributed by: - * - * Giovanni Maruzzelli (gmaruzz@gmail.com) - * - * - * Further Contributors: - * - * - * - * mod_gsmopen.c -- GSM compatible Endpoint Module - * - */ - -#include "gsmopen.h" - -#if 0 -#ifdef WIN32 -/***************/ -// from http://www.openasthra.com/c-tidbits/gettimeofday-function-for-windows/ - -#include - -#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) -#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 -#else /* */ -#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL -#endif /* */ -struct sk_timezone { - int tz_minuteswest; /* minutes W of Greenwich */ - int tz_dsttime; /* type of dst correction */ -}; -int gettimeofday(struct timeval *tv, struct sk_timezone *tz) -{ - FILETIME ft; - unsigned __int64 tmpres = 0; - static int tzflag; - if (NULL != tv) { - GetSystemTimeAsFileTime(&ft); - tmpres |= ft.dwHighDateTime; - tmpres <<= 32; - tmpres |= ft.dwLowDateTime; - - /*converting file time to unix epoch */ - tmpres /= 10; /*convert into microseconds */ - tmpres -= DELTA_EPOCH_IN_MICROSECS; - tv->tv_sec = (long) (tmpres / 1000000UL); - tv->tv_usec = (long) (tmpres % 1000000UL); - } - if (NULL != tz) { - if (!tzflag) { - _tzset(); - tzflag++; - } - tz->tz_minuteswest = _timezone / 60; - tz->tz_dsttime = _daylight; - } - return 0; -} - -/***************/ -#endif /* WIN32 */ -#endif //0 -SWITCH_BEGIN_EXTERN_C -SWITCH_MODULE_LOAD_FUNCTION(mod_gsmopen_load); -SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_gsmopen_shutdown); -SWITCH_MODULE_DEFINITION(mod_gsmopen, mod_gsmopen_load, mod_gsmopen_shutdown, NULL); -SWITCH_END_EXTERN_C -#define GSMOPEN_CHAT_PROTO "sms" -#if 1 -SWITCH_STANDARD_API(gsm_function); -/* BEGIN: Changes here */ -#define GSM_SYNTAX "list [full] || console || AT_command || remove < interface_name | interface_id > || reload" -/* END: Changes heres */ -SWITCH_STANDARD_API(gsmopen_function); -#define GSMOPEN_SYNTAX "interface_name AT_command" -#endif //0 - -SWITCH_STANDARD_API(gsmopen_boost_audio_function); -#define GSMOPEN_BOOST_AUDIO_SYNTAX "interface_name [ ]" -SWITCH_STANDARD_API(sendsms_function); -#define SENDSMS_SYNTAX "gsmopen_sendsms interface_name destination_number SMS_text" -SWITCH_STANDARD_API(gsmopen_dump_function); -#define GSMOPEN_DUMP_SYNTAX "gsmopen_dump " -/* BEGIN: Changes here */ -#define FULL_RELOAD 0 -#define SOFT_RELOAD 1 -/* END: Changes heres */ - -const char *interface_status[] = { /* should match GSMOPEN_STATE_xxx in gsmopen.h */ - "IDLE", - "DOWN", - "RING", - "DIALING", - "BUSY", - "UP", - "RINGING", - "PRERING", - "DOUBLE", - "SELECTD", - "HANG_RQ", - "PREANSW" -}; -const char *phone_callflow[] = { /* should match CALLFLOW_XXX in gsmopen.h */ - "CALL_IDLE", - "CALL_DOWN", - "INCOMING_RNG", - "CALL_DIALING", - "CALL_LINEBUSY", - "CALL_ACTIVE", - "INCOMING_HNG", - "CALL_RLEASD", - "CALL_NOCARR", - "CALL_INFLUX", - "CALL_INCOMING", - "CALL_FAILED", - "CALL_NOSRVC", - "CALL_OUTRESTR", - "CALL_SECFAIL", - "CALL_NOANSWER", - "STATUS_FNSHED", - "STATUS_CANCLED", - "STATUS_FAILED", - "STATUS_REFUSED", - "STATUS_RINGING", - "STATUS_INPROGRS", - "STATUS_UNPLACD", - "STATUS_ROUTING", - "STATUS_EARLYMD", - "INCOMING_CLID", - "STATUS_RMTEHOLD" -}; - - -static struct { - int debug; - char *ip; - int port; - char *dialplan; - char *destination; - char *context; - char *codec_string; - char *codec_order[SWITCH_MAX_CODECS]; - int codec_order_last; - char *codec_rates_string; - char *codec_rates[SWITCH_MAX_CODECS]; - int codec_rates_last; - unsigned int flags; - int fd; - int calls; - int real_interfaces; - int next_interface; - char hold_music[256]; - private_t GSMOPEN_INTERFACES[GSMOPEN_MAX_INTERFACES]; - switch_mutex_t *mutex; - private_t *gsm_console; -} globals; - -switch_endpoint_interface_t *gsmopen_endpoint_interface; -switch_memory_pool_t *gsmopen_module_pool = NULL; -int running = 0; - -SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan); -SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_context, globals.context); -SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_destination, globals.destination); -//SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_string, globals.codec_string); -//SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_rates_string, globals.codec_rates_string); - -/* BEGIN: Changes here */ -static switch_status_t interface_exists(char *the_interface); -#if 1 -static switch_status_t remove_interface(char *the_interface); -#endif //0 -/* END: Changes here */ - -static switch_status_t channel_on_init(switch_core_session_t *session); -static switch_status_t channel_on_hangup(switch_core_session_t *session); -static switch_status_t channel_on_destroy(switch_core_session_t *session); -static switch_status_t channel_on_routing(switch_core_session_t *session); -static switch_status_t channel_on_exchange_media(switch_core_session_t *session); -static switch_status_t channel_on_consume_media(switch_core_session_t *session); -static switch_status_t channel_on_soft_execute(switch_core_session_t *session); -static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, - switch_event_t *var_event, - switch_caller_profile_t *outbound_profile, - switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, - switch_call_cause_t *cancel_cause); -static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id); -static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id); -static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig); -static switch_status_t gsmopen_tech_init(private_t * tech_pvt, switch_core_session_t *session); - -static switch_status_t gsmopen_codec(private_t * tech_pvt, int sample_rate, int codec_ms) -{ - switch_core_session_t *session = NULL; - - if (switch_core_codec_init - (&tech_pvt->read_codec, "L16", NULL, NULL, sample_rate, codec_ms, 1, - SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, NULL) != SWITCH_STATUS_SUCCESS) { - ERRORA("Can't load codec?\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - } - - if (switch_core_codec_init - (&tech_pvt->write_codec, "L16", NULL, NULL, sample_rate, codec_ms, 1, - SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, NULL) != SWITCH_STATUS_SUCCESS) { - ERRORA("Can't load codec?\n", GSMOPEN_P_LOG); - switch_core_codec_destroy(&tech_pvt->read_codec); - return SWITCH_STATUS_FALSE; - } - - tech_pvt->read_frame.rate = sample_rate; - tech_pvt->read_frame.codec = &tech_pvt->read_codec; - - session = switch_core_session_locate(tech_pvt->session_uuid_str); - - if (session) { - switch_core_session_set_read_codec(session, &tech_pvt->read_codec); - switch_core_session_set_write_codec(session, &tech_pvt->write_codec); - switch_core_session_rwunlock(session); - } else { - ERRORA("no session\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - } - - return SWITCH_STATUS_SUCCESS; - -} - -switch_status_t gsmopen_tech_init(private_t * tech_pvt, switch_core_session_t *session) -{ - -#ifdef WANT_SPEEX - int ciapa; - long level; - int tmp; -#endif// WANT_SPEEX - switch_assert(tech_pvt != NULL); - switch_assert(session != NULL); - tech_pvt->read_frame.data = tech_pvt->databuf; - tech_pvt->read_frame.buflen = sizeof(tech_pvt->databuf); - switch_mutex_init(&tech_pvt->mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session)); - switch_mutex_init(&tech_pvt->flag_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session)); - switch_core_session_set_private(session, tech_pvt); - switch_copy_string(tech_pvt->session_uuid_str, switch_core_session_get_uuid(session), sizeof(tech_pvt->session_uuid_str)); - if (!strlen(tech_pvt->session_uuid_str)) { - ERRORA("no tech_pvt->session_uuid_str\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - } - if (gsmopen_codec(tech_pvt, SAMPLERATE_GSMOPEN, 20) != SWITCH_STATUS_SUCCESS) { - ERRORA("gsmopen_codec FAILED\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - } - //teletone_dtmf_detect_init(&tech_pvt->dtmf_detect, tech_pvt->read_codec.implementation->actual_samples_per_second); - //teletone_dtmf_detect_init(&tech_pvt->dtmf_detect, 8000); - dtmf_rx_init(&tech_pvt->dtmf_state, NULL, NULL); - dtmf_rx_parms(&tech_pvt->dtmf_state, 0, 10, 10, -99); - -#ifdef GSMOPEN_ALSA - if(tech_pvt->no_sound==0){ - if (alsa_init(tech_pvt)) { - ERRORA("alsa_init failed\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - - } - } -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - if(tech_pvt->no_sound==0){ - if (gsmopen_portaudio_init(tech_pvt)) { - ERRORA("gsmopen_portaudio_init failed\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - - } - } -#endif// GSMOPEN_PORTAUDIO - - if (switch_core_timer_init(&tech_pvt->timer_read, "soft", 20, tech_pvt->read_codec.implementation->samples_per_packet, gsmopen_module_pool) != - SWITCH_STATUS_SUCCESS) { - ERRORA("setup timer failed\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - } - - switch_core_timer_sync(&tech_pvt->timer_read); - - if (switch_core_timer_init(&tech_pvt->timer_write, "soft", 20, tech_pvt->write_codec.implementation->samples_per_packet, gsmopen_module_pool) != - SWITCH_STATUS_SUCCESS) { - ERRORA("setup timer failed\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - } - - switch_core_timer_sync(&tech_pvt->timer_write); - -#ifdef WANT_SPEEX - /* Echo canceller with 100 ms tail length */ -#ifndef GIOVA48 - tech_pvt->echo_state = speex_echo_state_init(160, 1024); - ciapa = 8000; -#else// GIOVA48 - tech_pvt->echo_state = speex_echo_state_init(960, 4800); - ciapa = 48000; -#endif // GIOVA48 - speex_echo_ctl(tech_pvt->echo_state, SPEEX_ECHO_SET_SAMPLING_RATE, &ciapa); - -#if 1 //NO MORE - /* Setup preprocessor and associate with echo canceller for residual echo suppression */ -#ifndef GIOVA48 - tech_pvt->preprocess = speex_preprocess_state_init(160, 8000); -#else// GIOVA48 - tech_pvt->preprocess = speex_preprocess_state_init(960, 48000); -#endif // GIOVA48 - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_ECHO_STATE, - tech_pvt->echo_state); - -#if 0 - /* Setup preprocessor various other goodies */ - tmp = 0; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_AGC, &tmp); - //level=8000.1; - //speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_AGC_LEVEL, &level); - - // Let's turn off all of the 'denoisers' (eg denoise and dereverb, and vad too) because they start automatic gain on mic input on cm108 usb, also if it (the agc on usb) disbled through mixer - tmp = 0; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_DENOISE, &tmp); - tmp = 0; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_DEREVERB, &tmp); - tmp = 0; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_VAD, &tmp); -#endif - - tmp = 0; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_SET_DENOISE, &tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_AGC, &tmp); - fprintf(stderr, "AGC is: %d\n", tmp); - level = 1.0; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_AGC_LEVEL, &level); - fprintf(stderr, "AGC_LEVEL is: %f\n", level); - //tmp=1; - //speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_AGC_TARGET, &tmp); - //fprintf( stderr, "AGC_TARGET is: %d\n", tmp ); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_DENOISE, &tmp); - fprintf(stderr, "DENOISE is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_DEREVERB, &tmp); - fprintf(stderr, "DEREVERB is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_VAD, &tmp); - fprintf(stderr, "VAD is: %d\n", tmp); - -#if 0 - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_NOISE_SUPPRESS, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_NOISE_SUPPRESS is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_ECHO_SUPPRESS is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE, - &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_AGC_MAX_GAIN, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_MAX_GAIN is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_AGC_INCREMENT, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_INCREMENT is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_AGC_DECREMENT, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_AGC_DECREMENT is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_PROB_START, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_PROB_START is: %d\n", tmp); - tmp = 1; - speex_preprocess_ctl(tech_pvt->preprocess, SPEEX_PREPROCESS_GET_PROB_CONTINUE, &tmp); - fprintf(stderr, "SPEEX_PREPROCESS_GET_PROB_CONTINUE is: %d\n", tmp); -#endif //0 -#endif// 0 //NO MORE - -#endif // WANT_SPEEX - - - - switch_clear_flag(tech_pvt, TFLAG_HANGUP); - DEBUGA_GSMOPEN("gsmopen_codec SUCCESS\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_SUCCESS; -} - -/* BEGIN: Changes here */ -static switch_status_t interface_exists(char *the_interface) -{ - int i; - int interface_id; - - if (*the_interface == '#') { /* look by interface id or interface name */ - the_interface++; - switch_assert(the_interface); - interface_id = atoi(the_interface); - - /* take a number as interface id */ - if (interface_id > 0 || (interface_id == 0 && strcmp(the_interface, "0") == 0)) { - if (strlen(globals.GSMOPEN_INTERFACES[interface_id].name)) { - return SWITCH_STATUS_SUCCESS; - } - } else { - /* interface name */ - for (interface_id = 0; interface_id < GSMOPEN_MAX_INTERFACES; interface_id++) { - if (strcmp(globals.GSMOPEN_INTERFACES[interface_id].name, the_interface) == 0) { - return SWITCH_STATUS_SUCCESS; - break; - } - } - } - } else { /* look by gsmopen_user */ - - - for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) { - if (strlen(globals.GSMOPEN_INTERFACES[i].gsmopen_user)) { - if (strcmp(globals.GSMOPEN_INTERFACES[i].gsmopen_user, the_interface) == 0) { - return SWITCH_STATUS_SUCCESS; - } - } - } - } - return SWITCH_STATUS_FALSE; -} - -#if 1 -static switch_status_t remove_interface(char *the_interface) -{ - int x = 10; - unsigned int howmany = 8; - int interface_id = -1; - private_t *tech_pvt = NULL; - switch_status_t status; - - //running = 0; - - - //XXX if (*the_interface == '#') { /* remove by interface id or interface name */ - //XXX the_interface++; - switch_assert(the_interface); - interface_id = atoi(the_interface); - - if (interface_id > 0 || (interface_id == 0 && strcmp(the_interface, "0") == 0)) { - /* take a number as interface id */ - tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; - } else { - - for (interface_id = 0; interface_id < GSMOPEN_MAX_INTERFACES; interface_id++) { - if (strcmp(globals.GSMOPEN_INTERFACES[interface_id].name, the_interface) == 0) { - tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; - break; - } - } - } - //XXX } //else { /* remove by gsmopen_user */ - //for (interface_id = 0; interface_id < GSMOPEN_MAX_INTERFACES; interface_id++) { - //if (strcmp(globals.GSMOPEN_INTERFACES[interface_id].gsmopen_user, the_interface) == 0) { - //tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; - //break; - //} - //} - //} - - if (!tech_pvt) { - DEBUGA_GSMOPEN("interface '%s' does not exist\n", GSMOPEN_P_LOG, the_interface); - goto end; - } - - if (strlen(globals.GSMOPEN_INTERFACES[interface_id].session_uuid_str)) { - DEBUGA_GSMOPEN("interface '%s' is busy\n", GSMOPEN_P_LOG, the_interface); - goto end; - } - - globals.GSMOPEN_INTERFACES[interface_id].running = 0; - - if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_signaling_thread) { -#if 1 -#ifdef WIN32 - switch_file_write(tech_pvt->GSMopenHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die -#else /* WIN32 */ - howmany = write(tech_pvt->GSMopenHandles.fdesc[1], "sciutati", howmany); -#endif /* WIN32 */ -#endif //0 - DEBUGA_GSMOPEN("HERE will shutdown gsmopen_signaling_thread of '%s'\n", GSMOPEN_P_LOG, the_interface); - } - - if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread) { -#if 0 -#ifdef WIN32 - if (SendMessage(tech_pvt->GSMopenHandles.win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the gsmopen_api_thread_func die - DEBUGA_GSMOPEN("got FALSE here, thread probably was already dead. GetLastError returned: %d\n", GSMOPEN_P_LOG, GetLastError()); - globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread = NULL; - } -#else - XEvent e; - Atom atom1 = XInternAtom(tech_pvt->GSMopenHandles.disp, "GSMOPENCONTROLAPI_MESSAGE_BEGIN", False); - memset(&e, 0, sizeof(e)); - e.xclient.type = ClientMessage; - e.xclient.message_type = atom1; /* leading message */ - e.xclient.display = tech_pvt->GSMopenHandles.disp; - e.xclient.window = tech_pvt->GSMopenHandles.gsmopen_win; - e.xclient.format = 8; - - XSendEvent(tech_pvt->GSMopenHandles.disp, tech_pvt->GSMopenHandles.win, False, 0, &e); - XSync(tech_pvt->GSMopenHandles.disp, False); -#endif //WIN32 -#endif //0 - - DEBUGA_GSMOPEN("HERE will shutdown gsmopen_api_thread of '%s'\n", GSMOPEN_P_LOG, the_interface); - } - - while (x) { - x--; - switch_yield(50000); - } - - if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_signaling_thread) { - switch_thread_join(&status, globals.GSMOPEN_INTERFACES[interface_id].gsmopen_signaling_thread); - } - - if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread) { - switch_thread_join(&status, globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread); - } - - switch_mutex_lock(globals.mutex); - if (globals.gsm_console == &globals.GSMOPEN_INTERFACES[interface_id]) { - DEBUGA_GSMOPEN("interface '%s' no more console\n", GSMOPEN_P_LOG, the_interface); - globals.gsm_console = NULL; - } else { - DEBUGA_GSMOPEN("interface '%s' STILL console\n", GSMOPEN_P_LOG, the_interface); - } - memset(&globals.GSMOPEN_INTERFACES[interface_id], '\0', sizeof(private_t)); - globals.real_interfaces--; - switch_mutex_unlock(globals.mutex); - - DEBUGA_GSMOPEN("interface '%s' deleted successfully\n", GSMOPEN_P_LOG, the_interface); - globals.GSMOPEN_INTERFACES[interface_id].running = 1; - end: - //running = 1; - return SWITCH_STATUS_SUCCESS; -} -#endif //0 - -/* END: Changes here */ - -/* - State methods they get called when the state changes to the specific state - returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next - so if you fully implement the state you can return SWITCH_STATUS_FALSE to skip it. -*/ -static switch_status_t channel_on_init(switch_core_session_t *session) -{ - switch_channel_t *channel; - private_t *tech_pvt = NULL; - - tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - //ERRORA("%s CHANNEL INIT\n", GSMOPEN_P_LOG, tech_pvt->name); - switch_set_flag(tech_pvt, TFLAG_IO); - - switch_mutex_lock(globals.mutex); - globals.calls++; - - switch_mutex_unlock(globals.mutex); - DEBUGA_GSMOPEN("%s CHANNEL INIT %s\n", GSMOPEN_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session)); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_on_destroy(switch_core_session_t *session) -{ - private_t *tech_pvt = NULL; - - tech_pvt = (private_t *) switch_core_session_get_private(session); - - - if (tech_pvt) { - DEBUGA_GSMOPEN("%s CHANNEL DESTROY %s\n", GSMOPEN_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session)); - - if (switch_core_codec_ready(&tech_pvt->read_codec)) { - switch_core_codec_destroy(&tech_pvt->read_codec); - } - - if (switch_core_codec_ready(&tech_pvt->write_codec)) { - switch_core_codec_destroy(&tech_pvt->write_codec); - } - - switch_core_timer_destroy(&tech_pvt->timer_read); - switch_core_timer_destroy(&tech_pvt->timer_write); - -#ifdef GSMOPEN_ALSA - if(tech_pvt->no_sound==0){ - alsa_shutdown(tech_pvt); - } -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - if(tech_pvt->no_sound==0){ - if (gsmopen_portaudio_shutdown(tech_pvt)) { - ERRORA("gsmopen_portaudio_shutdown failed\n", GSMOPEN_P_LOG); - - } - } -#endif// GSMOPEN_PORTAUDIO - - - *tech_pvt->session_uuid_str = '\0'; - tech_pvt->interface_state = GSMOPEN_STATE_IDLE; - if (tech_pvt->phone_callflow == CALLFLOW_STATUS_FINISHED) { - tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; - } - switch_core_session_set_private(session, NULL); - } else { - DEBUGA_GSMOPEN("!!!!!!NO tech_pvt!!!! CHANNEL DESTROY %s\n", GSMOPEN_P_LOG, switch_core_session_get_uuid(session)); - } - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_on_hangup(switch_core_session_t *session) -{ - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; - - - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - - tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - tech_pvt->phone_callflow = CALLFLOW_CALL_HANGUP_REQUESTED; - - if (!switch_channel_test_flag(channel, CF_ANSWERED)) { - if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) { - tech_pvt->ob_failed_calls++; - } else { - tech_pvt->ib_failed_calls++; - } - } - - - DEBUGA_GSMOPEN("%s CHANNEL HANGUP\n", GSMOPEN_P_LOG, tech_pvt->name); - switch_clear_flag(tech_pvt, TFLAG_IO); - switch_clear_flag(tech_pvt, TFLAG_VOICE); - switch_set_flag(tech_pvt, TFLAG_HANGUP); - - gsmopen_hangup(tech_pvt); - - //memset(tech_pvt->session_uuid_str, '\0', sizeof(tech_pvt->session_uuid_str)); - //*tech_pvt->session_uuid_str = '\0'; - DEBUGA_GSMOPEN("%s CHANNEL HANGUP\n", GSMOPEN_P_LOG, tech_pvt->name); - switch_mutex_lock(globals.mutex); - globals.calls--; - if (globals.calls < 0) { - globals.calls = 0; - } - - tech_pvt->interface_state = GSMOPEN_STATE_IDLE; - //FIXME if (tech_pvt->phone_callflow == CALLFLOW_STATUS_FINISHED) { - tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; - //FIXME } - switch_mutex_unlock(globals.mutex); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_on_routing(switch_core_session_t *session) -{ - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; - - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - - tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - DEBUGA_GSMOPEN("%s CHANNEL ROUTING\n", GSMOPEN_P_LOG, tech_pvt->name); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_on_execute(switch_core_session_t *session) -{ - - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; - - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - - tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - DEBUGA_GSMOPEN("%s CHANNEL EXECUTE\n", GSMOPEN_P_LOG, tech_pvt->name); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig) -{ - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; - - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - - tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - DEBUGA_GSMOPEN("%s CHANNEL KILL_CHANNEL\n", GSMOPEN_P_LOG, tech_pvt->name); - switch (sig) { - case SWITCH_SIG_KILL: - DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_SIG_KILL\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); - //switch_mutex_lock(tech_pvt->flag_mutex); - switch_clear_flag(tech_pvt, TFLAG_IO); - switch_clear_flag(tech_pvt, TFLAG_VOICE); - switch_set_flag(tech_pvt, TFLAG_HANGUP); - //switch_mutex_unlock(tech_pvt->flag_mutex); - break; - case SWITCH_SIG_BREAK: - DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_SIG_BREAK\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); - //switch_set_flag(tech_pvt, TFLAG_BREAK); - //switch_mutex_lock(tech_pvt->flag_mutex); - switch_set_flag(tech_pvt, TFLAG_BREAK); - //switch_mutex_unlock(tech_pvt->flag_mutex); - break; - default: - break; - } - - return SWITCH_STATUS_SUCCESS; -} -static switch_status_t channel_on_consume_media(switch_core_session_t *session) -{ - private_t *tech_pvt = NULL; - - tech_pvt = (private_t *) switch_core_session_get_private(session); - - DEBUGA_GSMOPEN("%s CHANNEL CONSUME_MEDIA\n", GSMOPEN_P_LOG, tech_pvt->name); - return SWITCH_STATUS_SUCCESS; -} - - -static switch_status_t channel_on_exchange_media(switch_core_session_t *session) -{ - private_t *tech_pvt = NULL; - tech_pvt = (private_t *) switch_core_session_get_private(session); - DEBUGA_GSMOPEN("%s CHANNEL EXCHANGE_MEDIA\n", GSMOPEN_P_LOG, tech_pvt->name); - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_on_soft_execute(switch_core_session_t *session) -{ - private_t *tech_pvt = NULL; - tech_pvt = (private_t *) switch_core_session_get_private(session); - DEBUGA_GSMOPEN("%s CHANNEL SOFT_EXECUTE\n", GSMOPEN_P_LOG, tech_pvt->name); - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_send_dtmf(switch_core_session_t *session, const switch_dtmf_t *dtmf) -{ - private_t *tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - DEBUGA_GSMOPEN("%s CHANNEL SEND_DTMF\n", GSMOPEN_P_LOG, tech_pvt->name); - DEBUGA_GSMOPEN("DTMF: %c\n", GSMOPEN_P_LOG, dtmf->digit); - - gsmopen_senddigit(tech_pvt, dtmf->digit); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id) -{ - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; - switch_byte_t *data; -#if defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) - int samples; - char digit_str[256]; -#endif // defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) -#ifdef GSMOPEN_PORTAUDIO -#ifdef WANT_SPEEX - spx_int16_t *speexptr; - spx_int16_t pcm2[160]; - int i; -#endif// GSMOPEN_ALSA -#endif// WANT_SPEEX - - - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - - tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - if (!switch_channel_ready(channel) || !switch_test_flag(tech_pvt, TFLAG_IO)) { - ERRORA("channel not ready \n", GSMOPEN_P_LOG); - //TODO: kill the bastard - return SWITCH_STATUS_FALSE; - } - - - tech_pvt->read_frame.flags = SFF_NONE; - *frame = NULL; - - if (switch_test_flag(tech_pvt, TFLAG_HANGUP)) { - return SWITCH_STATUS_FALSE; - } - -#ifndef GSMOPEN_PORTAUDIO - switch_core_timer_next(&tech_pvt->timer_read); -#endif// GSMOPEN_PORTAUDIO - - if(tech_pvt->no_sound==1){ - goto cng; - } -#if defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) -#ifdef GSMOPEN_ALSA - //if ((samples = snd_pcm_readi(tech_pvt->alsac, tech_pvt->read_frame.data, tech_pvt->read_codec.implementation->samples_per_packet)) > 0) - if ((samples = alsa_read(tech_pvt, (short *) tech_pvt->read_frame.data, tech_pvt->read_codec.implementation->samples_per_packet)) > 0) -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - if ((samples = gsmopen_portaudio_read(tech_pvt, (short *) tech_pvt->read_frame.data, tech_pvt->read_codec.implementation->samples_per_packet)) > 0) -#endif// GSMOPEN_PORTAUDIO - { - -#ifdef GSMOPEN_PORTAUDIO -#ifdef WANT_SPEEX - - if (tech_pvt->speexecho) { - speexptr = ((spx_int16_t *) tech_pvt->read_frame.data); - /* Perform echo cancellation */ - speex_echo_capture(tech_pvt->echo_state, speexptr, pcm2); -#ifndef GIOVA48 - for (i = 0; i < 160; i++) -#else //GIOVA48 - for (i = 0; i < 960; i++) -#endif //GIOVA48 - speexptr[i] = pcm2[i]; - } - /* Apply noise/echo residual suppression */ - if (tech_pvt->speexpreprocess) { - speex_preprocess_run(tech_pvt->preprocess, speexptr); - } - - DEBUGA_GSMOPEN("read\n", GSMOPEN_P_LOG); -#endif //WANT_SPEEX -#endif // GSMOPEN_PORTAUDIO - - - - - - tech_pvt->read_frame.datalen = samples * 2; - tech_pvt->read_frame.samples = samples; - -#ifndef GSMOPEN_PORTAUDIO - tech_pvt->read_frame.timestamp = tech_pvt->timer_read.samplecount; -#endif// GSMOPEN_PORTAUDIO - - *frame = &tech_pvt->read_frame; - - //status = SWITCH_STATUS_SUCCESS; - switch_set_flag(tech_pvt, TFLAG_VOICE); - } - - //WARNINGA("samples=%d\n", GSMOPEN_P_LOG, samples); - if (samples != 160) { - ERRORA("samples=%d\n", GSMOPEN_P_LOG, samples); - goto cng; - } -//DEBUGA_GSMOPEN("samples=%d tech_pvt->read_frame.timestamp=%d\n", GSMOPEN_P_LOG, samples, tech_pvt->read_frame.timestamp); - -//usleep(17000); -//usleep(17000); - - - - - - memset(digit_str, 0, sizeof(digit_str)); - //teletone_dtmf_detect(&tech_pvt->dtmf_detect, (int16_t *) tech_pvt->read_frame.data, tech_pvt->read_frame.samples); - //teletone_dtmf_get(&tech_pvt->dtmf_detect, digit_str, sizeof(digit_str)); - dtmf_rx(&tech_pvt->dtmf_state, (int16_t *) tech_pvt->read_frame.data, tech_pvt->read_frame.samples); - dtmf_rx_get(&tech_pvt->dtmf_state, digit_str, sizeof(digit_str)); - - gsmopen_sound_boost(tech_pvt->read_frame.data, tech_pvt->read_frame.samples, tech_pvt->capture_boost); - - if (digit_str[0]) { - switch_time_t new_dtmf_timestamp = switch_time_now(); - if ((new_dtmf_timestamp - tech_pvt->old_dtmf_timestamp) > 350000) { //FIXME: make it configurable - char *p = digit_str; - switch_channel_t *channel = switch_core_session_get_channel(session); - - while (p && *p) { - switch_dtmf_t dtmf = {0}; - dtmf.digit = *p; - dtmf.duration = SWITCH_DEFAULT_DTMF_DURATION; - switch_channel_queue_dtmf(channel, &dtmf); - p++; - } - NOTICA("DTMF DETECTED: [%s] new_dtmf_timestamp: %u, delta_t: %u\n", GSMOPEN_P_LOG, digit_str, (unsigned int) new_dtmf_timestamp, - (unsigned int) (new_dtmf_timestamp - tech_pvt->old_dtmf_timestamp)); - tech_pvt->old_dtmf_timestamp = new_dtmf_timestamp; - } - } - while (switch_test_flag(tech_pvt, TFLAG_IO)) { - if (switch_test_flag(tech_pvt, TFLAG_BREAK)) { - switch_clear_flag(tech_pvt, TFLAG_BREAK); - DEBUGA_GSMOPEN("CHANNEL READ FRAME goto CNG\n", GSMOPEN_P_LOG); - goto cng; - } - - if (!switch_test_flag(tech_pvt, TFLAG_IO)) { - DEBUGA_GSMOPEN("CHANNEL READ FRAME not IO\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - } - - if (switch_test_flag(tech_pvt, TFLAG_IO) && switch_test_flag(tech_pvt, TFLAG_VOICE)) { - switch_clear_flag(tech_pvt, TFLAG_VOICE); - if (!tech_pvt->read_frame.datalen) { - DEBUGA_GSMOPEN("CHANNEL READ CONTINUE\n", GSMOPEN_P_LOG); - continue; - } - *frame = &tech_pvt->read_frame; -#ifdef BIGENDIAN - if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { - switch_swap_linear((*frame)->data, (int) (*frame)->datalen / 2); - } -#endif - //WARNINGA("HERE\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_SUCCESS; - } - - WARNINGA("HERE\n", GSMOPEN_P_LOG); - DEBUGA_GSMOPEN("CHANNEL READ no TFLAG_VOICE\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - - } - - DEBUGA_GSMOPEN("CHANNEL READ FALSE\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; -#endif // defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) - cng: - data = (switch_byte_t *) tech_pvt->read_frame.data; - data[0] = 65; - data[1] = 0; - tech_pvt->read_frame.datalen = 2; - tech_pvt->read_frame.flags = SFF_CNG; - *frame = &tech_pvt->read_frame; -#ifdef GSMOPEN_PORTAUDIO - //speex_echo_state_reset(tech_pvt->stream->echo_state); -#endif // GSMOPEN_PORTAUDIO - return SWITCH_STATUS_SUCCESS; - -} - -static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id) -{ - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; -#if defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) - unsigned int sent; -#endif // defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) -#ifdef GSMOPEN_PORTAUDIO -#ifdef WANT_SPEEX - spx_int16_t *speexptr; -#endif// GSMOPEN_ALSA -#endif// WANT_SPEEX - - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - - tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - if (!switch_channel_ready(channel) || !switch_test_flag(tech_pvt, TFLAG_IO)) { - ERRORA("channel not ready \n", GSMOPEN_P_LOG); - //TODO: kill the bastard - return SWITCH_STATUS_FALSE; - } -#ifdef BIGENDIAN - if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { -#ifdef WIN32 - switch_swap_linear((int16_t *)frame->data, (int) frame->datalen / 2); -#else - switch_swap_linear(frame->data, (int) frame->datalen / 2); -#endif //WIN32 - } -#endif - - //switch_core_timer_next(&tech_pvt->timer_write); - //sent = frame->datalen; - - //ERRORA("PLAY \n", GSMOPEN_P_LOG); - //snd_pcm_writei(tech_pvt->alsap, (short *) frame->data, (int) (frame->datalen / 2)); - - gsmopen_sound_boost(frame->data, frame->samples, tech_pvt->playback_boost); -#ifdef GSMOPEN_ALSA - - switch_core_timer_next(&tech_pvt->timer_write); - sent = alsa_write(tech_pvt, (short *) frame->data, (int) (frame->datalen)); -//DEBUGA_GSMOPEN("sent=%d \n", GSMOPEN_P_LOG, sent); - - if (sent && sent != frame->datalen / 2 && sent != -1) { - DEBUGA_GSMOPEN("sent %d\n", GSMOPEN_P_LOG, sent); - } -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - sent = gsmopen_portaudio_write(tech_pvt, (short *) frame->data, (int) (frame->datalen)); -//DEBUGA_GSMOPEN("sent=%d \n", GSMOPEN_P_LOG, sent); - - if (sent && sent != frame->datalen / 2 && sent != -1) { - DEBUGA_GSMOPEN("sent %d\n", GSMOPEN_P_LOG, sent); - } - -#ifdef WANT_SPEEX - if (tech_pvt->speexecho) { - speexptr = (spx_int16_t *) frame->data; - /* Put frame into playback buffer */ - speex_echo_playback(tech_pvt->echo_state, speexptr); - DEBUGA_GSMOPEN("write\n", GSMOPEN_P_LOG); - } -#endif //WANT_SPEEX -#endif // GSMOPEN_PORTAUDIO - //NOTICA("sent=%d\n", GSMOPEN_P_LOG, sent); - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_answer_channel(switch_core_session_t *session) -{ - private_t *tech_pvt; - switch_channel_t *channel = NULL; - - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - - tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - //ERRORA("%s CHANNEL INIT\n", GSMOPEN_P_LOG, tech_pvt->name); - switch_set_flag(tech_pvt, TFLAG_IO); - gsmopen_serial_answer(tech_pvt); - - /* Move channel's state machine to ROUTING. This means the call is trying - to get from the initial start where the call because, to the point - where a destination has been identified. If the channel is simply - left in the initial state, nothing will happen. */ - switch_channel_set_state(channel, CS_ROUTING); - switch_mutex_lock(globals.mutex); - globals.calls++; - - switch_mutex_unlock(globals.mutex); - DEBUGA_GSMOPEN("%s CHANNEL ANSWER %s\n", GSMOPEN_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session)); - - - - - - - - - - - - - - - - - DEBUGA_GSMOPEN("ANSWERED! \n", GSMOPEN_P_LOG); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_receive_message(switch_core_session_t *session, switch_core_session_message_t *msg) -{ - switch_channel_t *channel; - private_t *tech_pvt; -#if defined(GSMOPEN_ALSA) - int samples; - short tmp_buffer[1280]; -#endif // defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) - - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - - tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - switch (msg->message_id) { - case SWITCH_MESSAGE_INDICATE_ANSWER: - { - DEBUGA_GSMOPEN("MSG_ID=%d, TO BE ANSWERED!\n", GSMOPEN_P_LOG, msg->message_id); - channel_answer_channel(session); - } - break; - case SWITCH_MESSAGE_INDICATE_AUDIO_SYNC: - - DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_MESSAGE_INDICATE_AUDIO_SYNC\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); - switch_core_timer_sync(&tech_pvt->timer_read); - switch_core_timer_sync(&tech_pvt->timer_write); - -#ifdef GSMOPEN_ALSA - while ((samples = alsa_read(tech_pvt, tmp_buffer, tech_pvt->read_codec.implementation->samples_per_packet * 4)) > 160) { - //WARNINGA("read %d samples\n", GSMOPEN_P_LOG, samples); - } -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - //while ((samples = gsmopen_portaudio_read(tech_pvt, tmp_buffer, tech_pvt->read_codec.implementation->samples_per_packet * 2)) > 160) { - //WARNINGA("read %d samples\n", GSMOPEN_P_LOG, samples); - //} -#ifdef WANT_SPEEX - speex_echo_state_reset(tech_pvt->echo_state); -#endif// WANT_SPEEX -#endif// GSMOPEN_PORTAUDIO - break; - - - default: - { - DEBUGA_GSMOPEN("MSG_ID=%d\n", GSMOPEN_P_LOG, msg->message_id); - } - break; - } - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_receive_event(switch_core_session_t *session, switch_event_t *event) -{ - struct private_object *tech_pvt = (struct private_object *) switch_core_session_get_private(session); - char *body = switch_event_get_body(event); - switch_assert(tech_pvt != NULL); - - if (!body) { - body = (char *) ""; - } - - WARNINGA("event: |||%s|||\n", GSMOPEN_P_LOG, body); - - return SWITCH_STATUS_SUCCESS; -} - -switch_state_handler_table_t gsmopen_state_handlers = { - /*.on_init */ channel_on_init, - /*.on_routing */ channel_on_routing, - /*.on_execute */ channel_on_execute, - /*.on_hangup */ channel_on_hangup, - /*.on_exchange_media */ channel_on_exchange_media, - /*.on_soft_execute */ channel_on_soft_execute, - /*.on_consume_media */ channel_on_consume_media, - /*.on_hibernate */ NULL, - /*.on_reset */ NULL, - /*.on_park */ NULL, - /*.on_reporting */ NULL, - /*.on_destroy */ channel_on_destroy -}; - -switch_io_routines_t gsmopen_io_routines = { - /*.outgoing_channel */ channel_outgoing_channel, - /*.read_frame */ channel_read_frame, - /*.write_frame */ channel_write_frame, - /*.kill_channel */ channel_kill_channel, - /*.send_dtmf */ channel_send_dtmf, - /*.receive_message */ channel_receive_message, - /*.receive_event */ channel_receive_event -}; - -static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, - switch_event_t *var_event, - switch_caller_profile_t *outbound_profile, - switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, - switch_call_cause_t *cancel_cause) -{ - private_t *tech_pvt = NULL; - if ((*new_session = switch_core_session_request(gsmopen_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool)) != 0) { - switch_channel_t *channel = NULL; - switch_caller_profile_t *caller_profile; - char *rdest; - int found = 0; - char interface_name[256]; - - DEBUGA_GSMOPEN("1 SESSION_REQUEST %s\n", GSMOPEN_P_LOG, switch_core_session_get_uuid(*new_session)); - switch_core_session_add_stream(*new_session, NULL); - - - if (!zstr(outbound_profile->destination_number)) { - int i; - char *slash; - - switch_copy_string(interface_name, outbound_profile->destination_number, 255); - slash = strrchr(interface_name, '/'); - *slash = '\0'; - - switch_mutex_lock(globals.mutex); - if (strncmp("ANY", interface_name, strlen(interface_name)) == 0 || strncmp("RR", interface_name, strlen(interface_name)) == 0) { - /* we've been asked for the "ANY" interface, let's find the first idle interface */ - //DEBUGA_GSMOPEN("Finding one available gsmopen interface\n", GSMOPEN_P_LOG); - //tech_pvt = find_available_gsmopen_interface(NULL); - //if (tech_pvt) - //found = 1; - //} else if (strncmp("RR", interface_name, strlen(interface_name)) == 0) { - /* Find the first idle interface using Round Robin */ - DEBUGA_GSMOPEN("Finding one available gsmopen interface RR\n", GSMOPEN_P_LOG); - tech_pvt = find_available_gsmopen_interface_rr(NULL); - if (tech_pvt) { - found = 1; - DEBUGA_GSMOPEN("FOUND one available gsmopen interface RR\n", GSMOPEN_P_LOG); - } - } - - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ - if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].name, interface_name, strlen(interface_name)) == 0)) { - if (strlen(globals.GSMOPEN_INTERFACES[i].session_uuid_str)) { - DEBUGA_GSMOPEN - ("globals.GSMOPEN_INTERFACES[%d].name=|||%s||| session_uuid_str=|||%s||| is BUSY\n", - GSMOPEN_P_LOG, i, globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].session_uuid_str); - DEBUGA_GSMOPEN("1 SESSION_DESTROY %s\n", GSMOPEN_P_LOG, switch_core_session_get_uuid(*new_session)); - switch_core_session_destroy(new_session); - switch_mutex_unlock(globals.mutex); - return SWITCH_CAUSE_NORMAL_CIRCUIT_CONGESTION; - } - - DEBUGA_GSMOPEN("globals.GSMOPEN_INTERFACES[%d].name=|||%s|||?\n", GSMOPEN_P_LOG, i, globals.GSMOPEN_INTERFACES[i].name); - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - found = 1; - break; - } - - } - - } else { - ERRORA("Doh! no destination number?\n", GSMOPEN_P_LOG); - switch_core_session_destroy(new_session); - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; - } - - if (!found) { - DEBUGA_GSMOPEN("Doh! no available interface for |||%s|||?\n", GSMOPEN_P_LOG, interface_name); - DEBUGA_GSMOPEN("2 SESSION_DESTROY %s\n", GSMOPEN_P_LOG, switch_core_session_get_uuid(*new_session)); - switch_core_session_destroy(new_session); - switch_mutex_unlock(globals.mutex); - //return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; - return SWITCH_CAUSE_NORMAL_CIRCUIT_CONGESTION; - } - - channel = switch_core_session_get_channel(*new_session); - if (!channel) { - ERRORA("Doh! no channel?\n", GSMOPEN_P_LOG); - switch_core_session_destroy(new_session); - switch_mutex_unlock(globals.mutex); - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; - } - if (gsmopen_tech_init(tech_pvt, *new_session) != SWITCH_STATUS_SUCCESS) { - ERRORA("Doh! no tech_init?\n", GSMOPEN_P_LOG); - switch_core_session_destroy(new_session); - switch_mutex_unlock(globals.mutex); - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; - } - - - if (outbound_profile) { - char name[128]; - - snprintf(name, sizeof(name), "gsmopen/%s", outbound_profile->destination_number); - //snprintf(name, sizeof(name), "gsmopen/%s", tech_pvt->name); - switch_channel_set_name(channel, name); - caller_profile = switch_caller_profile_clone(*new_session, outbound_profile); - switch_channel_set_caller_profile(channel, caller_profile); - tech_pvt->caller_profile = caller_profile; - } else { - ERRORA("Doh! no caller profile\n", GSMOPEN_P_LOG); - switch_core_session_destroy(new_session); - switch_mutex_unlock(globals.mutex); - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; - } - - tech_pvt->ob_calls++; - - rdest = strchr(caller_profile->destination_number, '/'); - *rdest++ = '\0'; - - //gsmopen_call(tech_pvt, rdest, 30); - - switch_copy_string(tech_pvt->session_uuid_str, switch_core_session_get_uuid(*new_session), sizeof(tech_pvt->session_uuid_str)); - caller_profile = tech_pvt->caller_profile; - caller_profile->destination_number = rdest; - - switch_set_flag(tech_pvt, TFLAG_OUTBOUND); - switch_channel_set_state(channel, CS_INIT); - gsmopen_call(tech_pvt, rdest, 30); - switch_mutex_unlock(globals.mutex); - return SWITCH_CAUSE_SUCCESS; - } - - ERRORA("Doh! no new_session\n", GSMOPEN_P_LOG); - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; -} - -/*! - * \brief This thread runs during a call, and monitor the interface for signaling, like hangup, caller id, etc most of signaling is handled inside the gsmopen_signaling_read function - * - */ - -static switch_status_t load_config(int reload_type) -{ - const char *cf = "gsmopen.conf"; - switch_xml_t cfg, xml, global_settings, param, interfaces, myinterface; - private_t *tech_pvt = NULL; - - switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, gsmopen_module_pool); - if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { - ERRORA("open of %s failed\n", GSMOPEN_P_LOG, cf); - running = 0; - switch_xml_free(xml); - return SWITCH_STATUS_TERM; - } - - switch_mutex_lock(globals.mutex); - if ((global_settings = switch_xml_child(cfg, "global_settings"))) { - for (param = switch_xml_child(global_settings, "param"); param; param = param->next) { - char *var = (char *) switch_xml_attr_soft(param, "name"); - char *val = (char *) switch_xml_attr_soft(param, "value"); - - if (!strcasecmp(var, "debug")) { - DEBUGA_GSMOPEN("globals.debug=%d\n", GSMOPEN_P_LOG, globals.debug); - globals.debug = atoi(val); - DEBUGA_GSMOPEN("globals.debug=%d\n", GSMOPEN_P_LOG, globals.debug); - } else if (!strcasecmp(var, "hold-music")) { - switch_set_string(globals.hold_music, val); - DEBUGA_GSMOPEN("globals.hold_music=%s\n", GSMOPEN_P_LOG, globals.hold_music); - } else if (!strcmp(var, "dialplan")) { - set_global_dialplan(val); - DEBUGA_GSMOPEN("globals.dialplan=%s\n", GSMOPEN_P_LOG, globals.dialplan); - } else if (!strcmp(var, "destination")) { - set_global_destination(val); - DEBUGA_GSMOPEN("globals.destination=%s\n", GSMOPEN_P_LOG, globals.destination); - } else if (!strcmp(var, "context")) { - set_global_context(val); - DEBUGA_GSMOPEN("globals.context=%s\n", GSMOPEN_P_LOG, globals.context); - - } - - } - } - - if ((interfaces = switch_xml_child(cfg, "per_interface_settings"))) { - int i = 0; - - for (myinterface = switch_xml_child(interfaces, "interface"); myinterface; myinterface = myinterface->next) { - char *id = (char *) switch_xml_attr(myinterface, "id"); - char *name = (char *) switch_xml_attr(myinterface, "name"); - const char *context = "default"; - const char *dialplan = "XML"; - const char *destination = "5000"; - const char *controldevice_name = "/dev/ttyACM0"; - //char *digit_timeout; - //char *max_digits; - //char *hotline; - char *dial_regex = NULL; - char *hold_music = NULL; - char *fail_dial_regex = NULL; - //const char *enable_callerid ; - - - const char *at_dial_pre_number = "ATD"; - const char *at_dial_post_number = ";"; - const char *at_dial_expect = "OK"; - const char *at_hangup = "ATH"; - const char *at_hangup_expect = "OK"; - const char *at_answer = "ATA"; - const char *at_answer_expect = "OK"; - const char *at_send_dtmf = "AT+VTS"; - const char *at_preinit_1 = ""; - const char *at_preinit_1_expect = ""; - const char *at_preinit_2 = ""; - const char *at_preinit_2_expect = ""; - const char *at_preinit_3 = ""; - const char *at_preinit_3_expect = ""; - const char *at_preinit_4 = ""; - const char *at_preinit_4_expect = ""; - const char *at_preinit_5 = ""; - const char *at_preinit_5_expect = ""; - const char *at_postinit_1 = "at+cmic=0,9"; - const char *at_postinit_1_expect = "OK"; - const char *at_postinit_2 = "AT+CKPD=\"EEE\""; - const char *at_postinit_2_expect = "OK"; - const char *at_postinit_3 = "AT+CSSN=1,0"; - const char *at_postinit_3_expect = "OK"; - const char *at_postinit_4 = "at+sidet=0"; - const char *at_postinit_4_expect = "OK"; - const char *at_postinit_5 = "at+clvl=99"; - const char *at_postinit_5_expect = "OK"; - const char *at_query_battchg = "AT+CBC"; - const char *at_query_battchg_expect = "OK"; - const char *at_query_signal = "AT+CSQ"; - const char *at_query_signal_expect = "OK"; - const char *at_call_idle = "+MCST: 1"; - const char *at_call_incoming = "+MCST: 2"; - const char *at_call_active = "+CSSI: 7"; - const char *at_call_failed = "+MCST: 65"; - const char *at_call_calling = "+CSSI: 1"; - const char *at_indicator_noservice_string = "CIEV: 2;0"; - const char *at_indicator_nosignal_string = "CIEV: 5;0"; - const char *at_indicator_lowsignal_string = "CIEV: 5;1"; - const char *at_indicator_lowbattchg_string = "CIEV: 0;1"; - const char *at_indicator_nobattchg_string = "CIEV: 0;0"; - const char *at_indicator_callactive_string = "CIEV: 3;1"; - const char *at_indicator_nocallactive_string = "CIEV: 3;0"; - const char *at_indicator_nocallsetup_string = "CIEV: 6;0"; - const char *at_indicator_callsetupincoming_string = "CIEV: 6;1"; - const char *at_indicator_callsetupoutgoing_string = "CIEV: 6;2"; - const char *at_indicator_callsetupremoteringing_string = "CIEV: 6;3"; - //const char *sms_receiving_program = "/usr/local/bin/ciapalo"; - const char *alsacname = "plughw:1"; - const char *alsapname = "plughw:1"; - const char *at_early_audio = "0"; - const char *at_after_preinit_pause = "500000"; - const char *at_initial_pause = "500000"; - const char *at_has_clcc = "0"; - const char *at_has_ecam = "0"; - const char *alsa_period_size = "160"; - const char *alsa_periods_in_buffer = "4"; - const char *gsmopen_sound_rate = "8000"; - const char *alsa_play_is_mono = "1"; - const char *alsa_capture_is_mono = "1"; - const char *capture_boost = "5"; - const char *playback_boost = "10"; -#if defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) - const char *no_sound = "0"; -#else - const char *no_sound = "1"; -#endif // defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) -#ifdef GSMOPEN_PORTAUDIO - const char *portaudiocindex; - const char *portaudiopindex; - const char *speexecho; - const char *speexpreprocess; -#endif// GSMOPEN_PORTAUDIO - - uint32_t interface_id = 0; -#ifdef WIN32 - int controldevice_speed = 115200; //FIXME TODO -#else - uint32_t controldevice_speed = B115200; //FIXME TODO -#endif //WIN32 - uint32_t controldevprotocol = PROTOCOL_AT; //FIXME TODO - uint32_t running = 1; //FIXME TODO - const char *gsmopen_serial_sync_period = "300"; //FIXME TODO - - - - tech_pvt = NULL; - - for (param = switch_xml_child(myinterface, "param"); param; param = param->next) { - char *var = (char *) switch_xml_attr_soft(param, "name"); - char *val = (char *) switch_xml_attr_soft(param, "value"); - - if (!strcasecmp(var, "id")) { - id = val; - } else if (!strcasecmp(var, "name")) { - name = val; - } else if (!strcasecmp(var, "context")) { - context = val; - } else if (!strcasecmp(var, "dialplan")) { - dialplan = val; - } else if (!strcasecmp(var, "destination")) { - destination = val; - } else if (!strcasecmp(var, "controldevice_name")) { - controldevice_name = val; - //} else if (!strcasecmp(var, "digit_timeout")) { - //digit_timeout = val; - //} else if (!strcasecmp(var, "max_digits")) { - //max_digits = val; - //} else if (!strcasecmp(var, "hotline")) { - //hotline = val; - } else if (!strcasecmp(var, "dial_regex")) { - dial_regex = val; - } else if (!strcasecmp(var, SWITCH_HOLD_MUSIC_VARIABLE)) { - hold_music = val; - } else if (!strcasecmp(var, "fail_dial_regex")) { - fail_dial_regex = val; - //} else if (!strcasecmp(var, "enable_callerid")) { - //enable_callerid = val; - } else if (!strcasecmp(var, "at_dial_pre_number")) { - at_dial_pre_number = val; - } else if (!strcasecmp(var, "at_dial_post_number")) { - at_dial_post_number = val; - } else if (!strcasecmp(var, "at_dial_expect")) { - at_dial_expect = val; - } else if (!strcasecmp(var, "at_hangup")) { - at_hangup = val; - } else if (!strcasecmp(var, "at_hangup_expect")) { - at_hangup_expect = val; - } else if (!strcasecmp(var, "at_answer")) { - at_answer = val; - } else if (!strcasecmp(var, "at_answer_expect")) { - at_answer_expect = val; - } else if (!strcasecmp(var, "at_send_dtmf")) { - at_send_dtmf = val; - } else if (!strcasecmp(var, "at_preinit_1")) { - at_preinit_1 = val; - } else if (!strcasecmp(var, "at_preinit_1_expect")) { - at_preinit_1_expect = val; - } else if (!strcasecmp(var, "at_preinit_2")) { - at_preinit_2 = val; - } else if (!strcasecmp(var, "at_preinit_2_expect")) { - at_preinit_2_expect = val; - } else if (!strcasecmp(var, "at_preinit_3")) { - at_preinit_3 = val; - } else if (!strcasecmp(var, "at_preinit_3_expect")) { - at_preinit_3_expect = val; - } else if (!strcasecmp(var, "at_preinit_4")) { - at_preinit_4 = val; - } else if (!strcasecmp(var, "at_preinit_4_expect")) { - at_preinit_4_expect = val; - } else if (!strcasecmp(var, "at_preinit_5")) { - at_preinit_5 = val; - } else if (!strcasecmp(var, "at_preinit_5_expect")) { - at_preinit_5_expect = val; - } else if (!strcasecmp(var, "at_postinit_1")) { - at_postinit_1 = val; - } else if (!strcasecmp(var, "at_postinit_1_expect")) { - at_postinit_1_expect = val; - } else if (!strcasecmp(var, "at_postinit_2")) { - at_postinit_2 = val; - } else if (!strcasecmp(var, "at_postinit_2_expect")) { - at_postinit_2_expect = val; - } else if (!strcasecmp(var, "at_postinit_3")) { - at_postinit_3 = val; - } else if (!strcasecmp(var, "at_postinit_3_expect")) { - at_postinit_3_expect = val; - } else if (!strcasecmp(var, "at_postinit_4")) { - at_postinit_4 = val; - } else if (!strcasecmp(var, "at_postinit_4_expect")) { - at_postinit_4_expect = val; - } else if (!strcasecmp(var, "at_postinit_5")) { - at_postinit_5 = val; - } else if (!strcasecmp(var, "at_postinit_5_expect")) { - at_postinit_5_expect = val; - } else if (!strcasecmp(var, "at_query_battchg")) { - at_query_battchg = val; - } else if (!strcasecmp(var, "at_query_battchg_expect")) { - at_query_battchg_expect = val; - } else if (!strcasecmp(var, "at_query_signal")) { - at_query_signal = val; - } else if (!strcasecmp(var, "at_query_signal_expect")) { - at_query_signal_expect = val; - } else if (!strcasecmp(var, "at_call_idle")) { - at_call_idle = val; - } else if (!strcasecmp(var, "at_call_incoming")) { - at_call_incoming = val; - } else if (!strcasecmp(var, "at_call_active")) { - at_call_active = val; - } else if (!strcasecmp(var, "at_call_failed")) { - at_call_failed = val; - } else if (!strcasecmp(var, "at_call_calling")) { - at_call_calling = val; - } else if (!strcasecmp(var, "at_indicator_noservice_string")) { - at_indicator_noservice_string = val; - } else if (!strcasecmp(var, "at_indicator_nosignal_string")) { - at_indicator_nosignal_string = val; - } else if (!strcasecmp(var, "at_indicator_lowsignal_string")) { - at_indicator_lowsignal_string = val; - } else if (!strcasecmp(var, "at_indicator_lowbattchg_string")) { - at_indicator_lowbattchg_string = val; - } else if (!strcasecmp(var, "at_indicator_nobattchg_string")) { - at_indicator_nobattchg_string = val; - } else if (!strcasecmp(var, "at_indicator_callactive_string")) { - at_indicator_callactive_string = val; - } else if (!strcasecmp(var, "at_indicator_nocallactive_string")) { - at_indicator_nocallactive_string = val; - } else if (!strcasecmp(var, "at_indicator_nocallsetup_string")) { - at_indicator_nocallsetup_string = val; - } else if (!strcasecmp(var, "at_indicator_callsetupincoming_string")) { - at_indicator_callsetupincoming_string = val; - } else if (!strcasecmp(var, "at_indicator_callsetupoutgoing_string")) { - at_indicator_callsetupoutgoing_string = val; - } else if (!strcasecmp(var, "at_indicator_callsetupremoteringing_string")) { - at_indicator_callsetupremoteringing_string = val; - //} else if (!strcasecmp(var, "sms_receiving_program")) { - //sms_receiving_program = val; - } else if (!strcasecmp(var, "alsacname")) { - alsacname = val; - } else if (!strcasecmp(var, "alsapname")) { - alsapname = val; -#ifdef GSMOPEN_PORTAUDIO - } else if (!strcasecmp(var, "portaudiocindex")) { - portaudiocindex = val; - } else if (!strcasecmp(var, "portaudiopindex")) { - portaudiopindex = val; - } else if (!strcasecmp(var, "speexecho")) { - speexecho = val; - } else if (!strcasecmp(var, "speexpreprocess")) { - speexpreprocess = val; -#endif// GSMOPEN_PORTAUDIO - } else if (!strcasecmp(var, "at_early_audio")) { - at_early_audio = val; - } else if (!strcasecmp(var, "at_after_preinit_pause")) { - at_after_preinit_pause = val; - } else if (!strcasecmp(var, "at_initial_pause")) { - at_initial_pause = val; - } else if (!strcasecmp(var, "at_has_clcc")) { - at_has_clcc = val; - } else if (!strcasecmp(var, "at_has_ecam")) { - at_has_ecam = val; - } else if (!strcasecmp(var, "alsa_period_size")) { - alsa_period_size = val; - } else if (!strcasecmp(var, "alsa_periods_in_buffer")) { - alsa_periods_in_buffer = val; - } else if (!strcasecmp(var, "gsmopen_sound_rate")) { - gsmopen_sound_rate = val; - } else if (!strcasecmp(var, "alsa_play_is_mono")) { - alsa_play_is_mono = val; - } else if (!strcasecmp(var, "alsa_capture_is_mono")) { - alsa_capture_is_mono = val; - } else if (!strcasecmp(var, "capture_boost")) { - capture_boost = val; - } else if (!strcasecmp(var, "playback_boost")) { - playback_boost = val; - } else if (!strcasecmp(var, "no_sound")) { - no_sound = val; - } else if (!strcasecmp(var, "gsmopen_serial_sync_period")) { - gsmopen_serial_sync_period = val; - } - - - } - - /* BEGIN: Changes here */ - if (reload_type == SOFT_RELOAD) { - char the_interface[256]; - sprintf(the_interface, "#%s", name); - - if (interface_exists(the_interface) == SWITCH_STATUS_SUCCESS) { - continue; - } - } - /* END: Changes here */ - - if (!id) { - ERRORA("interface missing REQUIRED param 'id'\n", GSMOPEN_P_LOG); - continue; - } - - if (switch_is_number(id)) { - interface_id = atoi(id); - } else { - ERRORA("interface param 'id' MUST be a number, now id='%s'\n", GSMOPEN_P_LOG, id); - continue; - } - - if (!switch_is_number(at_early_audio)) { - ERRORA("interface param 'at_early_audio' MUST be a number, now at_early_audio='%s'\n", GSMOPEN_P_LOG, at_early_audio); - continue; - } - if (!switch_is_number(at_after_preinit_pause)) { - ERRORA("interface param 'at_after_preinit_pause' MUST be a number, now at_after_preinit_pause='%s'\n", GSMOPEN_P_LOG, - at_after_preinit_pause); - continue; - } - if (!switch_is_number(at_initial_pause)) { - ERRORA("interface param 'at_initial_pause' MUST be a number, now at_initial_pause='%s'\n", GSMOPEN_P_LOG, at_initial_pause); - continue; - } - if (!switch_is_number(at_has_clcc)) { - ERRORA("interface param 'at_has_clcc' MUST be a number, now at_has_clcc='%s'\n", GSMOPEN_P_LOG, at_has_clcc); - continue; - } - if (!switch_is_number(at_has_ecam)) { - ERRORA("interface param 'at_has_ecam' MUST be a number, now at_has_ecam='%s'\n", GSMOPEN_P_LOG, at_has_ecam); - continue; - } - if (!switch_is_number(alsa_period_size)) { - ERRORA("interface param 'alsa_period_size' MUST be a number, now alsa_period_size='%s'\n", GSMOPEN_P_LOG, alsa_period_size); - continue; - } - if (!switch_is_number(alsa_periods_in_buffer)) { - ERRORA("interface param 'alsa_periods_in_buffer' MUST be a number, now alsa_periods_in_buffer='%s'\n", GSMOPEN_P_LOG, - alsa_periods_in_buffer); - continue; - } - if (!switch_is_number(gsmopen_sound_rate)) { - ERRORA("interface param 'gsmopen_sound_rate' MUST be a number, now gsmopen_sound_rate='%s'\n", GSMOPEN_P_LOG, gsmopen_sound_rate); - continue; - } - if (!switch_is_number(alsa_play_is_mono)) { - ERRORA("interface param 'alsa_play_is_mono' MUST be a number, now alsa_play_is_mono='%s'\n", GSMOPEN_P_LOG, alsa_play_is_mono); - continue; - } - if (!switch_is_number(alsa_capture_is_mono)) { - ERRORA("interface param 'alsa_capture_is_mono' MUST be a number, now alsa_capture_is_mono='%s'\n", GSMOPEN_P_LOG, alsa_capture_is_mono); - continue; - } - if (!switch_is_number(capture_boost)) { - ERRORA("interface param 'capture_boost' MUST be a number, now capture_boost='%s'\n", GSMOPEN_P_LOG, capture_boost); - continue; - } - if (!switch_is_number(playback_boost)) { - ERRORA("interface param 'playback_boost' MUST be a number, now playback_boost='%s'\n", GSMOPEN_P_LOG, playback_boost); - continue; - } - if (!switch_is_number(no_sound)) { - ERRORA("interface param 'no_sound' MUST be a number, now no_sound='%s'\n", GSMOPEN_P_LOG, no_sound); - continue; - } - if (!switch_is_number(gsmopen_serial_sync_period)) { - ERRORA("interface param 'gsmopen_serial_sync_period' MUST be a number, now gsmopen_serial_sync_period='%s'\n", GSMOPEN_P_LOG, gsmopen_serial_sync_period); - continue; - } - - - if (interface_id && interface_id < GSMOPEN_MAX_INTERFACES) { - private_t newconf; - switch_threadattr_t *gsmopen_api_thread_attr = NULL; - int res = 0; - - memset(&newconf, '\0', sizeof(newconf)); - globals.GSMOPEN_INTERFACES[interface_id] = newconf; - - - tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; - - switch_mutex_init(&globals.GSMOPEN_INTERFACES[interface_id].controldev_lock, SWITCH_MUTEX_NESTED, gsmopen_module_pool); - - - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].id, id); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].name, name); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].context, context); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].dialplan, dialplan); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].destination, destination); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].controldevice_name, controldevice_name); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].dial_regex, dial_regex); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].hold_music, hold_music); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].fail_dial_regex, fail_dial_regex); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_dial_pre_number, at_dial_pre_number); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_dial_post_number, at_dial_post_number); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_dial_expect, at_dial_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_hangup, at_hangup); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_hangup_expect, at_hangup_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_answer, at_answer); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_answer_expect, at_answer_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_send_dtmf, at_send_dtmf); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_1, at_preinit_1); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_1_expect, at_preinit_1_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_2, at_preinit_2); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_2_expect, at_preinit_2_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_3, at_preinit_3); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_3_expect, at_preinit_3_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_4, at_preinit_4); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_4_expect, at_preinit_4_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_5, at_preinit_5); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_5_expect, at_preinit_5_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_1, at_postinit_1); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_1_expect, at_postinit_1_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_2, at_postinit_2); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_2_expect, at_postinit_2_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_3, at_postinit_3); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_3_expect, at_postinit_3_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_4, at_postinit_4); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_4_expect, at_postinit_4_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_5, at_postinit_5); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_5_expect, at_postinit_5_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_query_battchg, at_query_battchg); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_query_battchg_expect, at_query_battchg_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_query_signal, at_query_signal); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_query_signal_expect, at_query_signal_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_call_idle, at_call_idle); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_call_incoming, at_call_incoming); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_call_active, at_call_active); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_call_failed, at_call_failed); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_call_calling, at_call_calling); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_noservice_string, at_indicator_noservice_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_nosignal_string, at_indicator_nosignal_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_lowsignal_string, at_indicator_lowsignal_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_lowbattchg_string, at_indicator_lowbattchg_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_nobattchg_string, at_indicator_nobattchg_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_callactive_string, at_indicator_callactive_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_nocallactive_string, at_indicator_nocallactive_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_nocallsetup_string, at_indicator_nocallsetup_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_callsetupincoming_string, at_indicator_callsetupincoming_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_callsetupoutgoing_string, at_indicator_callsetupoutgoing_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_callsetupremoteringing_string, - at_indicator_callsetupremoteringing_string); - //switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].sms_receiving_program, sms_receiving_program); -#ifdef GSMOPEN_ALSA - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].alsacname, alsacname); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].alsapname, alsapname); -#endif// GSMOPEN_ALSA - -#ifdef GSMOPEN_PORTAUDIO - globals.GSMOPEN_INTERFACES[interface_id].portaudiocindex = atoi(portaudiocindex); - globals.GSMOPEN_INTERFACES[interface_id].portaudiopindex = atoi(portaudiopindex); - globals.GSMOPEN_INTERFACES[interface_id].speexecho = atoi(speexecho); - globals.GSMOPEN_INTERFACES[interface_id].speexpreprocess = atoi(speexpreprocess); -#endif// GSMOPEN_PORTAUDIO - globals.GSMOPEN_INTERFACES[interface_id].at_early_audio = atoi(at_early_audio); - globals.GSMOPEN_INTERFACES[interface_id].at_after_preinit_pause = atoi(at_after_preinit_pause); - globals.GSMOPEN_INTERFACES[interface_id].at_initial_pause = atoi(at_initial_pause); - globals.GSMOPEN_INTERFACES[interface_id].at_has_clcc = atoi(at_has_clcc); - globals.GSMOPEN_INTERFACES[interface_id].at_has_ecam = atoi(at_has_ecam); -#ifdef GSMOPEN_ALSA - globals.GSMOPEN_INTERFACES[interface_id].alsa_period_size = atoi(alsa_period_size); - globals.GSMOPEN_INTERFACES[interface_id].alsa_periods_in_buffer = atoi(alsa_periods_in_buffer); - globals.GSMOPEN_INTERFACES[interface_id].gsmopen_sound_rate = atoi(gsmopen_sound_rate); - globals.GSMOPEN_INTERFACES[interface_id].alsa_play_is_mono = atoi(alsa_play_is_mono); - globals.GSMOPEN_INTERFACES[interface_id].alsa_capture_is_mono = atoi(alsa_capture_is_mono); -#endif// GSMOPEN_ALSA - globals.GSMOPEN_INTERFACES[interface_id].capture_boost = atoi(capture_boost); - globals.GSMOPEN_INTERFACES[interface_id].playback_boost = atoi(playback_boost); -#if defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) - globals.GSMOPEN_INTERFACES[interface_id].no_sound = atoi(no_sound); -#else - globals.GSMOPEN_INTERFACES[interface_id].no_sound = 1; -#endif // defined(GSMOPEN_ALSA) || defined(GSMOPEN_PORTAUDIO) - globals.GSMOPEN_INTERFACES[interface_id].gsmopen_serial_sync_period = atoi(gsmopen_serial_sync_period); - - - - globals.GSMOPEN_INTERFACES[interface_id].controldevice_speed = controldevice_speed; //FIXME - globals.GSMOPEN_INTERFACES[interface_id].controldevprotocol = controldevprotocol; //FIXME - globals.GSMOPEN_INTERFACES[interface_id].running = running; //FIXME - - - - WARNINGA("STARTING interface_id=%d\n", GSMOPEN_P_LOG, interface_id); - DEBUGA_GSMOPEN("id=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].id); - DEBUGA_GSMOPEN("name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].name); - DEBUGA_GSMOPEN("hold-music=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].hold_music); - DEBUGA_GSMOPEN("context=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].context); - DEBUGA_GSMOPEN("dialplan=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].dialplan); - DEBUGA_GSMOPEN("destination=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].destination); - DEBUGA_GSMOPEN("controldevice_name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].controldevice_name); -#ifdef GSMOPEN_ALSA - DEBUGA_GSMOPEN("alsacname=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].alsacname); - DEBUGA_GSMOPEN("alsapname=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].alsapname); -#endif// GSMOPEN_ALSA - - -#ifdef GSMOPEN_PORTAUDIO - //FIXME - //globals.GSMOPEN_INTERFACES[interface_id].portaudiocindex = 1; - //globals.GSMOPEN_INTERFACES[interface_id].portaudiopindex = 1; - //globals.GSMOPEN_INTERFACES[interface_id].speexecho = 1; - //globals.GSMOPEN_INTERFACES[interface_id].speexpreprocess = 1; - DEBUGA_GSMOPEN("portaudiocindex=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].portaudiocindex); - DEBUGA_GSMOPEN("portaudiocindex=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].portaudiocindex); - DEBUGA_GSMOPEN("speexecho=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].speexecho); - DEBUGA_GSMOPEN("speexpreprocess=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].speexpreprocess); -#endif// GSMOPEN_PORTAUDIO - DEBUGA_GSMOPEN("gsmopen_serial_sync_period=%d\n", GSMOPEN_P_LOG, (int)globals.GSMOPEN_INTERFACES[interface_id].gsmopen_serial_sync_period); - /* init the serial port */ - if (globals.GSMOPEN_INTERFACES[interface_id].controldevprotocol != PROTOCOL_NO_SERIAL) { - globals.GSMOPEN_INTERFACES[interface_id].controldevfd = - gsmopen_serial_init(&globals.GSMOPEN_INTERFACES[interface_id], globals.GSMOPEN_INTERFACES[interface_id].controldevice_speed); - if (globals.GSMOPEN_INTERFACES[interface_id].controldevfd == -1) { - ERRORA("gsmopen_serial_init failed\n", GSMOPEN_P_LOG); - ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id); - //return SWITCH_STATUS_FALSE; - globals.GSMOPEN_INTERFACES[interface_id].running=0; - alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "gsmopen_serial_init failed"); - globals.GSMOPEN_INTERFACES[interface_id].active=0; - globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0'; - continue; - } - } - - /* config the phone/modem on the serial port */ - if (globals.GSMOPEN_INTERFACES[interface_id].controldevprotocol != PROTOCOL_NO_SERIAL) { - res = gsmopen_serial_config(&globals.GSMOPEN_INTERFACES[interface_id]); - if (res) { - int count = 0; - ERRORA("gsmopen_serial_config failed, let's try again\n", GSMOPEN_P_LOG); - while(res && count < 5){ - switch_sleep(100000); //0.1 seconds - res = gsmopen_serial_config(&globals.GSMOPEN_INTERFACES[interface_id]); - count++; - if (res) { - ERRORA("%d: gsmopen_serial_config failed, let's try again\n", GSMOPEN_P_LOG, count); - } - } - if (res) { - ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id); - //return SWITCH_STATUS_FALSE; - globals.GSMOPEN_INTERFACES[interface_id].running=0; - alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "gsmopen_serial_config failed"); - globals.GSMOPEN_INTERFACES[interface_id].active=0; - globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0'; - continue; - } - } - } - - if(globals.GSMOPEN_INTERFACES[interface_id].no_sound==0){ -#ifdef GSMOPEN_ALSA - if (alsa_init(&globals.GSMOPEN_INTERFACES[interface_id])) { - ERRORA("alsa_init failed\n", GSMOPEN_P_LOG); - ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id); - //return SWITCH_STATUS_FALSE; - globals.GSMOPEN_INTERFACES[interface_id].running=0; - alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "alsa_init failed"); - globals.GSMOPEN_INTERFACES[interface_id].active=0; - globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0'; - continue; - - } - - if (alsa_shutdown(&globals.GSMOPEN_INTERFACES[interface_id])) { - ERRORA("alsa_shutdown failed\n", GSMOPEN_P_LOG); - ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id); - //return SWITCH_STATUS_FALSE; - globals.GSMOPEN_INTERFACES[interface_id].running=0; - alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "alsa_shutdown failed"); - globals.GSMOPEN_INTERFACES[interface_id].active=0; - globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0'; - continue; - - } -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - if (gsmopen_portaudio_init(&globals.GSMOPEN_INTERFACES[interface_id])) { - ERRORA("gsmopen_portaudio_init failed\n", GSMOPEN_P_LOG); - ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id); - //return SWITCH_STATUS_FALSE; - globals.GSMOPEN_INTERFACES[interface_id].running=0; - alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "gsmopen_portaudio_init failed"); - globals.GSMOPEN_INTERFACES[interface_id].active=0; - globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0'; - continue; - - } - - if (gsmopen_portaudio_shutdown(&globals.GSMOPEN_INTERFACES[interface_id])) { - ERRORA("gsmopen_portaudio_shutdown failed\n", GSMOPEN_P_LOG); - ERRORA("STARTING interface_id=%d FAILED\n", GSMOPEN_P_LOG, interface_id); - //return SWITCH_STATUS_FALSE; - globals.GSMOPEN_INTERFACES[interface_id].running=0; - alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "gsmopen_portaudio_shutdown failed"); - globals.GSMOPEN_INTERFACES[interface_id].active=0; - globals.GSMOPEN_INTERFACES[interface_id].name[0]='\0'; - continue; - - } -#endif// GSMOPEN_PORTAUDIO - } - - globals.GSMOPEN_INTERFACES[interface_id].active=1; - - //gsmopen_store_boost((char *)"5", &globals.GSMOPEN_INTERFACES[interface_id].capture_boost); //FIXME - //gsmopen_store_boost((char *)"10", &globals.GSMOPEN_INTERFACES[interface_id].playback_boost); //FIXME - gsmopen_store_boost((char *) capture_boost, &globals.GSMOPEN_INTERFACES[interface_id].capture_boost); //FIXME - gsmopen_store_boost((char *) playback_boost, &globals.GSMOPEN_INTERFACES[interface_id].playback_boost); //FIXME - - switch_sleep(100000); - switch_threadattr_create(&gsmopen_api_thread_attr, gsmopen_module_pool); - switch_threadattr_stacksize_set(gsmopen_api_thread_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread, gsmopen_api_thread_attr, gsmopen_do_gsmopenapi_thread, - &globals.GSMOPEN_INTERFACES[interface_id], gsmopen_module_pool); - - switch_sleep(100000); - WARNINGA("STARTED interface_id=%d\n", GSMOPEN_P_LOG, interface_id); - - } else { - ERRORA("interface id %d is higher than GSMOPEN_MAX_INTERFACES (%d)\n", GSMOPEN_P_LOG, interface_id, GSMOPEN_MAX_INTERFACES); - alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "interface id is higher than GSMOPEN_MAX_INTERFACES"); - continue; - } - - } - - for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) { - if (strlen(globals.GSMOPEN_INTERFACES[i].name)) { - /* How many real intterfaces */ - globals.real_interfaces = i + 1; - - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - - DEBUGA_GSMOPEN("id=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].id); - DEBUGA_GSMOPEN("name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].name); - DEBUGA_GSMOPEN("context=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].context); - DEBUGA_GSMOPEN("hold-music=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].hold_music); - DEBUGA_GSMOPEN("dialplan=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].dialplan); - DEBUGA_GSMOPEN("destination=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].destination); - DEBUGA_GSMOPEN("controldevice_name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].controldevice_name); -#ifdef GSMOPEN_ALSA - DEBUGA_GSMOPEN("alsacname=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].alsacname); - DEBUGA_GSMOPEN("alsapname=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].alsapname); -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - DEBUGA_GSMOPEN("portaudiocindex=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].portaudiocindex); - DEBUGA_GSMOPEN("portaudiopindex=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].portaudiopindex); - DEBUGA_GSMOPEN("speexecho=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].speexecho); - DEBUGA_GSMOPEN("speexpreprocess=%d\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].speexpreprocess); -#endif// GSMOPEN_PORTAUDIO - DEBUGA_GSMOPEN("gsmopen_serial_sync_period=%d\n", GSMOPEN_P_LOG, (int)globals.GSMOPEN_INTERFACES[i].gsmopen_serial_sync_period); - - } - } - } - - switch_mutex_unlock(globals.mutex); - switch_xml_free(xml); - - return SWITCH_STATUS_SUCCESS; -} - -//static switch_status_t chat_send(const char *proto, const char *from, const char *to, const char *subject, const char *body, const char *type, const char *hint) -static switch_status_t chat_send(switch_event_t *message_event) -{ - char *user, *host, *f_user = NULL, *f_host = NULL, *f_resource = NULL; - private_t *tech_pvt = NULL; - int i = 0, found = 0; - - const char *proto; - const char *from; - const char *to; - const char *subject; - const char *body; - //const char *type; - const char *hint; - - proto = switch_event_get_header(message_event, "proto"); - from = switch_event_get_header(message_event, "from"); - to = switch_event_get_header(message_event, "to"); - subject = switch_event_get_header(message_event, "subject"); - body = switch_event_get_body(message_event); - //type = switch_event_get_header(message_event, "type"); - hint = switch_event_get_header(message_event, "hint"); - - switch_assert(proto != NULL); - - DEBUGA_GSMOPEN("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, hint=%s)\n", GSMOPEN_P_LOG, proto, from, to, subject, body, - hint ? hint : "NULL"); - - if (!to || !strlen(to)) { - ERRORA("Missing To: header.\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_SUCCESS; - } - - if ((!from && !hint) || (!strlen(from) && !strlen(hint))) { - ERRORA("Missing From: AND Hint: headers.\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_SUCCESS; - } - - if (from && (f_user = strdup(from))) { - if ((f_host = strchr(f_user, '@'))) { - *f_host++ = '\0'; - if ((f_resource = strchr(f_host, '/'))) { - *f_resource++ = '\0'; - } - } - } - - if (!strlen(hint)) { //FIXME FIXME FIXME - hint = from; - } - if (to && (user = strdup(to))) { - if ((host = strchr(user, '@'))) { - *host++ = '\0'; - } - - DEBUGA_GSMOPEN("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, hint=%s)\n", GSMOPEN_P_LOG, proto, from, to, subject, body, - hint ? hint : "NULL"); - if (hint && strlen(hint)) { - //in hint we receive the interface name to use - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].name, hint, strlen(hint)) == 0)) { - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - DEBUGA_GSMOPEN("Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", GSMOPEN_P_LOG, i, - globals.GSMOPEN_INTERFACES[i].name); - found = 1; - break; - } - } - } /* FIXME add a tech_pvt member for the SIM telephone number //else { - //we have no a predefined interface name to use (hint is NULL), so let's choose an interface from the username (from) - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].skype_user, from, strlen(from)) == 0)) { - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - DEBUGA_GSMOPEN("Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", GSMOPEN_P_LOG, i, globals.GSMOPEN_INTERFACES[i].name); - found = 1; - break; - } - } - } - */ - if (!found) { - ERRORA("ERROR: A GSMopen interface with name='%s' or one with SIM_number='%s' was not found\n", GSMOPEN_P_LOG, hint ? hint : "NULL", - from ? from : "NULL"); - goto end; - } else { - gsmopen_sendsms(tech_pvt, (char *) to, (char *) body); - } - } - end: - switch_safe_free(user); - switch_safe_free(f_user); - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t compat_chat_send(const char *proto, const char *from, const char *to, - const char *subject, const char *body, const char *type, const char *hint) -{ - switch_event_t *message_event; - switch_status_t status; - - if (switch_event_create(&message_event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "proto", proto); - switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "from", from); - switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "to", to); - switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "subject", subject); - switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "type", type); - switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "hint", hint); - - if (body) { - switch_event_add_body(message_event, "%s", body); - } - } else { - abort(); - } - - status = chat_send(message_event); - switch_event_destroy(&message_event); - - return status; - -} - -SWITCH_MODULE_LOAD_FUNCTION(mod_gsmopen_load) -{ - switch_api_interface_t *commands_api_interface; - switch_chat_interface_t *chat_interface; - - gsmopen_module_pool = pool; - memset(&globals, '\0', sizeof(globals)); - - running = 1; - - if (load_config(FULL_RELOAD) != SWITCH_STATUS_SUCCESS) { - running = 0; - return SWITCH_STATUS_FALSE; - } - - if (switch_event_reserve_subclass(MY_EVENT_INCOMING_SMS) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass!\n"); - return SWITCH_STATUS_GENERR; - } - - *module_interface = switch_loadable_module_create_module_interface(pool, modname); - gsmopen_endpoint_interface = (switch_endpoint_interface_t *) switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE); - gsmopen_endpoint_interface->interface_name = "gsmopen"; - gsmopen_endpoint_interface->io_routines = &gsmopen_io_routines; - gsmopen_endpoint_interface->state_handler = &gsmopen_state_handlers; - - if (running) { - -#if 1 - SWITCH_ADD_API(commands_api_interface, "gsm", "gsm console AT_command", gsm_function, GSM_SYNTAX); - SWITCH_ADD_API(commands_api_interface, "gsmopen", "gsmopen interface AT_command", gsmopen_function, GSMOPEN_SYNTAX); -#endif //0 - SWITCH_ADD_API(commands_api_interface, "gsmopen_boost_audio", "gsmopen_boost_audio interface AT_command", gsmopen_boost_audio_function, GSMOPEN_BOOST_AUDIO_SYNTAX); - SWITCH_ADD_API(commands_api_interface, "gsmopen_dump", "gsmopen_dump interface", gsmopen_dump_function, GSMOPEN_DUMP_SYNTAX); - SWITCH_ADD_API(commands_api_interface, "gsmopen_sendsms", "gsmopen_sendsms interface destination_number SMS_text", sendsms_function, - SENDSMS_SYNTAX); - SWITCH_ADD_CHAT(chat_interface, GSMOPEN_CHAT_PROTO, chat_send); - - /* indicate that the module should continue to be loaded */ - return SWITCH_STATUS_SUCCESS; - } else - return SWITCH_STATUS_FALSE; -} - -SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_gsmopen_shutdown) -{ - int x; - private_t *tech_pvt = NULL; - switch_status_t status; - unsigned int howmany = 8; - int interface_id; - int fd; - - running = 0; - - for (interface_id = 0; interface_id < GSMOPEN_MAX_INTERFACES; interface_id++) { - tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; - - if (strlen(globals.GSMOPEN_INTERFACES[interface_id].name)) { - WARNINGA("SHUTDOWN interface_id=%d\n", GSMOPEN_P_LOG, interface_id); - globals.GSMOPEN_INTERFACES[interface_id].running = 0; - if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_signaling_thread) { -#ifdef WIN32 - switch_file_write(tech_pvt->GSMopenHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die -#else /* WIN32 */ - howmany = write(tech_pvt->GSMopenHandles.fdesc[1], "sciutati", howmany); -#endif /* WIN32 */ - } - x = 10; - while (x) { //FIXME 0.5 seconds? - x--; - switch_yield(50000); - } - if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_signaling_thread) { - switch_thread_join(&status, globals.GSMOPEN_INTERFACES[interface_id].gsmopen_signaling_thread); - } - if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread) { - switch_thread_join(&status, globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread); - } - - x = 10; - while (x) { //FIXME 0.5 seconds? - x--; - switch_yield(50000); - } - fd = tech_pvt->controldevfd; - //DEBUGA_GSMOPEN("SHUTDOWN tech_pvt->controldevfd=%d\n", GSMOPEN_P_LOG, tech_pvt->controldevfd); - if (fd) { - //close(fd); - //tech_pvt->controldevfd = -1; - DEBUGA_GSMOPEN("SHUTDOWN tech_pvt->controldevfd=%d\n", GSMOPEN_P_LOG, tech_pvt->controldevfd); - } -#ifndef WIN32 - shutdown(tech_pvt->audiogsmopenpipe[0], 2); - close(tech_pvt->audiogsmopenpipe[0]); - shutdown(tech_pvt->audiogsmopenpipe[1], 2); - close(tech_pvt->audiogsmopenpipe[1]); - shutdown(tech_pvt->audiopipe[0], 2); - close(tech_pvt->audiopipe[0]); - shutdown(tech_pvt->audiopipe[1], 2); - close(tech_pvt->audiopipe[1]); - shutdown(tech_pvt->GSMopenHandles.fdesc[0], 2); - close(tech_pvt->GSMopenHandles.fdesc[0]); - shutdown(tech_pvt->GSMopenHandles.fdesc[1], 2); - close(tech_pvt->GSMopenHandles.fdesc[1]); -#endif /* WIN32 */ - } - - } - - switch_event_free_subclass(MY_EVENT_INCOMING_SMS); - - switch_safe_free(globals.dialplan); - switch_safe_free(globals.context); - switch_safe_free(globals.destination); - switch_safe_free(globals.codec_string); - switch_safe_free(globals.codec_rates_string); - - return SWITCH_STATUS_SUCCESS; -} - - -void *SWITCH_THREAD_FUNC gsmopen_do_gsmopenapi_thread(switch_thread_t * thread, void *obj) -{ - return gsmopen_do_gsmopenapi_thread_func(obj); -} - -int dtmf_received(private_t * tech_pvt, char *value) -{ - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - session = switch_core_session_locate(tech_pvt->session_uuid_str); - channel = switch_core_session_get_channel(session); - - if (channel) { - - if (!switch_channel_test_flag(channel, CF_BRIDGED)) { - - switch_dtmf_t dtmf = { (char) value[0], switch_core_default_dtmf_duration(0) }; - DEBUGA_GSMOPEN("received DTMF %c on channel %s\n", GSMOPEN_P_LOG, dtmf.digit, switch_channel_get_name(channel)); - switch_mutex_lock(tech_pvt->flag_mutex); - //FIXME: why sometimes DTMFs from here do not seems to be get by FS? - switch_channel_queue_dtmf(channel, &dtmf); - switch_set_flag(tech_pvt, TFLAG_DTMF); - switch_mutex_unlock(tech_pvt->flag_mutex); - } else { - DEBUGA_GSMOPEN - ("received a DTMF on channel %s, but we're BRIDGED, so let's NOT relay it out of band\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); - } - } else { - WARNINGA("received %c DTMF, but no channel?\n", GSMOPEN_P_LOG, value[0]); - } - switch_core_session_rwunlock(session); - - return 0; -} - -int new_inbound_channel(private_t * tech_pvt) -{ - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - switch_assert(tech_pvt != NULL); - tech_pvt->ib_calls++; - if ((session = switch_core_session_request(gsmopen_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, SOF_NONE, NULL)) != 0) { - DEBUGA_GSMOPEN("2 SESSION_REQUEST %s\n", GSMOPEN_P_LOG, switch_core_session_get_uuid(session)); - switch_core_session_add_stream(session, NULL); - channel = switch_core_session_get_channel(session); - if (!channel) { - ERRORA("Doh! no channel?\n", GSMOPEN_P_LOG); - switch_core_session_destroy(&session); - return 0; - } - if (gsmopen_tech_init(tech_pvt, session) != SWITCH_STATUS_SUCCESS) { - ERRORA("Doh! no tech_init?\n", GSMOPEN_P_LOG); - switch_core_session_destroy(&session); - return 0; - } - - if ((tech_pvt->caller_profile = - switch_caller_profile_new(switch_core_session_get_pool(session), "gsmopen", - tech_pvt->dialplan, tech_pvt->callid_name, - tech_pvt->callid_number, NULL, NULL, NULL, NULL, "mod_gsmopen", tech_pvt->context, tech_pvt->destination)) != 0) { - char name[128]; - //switch_snprintf(name, sizeof(name), "gsmopen/%s/%s", tech_pvt->name, tech_pvt->caller_profile->destination_number); - switch_snprintf(name, sizeof(name), "gsmopen/%s", tech_pvt->name); - switch_channel_set_name(channel, name); - switch_channel_set_caller_profile(channel, tech_pvt->caller_profile); - } - switch_channel_set_state(channel, CS_INIT); - if (switch_core_session_thread_launch(session) != SWITCH_STATUS_SUCCESS) { - ERRORA("Error spawning thread\n", GSMOPEN_P_LOG); - switch_core_session_destroy(&session); - return 0; - } - } - if (channel) { - //switch_channel_mark_answered(channel); - } - - DEBUGA_GSMOPEN("new_inbound_channel\n", GSMOPEN_P_LOG); - - return 0; -} - -int remote_party_is_ringing(private_t * tech_pvt) -{ - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - if (!zstr(tech_pvt->session_uuid_str)) { - session = switch_core_session_locate(tech_pvt->session_uuid_str); - } else { - ERRORA("No session???\n", GSMOPEN_P_LOG); - goto done; - } - if (session) { - channel = switch_core_session_get_channel(session); - } else { - ERRORA("No session???\n", GSMOPEN_P_LOG); - goto done; - } - if (channel) { - switch_channel_mark_ring_ready(channel); - DEBUGA_GSMOPEN("gsmopen_call: REMOTE PARTY RINGING\n", GSMOPEN_P_LOG); - } else { - ERRORA("No channel???\n", GSMOPEN_P_LOG); - } - - switch_core_session_rwunlock(session); - - done: - return 0; -} - -int remote_party_is_early_media(private_t * tech_pvt) -{ - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - if (!zstr(tech_pvt->session_uuid_str)) { - session = switch_core_session_locate(tech_pvt->session_uuid_str); - } else { - ERRORA("No session???\n\n\n", GSMOPEN_P_LOG); - //TODO: kill the bastard - goto done; - } - if (session) { - channel = switch_core_session_get_channel(session); - switch_core_session_add_stream(session, NULL); - } else { - ERRORA("No session???\n", GSMOPEN_P_LOG); - //TODO: kill the bastard - goto done; - } - if (channel) { - switch_channel_mark_pre_answered(channel); - DEBUGA_GSMOPEN("gsmopen_call: REMOTE PARTY EARLY MEDIA\n", GSMOPEN_P_LOG); - } else { - ERRORA("No channel???\n", GSMOPEN_P_LOG); - //TODO: kill the bastard - } - - switch_core_session_rwunlock(session); - - done: - return 0; -} - -int outbound_channel_answered(private_t * tech_pvt) -{ - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - if (!zstr(tech_pvt->session_uuid_str)) { - session = switch_core_session_locate(tech_pvt->session_uuid_str); - } else { - ERRORA("No session???\n", GSMOPEN_P_LOG); - goto done; - } - if (session) { - channel = switch_core_session_get_channel(session); - } else { - ERRORA("No channel???\n", GSMOPEN_P_LOG); - goto done; - } - if (channel) { - switch_channel_mark_answered(channel); - tech_pvt->phone_callflow = GSMOPEN_STATE_UP; - tech_pvt->interface_state = GSMOPEN_STATE_UP; - //DEBUGA_GSMOPEN("gsmopen_call: %s, answered\n", GSMOPEN_P_LOG, id); - } else { - ERRORA("No channel???\n", GSMOPEN_P_LOG); - } - - switch_core_session_rwunlock(session); - - done: - DEBUGA_GSMOPEN("outbound_channel_answered!\n", GSMOPEN_P_LOG); - - return 0; -} - -private_t *find_available_gsmopen_interface_rr(private_t * tech_pvt_calling) -{ - private_t *tech_pvt = NULL; - int i; - //int num_interfaces = GSMOPEN_MAX_INTERFACES; - //int num_interfaces = globals.real_interfaces; - - switch_mutex_lock(globals.mutex); - - /* Fact is the real interface start from 1 */ - //XXX no, is just a convention, but you can have it start from 0. I do not, for aestetic reasons :-) - //if (globals.next_interface == 0) globals.next_interface = 1; - - for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) { - int interface_id; - - interface_id = globals.next_interface; - //interface_id = interface_id < GSMOPEN_MAX_INTERFACES ? interface_id : interface_id - GSMOPEN_MAX_INTERFACES + 1; - globals.next_interface = interface_id + 1 < GSMOPEN_MAX_INTERFACES ? interface_id + 1 : 0; - - if (strlen(globals.GSMOPEN_INTERFACES[interface_id].name)) { - int gsmopen_state = 0; - - tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; - gsmopen_state = tech_pvt->interface_state; - DEBUGA_GSMOPEN("gsmopen interface: %d, name: %s, state: %d\n", GSMOPEN_P_LOG, interface_id, globals.GSMOPEN_INTERFACES[interface_id].name, - gsmopen_state); - if ((tech_pvt_calling ? strcmp(tech_pvt->gsmopen_user, tech_pvt_calling->gsmopen_user) : 1) - && (GSMOPEN_STATE_DOWN == gsmopen_state || 0 == gsmopen_state) && (tech_pvt->phone_callflow == CALLFLOW_STATUS_FINISHED - || 0 == tech_pvt->phone_callflow)) { - DEBUGA_GSMOPEN("returning as available gsmopen interface name: %s, state: %d callflow: %d\n", GSMOPEN_P_LOG, tech_pvt->name, gsmopen_state, - tech_pvt->phone_callflow); - /*set to Dialing state to avoid other thread fint it, don't know if it is safe */ - //XXX no, it's not safe - if (tech_pvt_calling == NULL) { - tech_pvt->interface_state = GSMOPEN_STATE_SELECTED; - } - - switch_mutex_unlock(globals.mutex); - return tech_pvt; - } - } // else { - //DEBUGA_GSMOPEN("GSM interface: %d blank!! A hole here means we cannot hunt the last interface.\n", GSMOPEN_P_LOG, interface_id); - //} - } - - switch_mutex_unlock(globals.mutex); - return NULL; -} - -#if 1 -SWITCH_STANDARD_API(gsm_function) -{ - char *mycmd = NULL, *argv[10] = { 0 }; - int argc = 0; - - if (globals.gsm_console) - stream->write_function(stream, "gsm console is: |||%s|||\n", globals.gsm_console->name); - else - stream->write_function(stream, "gsm console is NOT yet assigned\n"); - - if (!zstr(cmd) && (mycmd = strdup(cmd))) { - argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); - } - - if (!argc || !argv[0]) { - stream->write_function(stream, "%s", GSM_SYNTAX); - goto end; - } - - if (!strcasecmp(argv[0], "list")) { - int i; - char next_flag_char = ' '; - - stream->write_function(stream, "F ID\t Name \tIB (F/T) OB (F/T)\tState\tCallFlw\t\tUUID\n"); - stream->write_function(stream, "= ====\t ======== \t======= =======\t======\t============\t======\n"); - - for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) { - next_flag_char = i == globals.next_interface ? '*' : ' '; - - if (strlen(globals.GSMOPEN_INTERFACES[i].name)) { - stream->write_function(stream, - "%c %d\t[%s]\t%3ld/%ld\t%6ld/%ld\t%s\t%s\t%s\n", - next_flag_char, - i, globals.GSMOPEN_INTERFACES[i].name, - globals.GSMOPEN_INTERFACES[i].ib_failed_calls, - globals.GSMOPEN_INTERFACES[i].ib_calls, - globals.GSMOPEN_INTERFACES[i].ob_failed_calls, - globals.GSMOPEN_INTERFACES[i].ob_calls, - interface_status[globals.GSMOPEN_INTERFACES[i].interface_state], - phone_callflow[globals.GSMOPEN_INTERFACES[i].phone_callflow], globals.GSMOPEN_INTERFACES[i].session_uuid_str); - } else if (argc > 1 && !strcasecmp(argv[1], "full")) { - stream->write_function(stream, "%c\t%d\n", next_flag_char, i); - } - - } - stream->write_function(stream, "\nTotal: %d\n", globals.real_interfaces - 1); - - } else if (!strcasecmp(argv[0], "console")) { - int i; - int found = 0; - - if (argc == 2) { - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ - if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[1], strlen(argv[1])) == 0)) { - globals.gsm_console = &globals.GSMOPEN_INTERFACES[i]; - stream->write_function(stream, "gsm console is now: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", i, - globals.GSMOPEN_INTERFACES[i].name); - stream->write_function(stream, "gsm console is: |||%s|||\n", globals.gsm_console->name); - found = 1; - break; - } - - } - if (!found) - stream->write_function(stream, "ERROR: A GSMopen interface with name='%s' was not found\n", argv[1]); - } else { - - stream->write_function(stream, "-ERR Usage: gsm console interface_name\n"); - goto end; - } - - } else if (!strcasecmp(argv[0], "ciapalino")) { - -/* BEGIN: Changes heres */ - } else if (!strcasecmp(argv[0], "reload")) { - if (load_config(SOFT_RELOAD) != SWITCH_STATUS_SUCCESS) { - stream->write_function(stream, "gsm reload failed\n"); - } else { - stream->write_function(stream, "gsm reload success\n"); - } - } else if (!strcasecmp(argv[0], "remove")) { - if (argc == 2) { - if (remove_interface(argv[1]) == SWITCH_STATUS_SUCCESS) { - if (interface_exists(argv[1]) == SWITCH_STATUS_SUCCESS) { - stream->write_function(stream, "gsm remove '%s' failed\n", argv[1]); - } else { - stream->write_function(stream, "gsm remove '%s' success\n", argv[1]); - } - } - } else { - stream->write_function(stream, "-ERR Usage: gsm remove interface_name\n"); - goto end; - } -/* END: Changes heres */ - - } else { - if (globals.gsm_console) - gsmopen_serial_write_AT_noack(globals.gsm_console, (char *) cmd); - else - stream->write_function(stream, "gsm console is NOT yet assigned\n"); - } - end: - switch_safe_free(mycmd); - - return SWITCH_STATUS_SUCCESS; -} - -SWITCH_STANDARD_API(gsmopen_function) -{ - char *mycmd = NULL, *argv[10] = { 0 }; - int argc = 0; - private_t *tech_pvt = NULL; - - if (!zstr(cmd) && (mycmd = strdup(cmd))) { - argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); - } - - if (!argc) { - stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_SYNTAX); - goto end; - } - - if (argc < 2) { - stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_SYNTAX); - goto end; - } - - if (argv[0]) { - int i; - int found = 0; - - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ - if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - stream->write_function(stream, "Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", i, globals.GSMOPEN_INTERFACES[i].name); - found = 1; - break; - } - - } - if (!found) { - stream->write_function(stream, "ERROR: A GSMopen interface with name='%s' was not found\n", argv[0]); - switch_safe_free(mycmd); - - return SWITCH_STATUS_SUCCESS; - } else { - gsmopen_serial_write_AT_noack(tech_pvt, (char *) &cmd[strlen(argv[0]) + 1]); - } - } else { - stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_SYNTAX); - } - end: - switch_safe_free(mycmd); - - return SWITCH_STATUS_SUCCESS; -} -#endif //0 -SWITCH_STANDARD_API(gsmopen_dump_function) -{ - char *mycmd = NULL, *argv[10] = { 0 }; - int argc = 0; - private_t *tech_pvt = NULL; - char value[512]; - - if (!zstr(cmd) && (mycmd = strdup(cmd))) { - argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); - } - - if (!argc) { - stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_DUMP_SYNTAX); - goto end; - } - if (argc == 1) { - int i; - int found = 0; - - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ - if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - //stream->write_function(stream, "Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", i, globals.GSMOPEN_INTERFACES[i].name); - found = 1; - break; - } - - } - if (!found && (strcmp("list", argv[0]) == 0)) { - int i; - stream->write_function(stream, "gsmopen_dump LIST\n\n"); - for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) { - if (strlen(globals.GSMOPEN_INTERFACES[i].name)) { - stream->write_function(stream, "dumping interface '%s'\n\n", globals.GSMOPEN_INTERFACES[i].name); - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - - - stream->write_function(stream, "interface_name = %s\n", tech_pvt->name); - stream->write_function(stream, "interface_id = %s\n", tech_pvt->id); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->active); - stream->write_function(stream, "active = %s\n", value); - if(!tech_pvt->network_creg_not_supported){ - snprintf(value, sizeof(value)-1, "%d", tech_pvt->not_registered); - stream->write_function(stream, "not_registered = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->home_network_registered); - stream->write_function(stream, "home_network_registered = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->roaming_registered); - stream->write_function(stream, "roaming_registered = %s\n", value); - }else{ - stream->write_function(stream, "not_registered = %s\n", "N/A"); - stream->write_function(stream, "home_network_registered = %s\n", "N/A"); - stream->write_function(stream, "roaming_registered = %s\n", "N/A"); - } - snprintf(value, sizeof(value)-1, "%d", tech_pvt->got_signal); - stream->write_function(stream, "got_signal = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->running); - stream->write_function(stream, "running = %s\n", value); - stream->write_function(stream, "imei = %s\n", tech_pvt->imei); - stream->write_function(stream, "imsi = %s\n", tech_pvt->imsi); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->controldev_dead); - stream->write_function(stream, "controldev_dead = %s\n", value); - stream->write_function(stream, "controldevice_name = %s\n", tech_pvt->controldevice_name); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->no_sound); - stream->write_function(stream, "no_sound = %s\n", value); -#ifdef GSMOPEN_ALSA - stream->write_function(stream, "alsacname = %s\n", tech_pvt->alsacname); - stream->write_function(stream, "alsapname = %s\n", tech_pvt->alsapname); -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiocindex); - stream->write_function(stream, "portaudiocindex = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiopindex); - stream->write_function(stream, "portaudiopindex = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexecho); - stream->write_function(stream, "speexecho = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexpreprocess); - stream->write_function(stream, "speexpreprocess = %s\n", value); -#endif// GSMOPEN_PORTAUDIO - snprintf(value, sizeof(value)-1, "%f", tech_pvt->playback_boost); - stream->write_function(stream, "playback_boost = %s\n", value); - snprintf(value, sizeof(value)-1, "%f", tech_pvt->capture_boost); - stream->write_function(stream, "capture_boost = %s\n", value); - stream->write_function(stream, "dialplan = %s\n", tech_pvt->dialplan); - stream->write_function(stream, "context = %s\n", tech_pvt->context); - stream->write_function(stream, "destination = %s\n", tech_pvt->destination); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_calls); - stream->write_function(stream, "ib_calls = %s\n", value); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_calls); - stream->write_function(stream, "ob_calls = %s\n", value); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_failed_calls); - stream->write_function(stream, "ib_failed_calls = %s\n", value); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_failed_calls); - stream->write_function(stream, "ob_failed_calls = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->interface_state); - stream->write_function(stream, "interface_state = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->phone_callflow); - stream->write_function(stream, "phone_callflow = %s\n", value); - stream->write_function(stream, "session_uuid_str = %s\n", tech_pvt->session_uuid_str); - stream->write_function(stream, "\n"); - - dump_event(tech_pvt); - } - - } - - } else if(found){ - stream->write_function(stream, "dumping interface '%s'\n\n", argv[0]); - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - - - stream->write_function(stream, "interface_name = %s\n", tech_pvt->name); - stream->write_function(stream, "interface_id = %s\n", tech_pvt->id); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->active); - stream->write_function(stream, "active = %s\n", value); - if(!tech_pvt->network_creg_not_supported){ - snprintf(value, sizeof(value)-1, "%d", tech_pvt->not_registered); - stream->write_function(stream, "not_registered = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->home_network_registered); - stream->write_function(stream, "home_network_registered = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->roaming_registered); - stream->write_function(stream, "roaming_registered = %s\n", value); - }else{ - stream->write_function(stream, "not_registered = %s\n", "N/A"); - stream->write_function(stream, "home_network_registered = %s\n", "N/A"); - stream->write_function(stream, "roaming_registered = %s\n", "N/A"); - } - snprintf(value, sizeof(value)-1, "%d", tech_pvt->got_signal); - stream->write_function(stream, "got_signal = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->running); - stream->write_function(stream, "running = %s\n", value); - stream->write_function(stream, "imei = %s\n", tech_pvt->imei); - stream->write_function(stream, "imsi = %s\n", tech_pvt->imsi); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->controldev_dead); - stream->write_function(stream, "controldev_dead = %s\n", value); - stream->write_function(stream, "controldevice_name = %s\n", tech_pvt->controldevice_name); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->no_sound); - stream->write_function(stream, "no_sound = %s\n", value); -#ifdef GSMOPEN_ALSA - stream->write_function(stream, "alsacname = %s\n", tech_pvt->alsacname); - stream->write_function(stream, "alsapname = %s\n", tech_pvt->alsapname); -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiocindex); - stream->write_function(stream, "portaudiocindex = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiopindex); - stream->write_function(stream, "portaudiopindex = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexecho); - stream->write_function(stream, "speexecho = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexpreprocess); - stream->write_function(stream, "speexpreprocess = %s\n", value); -#endif// GSMOPEN_PORTAUDIO - snprintf(value, sizeof(value)-1, "%f", tech_pvt->playback_boost); - stream->write_function(stream, "playback_boost = %s\n", value); - snprintf(value, sizeof(value)-1, "%f", tech_pvt->capture_boost); - stream->write_function(stream, "capture_boost = %s\n", value); - stream->write_function(stream, "dialplan = %s\n", tech_pvt->dialplan); - stream->write_function(stream, "context = %s\n", tech_pvt->context); - stream->write_function(stream, "destination = %s\n", tech_pvt->destination); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_calls); - stream->write_function(stream, "ib_calls = %s\n", value); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_calls); - stream->write_function(stream, "ob_calls = %s\n", value); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_failed_calls); - stream->write_function(stream, "ib_failed_calls = %s\n", value); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_failed_calls); - stream->write_function(stream, "ob_failed_calls = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->interface_state); - stream->write_function(stream, "interface_state = %s\n", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->phone_callflow); - stream->write_function(stream, "phone_callflow = %s\n", value); - stream->write_function(stream, "session_uuid_str = %s\n", tech_pvt->session_uuid_str); - stream->write_function(stream, "\n"); - - dump_event(tech_pvt); - } else{ - stream->write_function(stream, "interface '%s' was not found\n", argv[0]); - } - } else { - stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_DUMP_SYNTAX); - } -end: - switch_safe_free(mycmd); - - return SWITCH_STATUS_SUCCESS; -} -SWITCH_STANDARD_API(gsmopen_boost_audio_function) -{ - char *mycmd = NULL, *argv[10] = { 0 }; - int argc = 0; - //private_t *tech_pvt; - - if (!zstr(cmd) && (mycmd = strdup(cmd))) { - argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); - } - - if (argc == 1 || argc==3) { - int i; - int found = 0; - - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ - if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { - //tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - stream->write_function(stream, "Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", i, globals.GSMOPEN_INTERFACES[i].name); - found = 1; - break; - } - - } - if (!found) { - stream->write_function(stream, "ERROR: A GSMopen interface with name='%s' was not found\n", argv[0]); - - } else { - if (argc == 1) { - stream->write_function(stream,"[%s] capture boost is %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].capture_boost); - stream->write_function(stream,"[%s] playback boost is %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].playback_boost); - stream->write_function(stream, "%s usage: %s", argv[0], GSMOPEN_BOOST_AUDIO_SYNTAX); - goto end; - } else if ((strncmp("play", argv[1], strlen(argv[1])) == 0)) { - if (switch_is_number(argv[2])) { - stream->write_function(stream,"[%s] playback boost was %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].playback_boost); - gsmopen_store_boost(argv[2], &globals.GSMOPEN_INTERFACES[i].playback_boost); //FIXME - stream->write_function(stream,"[%s] playback boost is now %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].playback_boost); - } - }else if ((strncmp("capt", argv[1], strlen(argv[1])) == 0)) { - if (switch_is_number(argv[2])) { - stream->write_function(stream,"[%s] capture boost was %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].capture_boost); - gsmopen_store_boost(argv[2], &globals.GSMOPEN_INTERFACES[i].capture_boost); //FIXME - stream->write_function(stream,"[%s] capture boost is now %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].capture_boost); - } - } else { - stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_BOOST_AUDIO_SYNTAX); - } - } - } else { - stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_BOOST_AUDIO_SYNTAX); - } - end: - switch_safe_free(mycmd); - - return SWITCH_STATUS_SUCCESS; -} - - -#if 0 -int gsmopen_transfer(private_t * tech_pvt, char *id, char *value) -{ - char msg_to_gsmopen[1024]; - int i; - int found = 0; - private_t *giovatech; - struct timeval timenow; - - switch_mutex_lock(globals.mutex); - - gettimeofday(&timenow, NULL); - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - if (strlen(globals.GSMOPEN_INTERFACES[i].name)) { - - giovatech = &globals.GSMOPEN_INTERFACES[i]; - //NOTICA("gsmopen interface: %d, name: %s, state: %d, value=%s, giovatech->callid_number=%s, giovatech->gsmopen_user=%s\n", GSMOPEN_P_LOG, i, giovatech->name, giovatech->interface_state, value, giovatech->callid_number, giovatech->gsmopen_user); - //FIXME check a timestamp here - if (strlen(giovatech->gsmopen_call_id) && (giovatech->interface_state != GSMOPEN_STATE_DOWN) && (!strcmp(giovatech->gsmopen_user, tech_pvt->gsmopen_user)) && (!strcmp(giovatech->callid_number, value)) && ((((timenow.tv_sec - giovatech->answer_time.tv_sec) * 1000000) + (timenow.tv_usec - giovatech->answer_time.tv_usec)) < 500000)) { //0.5sec - found = 1; - DEBUGA_GSMOPEN - ("FOUND (name=%s, giovatech->interface_state=%d != GSMOPEN_STATE_DOWN) && (giovatech->gsmopen_user=%s == tech_pvt->gsmopen_user=%s) && (giovatech->callid_number=%s == value=%s)\n", - GSMOPEN_P_LOG, giovatech->name, giovatech->interface_state, giovatech->gsmopen_user, tech_pvt->gsmopen_user, giovatech->callid_number, - value) - break; - } - } - } - - if (found) { - //tech_pvt->callid_number[0]='\0'; - //sprintf(msg_to_gsmopen, "ALTER CALL %s END HANGUP", id); - //gsmopen_signaling_write(tech_pvt, msg_to_gsmopen); - switch_mutex_unlock(globals.mutex); - return 0; - } - DEBUGA_GSMOPEN("NOT FOUND\n", GSMOPEN_P_LOG); - - if (!tech_pvt || !tech_pvt->gsmopen_call_id || !strlen(tech_pvt->gsmopen_call_id)) { - /* we are not inside an active call */ - DEBUGA_GSMOPEN("We're NO MORE in a call now %s\n", GSMOPEN_P_LOG, (tech_pvt && tech_pvt->gsmopen_call_id) ? tech_pvt->gsmopen_call_id : ""); - switch_mutex_unlock(globals.mutex); - - } else { - - /* we're owned, we're in a call, let's try to transfer */ - /************************** TODO - Checking here if it is possible to transfer this call to Test2 - -> GET CALL 288 CAN_TRANSFER Test2 - <- CALL 288 CAN_TRANSFER test2 TRUE - **********************************/ - - private_t *available_gsmopen_interface = NULL; - - gettimeofday(&timenow, NULL); - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - if (strlen(globals.GSMOPEN_INTERFACES[i].name)) { - - giovatech = &globals.GSMOPEN_INTERFACES[i]; - //NOTICA("gsmopen interface: %d, name: %s, state: %d, value=%s, giovatech->callid_number=%s, giovatech->gsmopen_user=%s\n", GSMOPEN_P_LOG, i, giovatech->name, giovatech->interface_state, value, giovatech->callid_number, giovatech->gsmopen_user); - //FIXME check a timestamp here - if (strlen(giovatech->gsmopen_transfer_call_id) && (giovatech->interface_state != GSMOPEN_STATE_DOWN) && (!strcmp(giovatech->gsmopen_user, tech_pvt->gsmopen_user)) && (!strcmp(giovatech->transfer_callid_number, value)) && ((((timenow.tv_sec - giovatech->transfer_time.tv_sec) * 1000000) + (timenow.tv_usec - giovatech->transfer_time.tv_usec)) < 1000000)) { //1.0 sec - found = 1; - DEBUGA_GSMOPEN - ("FOUND (name=%s, giovatech->interface_state=%d != GSMOPEN_STATE_DOWN) && (giovatech->gsmopen_user=%s == tech_pvt->gsmopen_user=%s) && (giovatech->transfer_callid_number=%s == value=%s)\n", - GSMOPEN_P_LOG, giovatech->name, giovatech->interface_state, - giovatech->gsmopen_user, tech_pvt->gsmopen_user, giovatech->transfer_callid_number, value) - break; - } - } - } - - if (found) { - //tech_pvt->callid_number[0]='\0'; - //sprintf(msg_to_gsmopen, "ALTER CALL %s END HANGUP", id); - //gsmopen_signaling_write(tech_pvt, msg_to_gsmopen); - switch_mutex_unlock(globals.mutex); - return 0; - } - DEBUGA_GSMOPEN("NOT FOUND\n", GSMOPEN_P_LOG); - - available_gsmopen_interface = find_available_gsmopen_interface_rr(tech_pvt); - if (available_gsmopen_interface) { - /* there is a gsmopen interface idle, let's transfer the call to it */ - - //FIXME write a timestamp here - gettimeofday(&tech_pvt->transfer_time, NULL); - switch_copy_string(tech_pvt->gsmopen_transfer_call_id, id, sizeof(tech_pvt->gsmopen_transfer_call_id) - 1); - - switch_copy_string(tech_pvt->transfer_callid_number, value, sizeof(tech_pvt->transfer_callid_number) - 1); - - DEBUGA_GSMOPEN - ("Let's transfer the gsmopen_call %s to %s interface (with gsmopen_user: %s), because we are already in a gsmopen call(%s)\n", - GSMOPEN_P_LOG, tech_pvt->gsmopen_call_id, available_gsmopen_interface->name, available_gsmopen_interface->gsmopen_user, id); - - //FIXME why this? the inbound call will come, eventually, on that other interface - //available_gsmopen_interface->ib_calls++; - - sprintf(msg_to_gsmopen, "ALTER CALL %s TRANSFER %s", id, available_gsmopen_interface->gsmopen_user); - //gsmopen_signaling_write(tech_pvt, msg_to_gsmopen); - if (tech_pvt->interface_state == GSMOPEN_STATE_SELECTED) { - tech_pvt->interface_state = GSMOPEN_STATE_IDLE; //we marked it GSMOPEN_STATE_SELECTED just in case it has to make an outbound call - } - } else { - /* no gsmopen interfaces idle, do nothing */ - DEBUGA_GSMOPEN - ("Not answering the gsmopen_call %s, because we are already in a gsmopen call(%s) and not transferring, because no other gsmopen interfaces are available\n", - GSMOPEN_P_LOG, id, tech_pvt->gsmopen_call_id); - sprintf(msg_to_gsmopen, "ALTER CALL %s END HANGUP", id); - //gsmopen_signaling_write(tech_pvt, msg_to_gsmopen); - } - switch_sleep(10000); - DEBUGA_GSMOPEN - ("We have NOT answered a GSM RING from gsmopen_call %s, because we are already in a gsmopen call (%s)\n", - GSMOPEN_P_LOG, id, tech_pvt->gsmopen_call_id); - - switch_mutex_unlock(globals.mutex); - } - return 0; -} -#endif //0 - -void *gsmopen_do_gsmopenapi_thread_func(void *obj) -{ - - private_t *tech_pvt = (private_t *) obj; - time_t now_timestamp; - - //if (gsmopen_present(GSMopenHandles)) - while (running && tech_pvt->running) { - int res; - //gsmopen_sleep(1000000); //1 sec - //DEBUGA_GSMOPEN("ciao!\n", GSMOPEN_P_LOG); - res = gsmopen_serial_read(tech_pvt); - if (res == -1) { //manage the graceful interface shutdown - tech_pvt->controldev_dead = 1; - close(tech_pvt->controldevfd); - ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->running=0; - alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); - tech_pvt->active=0; - tech_pvt->name[0]='\0'; - switch_sleep(1000000); - } else if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL && tech_pvt->interface_state == GSMOPEN_STATE_RING - && tech_pvt->phone_callflow != CALLFLOW_CALL_HANGUP_REQUESTED) { - //WARNINGA("INCOMING RING\n", GSMOPEN_P_LOG); - - gsmopen_ring(tech_pvt); - - //FIXME gsmopen_answer(tech_pvt); - //new_inbound_channel(tech_pvt); - //FIXME if (!gsmopen_new(p, AST_STATE_RING, tech_pvt->context)) { - //FIXME ERRORA("gsmopen_new failed! BAD BAD BAD\n", GSMOPEN_P_LOG); - //FIXME } - - - } else if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL && tech_pvt->interface_state == GSMOPEN_STATE_DIALING) { - WARNINGA("WE'RE DIALING, let's take the earlymedia\n", GSMOPEN_P_LOG); - tech_pvt->interface_state = CALLFLOW_STATUS_EARLYMEDIA; - remote_party_is_early_media(tech_pvt); - //new_inbound_channel(tech_pvt); - //FIXME if (!gsmopen_new(p, AST_STATE_RING, tech_pvt->context)) { - //FIXME ERRORA("gsmopen_new failed! BAD BAD BAD\n", GSMOPEN_P_LOG); - //FIXME } - - - - - } else if (tech_pvt->interface_state == CALLFLOW_CALL_REMOTEANSWER) { - WARNINGA("REMOTE PARTY ANSWERED\n", GSMOPEN_P_LOG); - outbound_channel_answered(tech_pvt); - //new_inbound_channel(tech_pvt); - //FIXME if (!gsmopen_new(p, AST_STATE_RING, tech_pvt->context)) { - //FIXME ERRORA("gsmopen_new failed! BAD BAD BAD\n", GSMOPEN_P_LOG); - //FIXME } - } - switch_sleep(100); //give other threads a chance - time(&now_timestamp); - - if ((now_timestamp - tech_pvt->gsmopen_serial_synced_timestamp) > tech_pvt->gsmopen_serial_sync_period) { //TODO find a sensible period. 5min? in config? - gsmopen_serial_sync(tech_pvt); - gsmopen_serial_getstatus_AT(tech_pvt); - } - } - DEBUGA_GSMOPEN("EXIT\n", GSMOPEN_P_LOG); - //running = 0; - return NULL; - -} - - -SWITCH_STANDARD_API(sendsms_function) -{ - char *mycmd = NULL, *argv[3] = { 0 }; - int argc = 0; - private_t *tech_pvt = NULL; - - if (!zstr(cmd) && (mycmd = strdup(cmd))) { - argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); - } - - if (!argc) { - stream->write_function(stream, "ERROR, usage: %s", SENDSMS_SYNTAX); - goto end; - } - - if (argc < 3) { - stream->write_function(stream, "ERROR, usage: %s", SENDSMS_SYNTAX); - goto end; - } - - if (argv[0]) { - int i; - int found = 0; - - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ - if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - stream->write_function(stream, "Trying to send your SMS: interface=%s, dest=%s, text=%s\n", argv[0], argv[1], argv[2]); - found = 1; - break; - } - - } - if (!found) { - stream->write_function(stream, "ERROR: A GSMopen interface with name='%s' was not found\n", argv[0]); - switch_safe_free(mycmd); - - return SWITCH_STATUS_SUCCESS; - } else { - //gsmopen_sendsms(tech_pvt, (char *) argv[1], (char *) argv[2]); - NOTICA("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=NULL, hint=%s)\n", GSMOPEN_P_LOG, GSMOPEN_CHAT_PROTO, tech_pvt->name, - argv[1], "SIMPLE MESSAGE", switch_str_nil(argv[2]), tech_pvt->name); - - compat_chat_send(GSMOPEN_CHAT_PROTO, tech_pvt->name, argv[1], "SIMPLE MESSAGE", switch_str_nil(argv[2]), NULL, tech_pvt->name); - } - } else { - stream->write_function(stream, "ERROR, usage: %s", SENDSMS_SYNTAX); - } - end: - switch_safe_free(mycmd); - - return SWITCH_STATUS_SUCCESS; -} - -int dump_event_full(private_t * tech_pvt, int is_alarm, int alarm_code, const char *alarm_message) -{ - switch_event_t *event; - char value[512]; - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - switch_status_t status; - - session = switch_core_session_locate(tech_pvt->session_uuid_str); - if(session){ - channel = switch_core_session_get_channel(session); - } - - if (is_alarm){ - ERRORA("ALARM on interface %s: \n", GSMOPEN_P_LOG, tech_pvt->name ); - status = switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_ALARM); - }else{ - DEBUGA_GSMOPEN("DUMP on interface %s: \n", GSMOPEN_P_LOG, tech_pvt->name ); - status = switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_DUMP); - } - if (status == SWITCH_STATUS_SUCCESS) { - if (is_alarm){ - snprintf(value, sizeof(value)-1, "%d", alarm_code); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alarm_code", value); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alarm_message", alarm_message); - } - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface_name", tech_pvt->name); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface_id", tech_pvt->id); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->active); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "active", value); - if(!tech_pvt->network_creg_not_supported){ - snprintf(value, sizeof(value)-1, "%d", tech_pvt->not_registered); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "not_registered", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->home_network_registered); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "home_network_registered", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->roaming_registered); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "roaming_registered", value); - }else{ - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "not_registered", "N/A"); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "home_network_registered", "N/A"); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "roaming_registered", "N/A"); - } - snprintf(value, sizeof(value)-1, "%d", tech_pvt->got_signal); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "got_signal", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->running); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "running", value); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "imei", tech_pvt->imei); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "imsi", tech_pvt->imsi); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->controldev_dead); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "controldev_dead", value); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "controldevice_name", tech_pvt->controldevice_name); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->no_sound); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "no_sound", value); -#ifdef GSMOPEN_ALSA - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alsacname", tech_pvt->alsacname); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alsapname", tech_pvt->alsapname); -#endif// GSMOPEN_ALSA -#ifdef GSMOPEN_PORTAUDIO - snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiocindex); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "portaudiocindex", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiopindex); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "portaudiopindex", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexecho); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "speexecho", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexpreprocess); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "speexpreprocess", value); -#endif// GSMOPEN_PORTAUDIO - snprintf(value, sizeof(value)-1, "%f", tech_pvt->playback_boost); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "playback_boost", value); - snprintf(value, sizeof(value)-1, "%f", tech_pvt->capture_boost); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "capture_boost", value); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialplan", tech_pvt->dialplan); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "context", tech_pvt->context); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "destination", tech_pvt->destination); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_calls); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ib_calls", value); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_calls); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ob_calls", value); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_failed_calls); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ib_failed_calls", value); - snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_failed_calls); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ob_failed_calls", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->interface_state); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface_state", value); - snprintf(value, sizeof(value)-1, "%d", tech_pvt->phone_callflow); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "phone_callflow", value); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "session_uuid_str", tech_pvt->session_uuid_str); - if (strlen(tech_pvt->session_uuid_str)) { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "true"); - } else { //no session - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "false"); - } - if (channel) { - switch_channel_event_set_data(channel, event); - } - switch_event_fire(&event); - } else { - ERRORA("cannot create event on interface %s. WHY?????\n", GSMOPEN_P_LOG, tech_pvt->name); - } - - if (session) { - switch_core_session_rwunlock(session); - } - return 0; -} - -int dump_event(private_t * tech_pvt) -{ - return dump_event_full(tech_pvt, 0, 0, NULL); -} - - -int alarm_event(private_t * tech_pvt, int alarm_code, const char *alarm_message) -{ - return dump_event_full(tech_pvt, 1, alarm_code, alarm_message); -} - -int sms_incoming(private_t * tech_pvt) -{ - switch_event_t *event; - switch_core_session_t *session = NULL; - int event_sent_to_esl = 0; - - //DEBUGA_GSMOPEN("received SMS on interface %s: %s\n", GSMOPEN_P_LOG, tech_pvt->name, tech_pvt->sms_message); - DEBUGA_GSMOPEN("received SMS on interface %s: DATE=%s, SENDER=%s, BODY=%s|\n", GSMOPEN_P_LOG, tech_pvt->name, tech_pvt->sms_date, tech_pvt->sms_sender, - tech_pvt->sms_body); - - if (!zstr(tech_pvt->session_uuid_str)) { - session = switch_core_session_locate(tech_pvt->session_uuid_str); - } - if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", GSMOPEN_CHAT_PROTO); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", tech_pvt->name); - //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hint", tech_pvt->chatmessages[which].from_dispname); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", tech_pvt->sms_sender); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "date", tech_pvt->sms_date); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "userdataheader", tech_pvt->sms_userdataheader); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "datacodingscheme", tech_pvt->sms_datacodingscheme); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "servicecentreaddress", tech_pvt->sms_servicecentreaddress); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "messagetype", "%d", tech_pvt->sms_messagetype); - //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "chatname", tech_pvt->chatmessages[which].chatname); - //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "id", tech_pvt->chatmessages[which].id); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "subject", "SIMPLE MESSAGE"); - switch_event_add_body(event, "%s\n", tech_pvt->sms_body); - if (session) { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "true"); - if (switch_core_session_queue_event(session, &event) != SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "delivery-failure", "true"); - switch_event_fire(&event); - } - } else { //no session - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "false"); - switch_event_fire(&event); - event_sent_to_esl = 1; - } - - } else { - ERRORA("cannot create event on interface %s. WHY?????\n", GSMOPEN_P_LOG, tech_pvt->name); - } - - if (!event_sent_to_esl) { - - if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", GSMOPEN_CHAT_PROTO); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", tech_pvt->name); - //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hint", tech_pvt->chatmessages[which].from_dispname); - //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", tech_pvt->chatmessages[which].from_handle); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", tech_pvt->sms_sender); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "date", tech_pvt->sms_date); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "datacodingscheme", tech_pvt->sms_datacodingscheme); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "servicecentreaddress", tech_pvt->sms_servicecentreaddress); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "messagetype", "%d", tech_pvt->sms_messagetype); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "subject", "SIMPLE MESSAGE"); - //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "chatname", tech_pvt->chatmessages[which].chatname); - //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "id", tech_pvt->chatmessages[which].id); - switch_event_add_body(event, "%s\n", tech_pvt->sms_body); - if (session) { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "true"); - } else { //no session - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "false"); - } - switch_event_fire(&event); - } else { - ERRORA("cannot create event on interface %s. WHY?????\n", GSMOPEN_P_LOG, tech_pvt->name); - } - } - - if (session) { - switch_core_session_rwunlock(session); - } - //memset(&tech_pvt->chatmessages[which], '\0', sizeof(&tech_pvt->chatmessages[which]) ); - //memset(tech_pvt->sms_message, '\0', sizeof(tech_pvt->sms_message)); - return 0; -} - - -#ifdef NOTDEF -SWITCH_STANDARD_API(gsmopen_chat_function) -{ - char *mycmd = NULL, *argv[10] = { 0 }; - int argc = 0; - private_t *tech_pvt = NULL; - //int tried =0; - int i; - int found = 0; - //char skype_msg[1024]; - - if (!zstr(cmd) && (mycmd = strdup(cmd))) { - argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); - } - - if (!argc) { - stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_CHAT_SYNTAX); - goto end; - } - - if (argc < 3) { - stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_CHAT_SYNTAX); - goto end; - } - - if (argv[0]) { - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ - if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - stream->write_function(stream, "Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", i, globals.GSMOPEN_INTERFACES[i].name); - found = 1; - break; - } - - } - if (!found) { - stream->write_function(stream, "ERROR: A GSMopen interface with name='%s' was not found\n", argv[0]); - goto end; - } else { - - //chat_send(const char *proto, const char *from, const char *to, const char *subject, const char *body, const char *type, const char *hint); - //chat_send(p*roto, const char *from, const char *to, const char *subject, const char *body, const char *type, const char *hint); - //chat_send(GSMOPEN_CHAT_PROTO, tech_pvt->skype_user, argv[1], "SIMPLE MESSAGE", switch_str_nil((char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]), NULL, hint); - - NOTICA("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=NULL, hint=%s)\n", GSMOPEN_P_LOG, GSMOPEN_CHAT_PROTO, tech_pvt->skype_user, - argv[1], "SIMPLE MESSAGE", switch_str_nil((char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]), tech_pvt->name); - - chat_send(GSMOPEN_CHAT_PROTO, tech_pvt->skype_user, argv[1], "SIMPLE MESSAGE", - switch_str_nil((char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]), NULL, tech_pvt->name); - - //NOTICA("TEXT is: %s\n", GSMOPEN_P_LOG, (char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1] ); - //snprintf(skype_msg, sizeof(skype_msg), "CHAT CREATE %s", argv[1]); - //gsmopen_signaling_write(tech_pvt, skype_msg); - //switch_sleep(100); - } - } else { - stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_CHAT_SYNTAX); - goto end; - } - -#ifdef NOTDEF - - found = 0; - - while (!found) { - for (i = 0; i < MAX_CHATS; i++) { - if (!strcmp(tech_pvt->chats[i].dialog_partner, argv[1])) { - snprintf(skype_msg, sizeof(skype_msg), "CHATMESSAGE %s %s", tech_pvt->chats[i].chatname, - (char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]); - gsmopen_signaling_write(tech_pvt, skype_msg); - found = 1; - break; - } - } - if (found) { - break; - } - if (tried > 1000) { - stream->write_function(stream, "ERROR: no chat with dialog_partner='%s' was found\n", argv[1]); - break; - } - switch_sleep(1000); - } -#endif //NOTDEF - - end: - switch_safe_free(mycmd); - - return SWITCH_STATUS_SUCCESS; -} -#endif // NOTDEF - - -/* For Emacs: - * Local Variables: - * mode:c - * indent-tabs-mode:t - * tab-width:4 - * c-basic-offset:4 - * End: - * For VIM: - * vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet expandtab: - */ diff --git a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/usb-cm-108-2.txt b/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/usb-cm-108-2.txt deleted file mode 100644 index 551f42bab6..0000000000 --- a/src/mod/endpoints/mod_gsmopen/alsa_nogsmlib_nocplusplus/mod_gsmopen/usb-cm-108-2.txt +++ /dev/null @@ -1,62 +0,0 @@ -state.default { - control.1 { - comment.access 'read write' - comment.type BOOLEAN - comment.count 1 - iface MIXER - name 'Mic Playback Switch' - value false - } - control.2 { - comment.access 'read write' - comment.type INTEGER - comment.count 1 - comment.range '0 - 32' - iface MIXER - name 'Mic Playback Volume' - value 0 - } - control.3 { - comment.access 'read write' - comment.type BOOLEAN - comment.count 1 - iface MIXER - name 'Speaker Playback Switch' - value true - } - control.4 { - comment.access 'read write' - comment.type INTEGER - comment.count 2 - comment.range '0 - 151' - iface MIXER - name 'Speaker Playback Volume' - value.0 6 - value.1 6 - } - control.5 { - comment.access 'read write' - comment.type BOOLEAN - comment.count 1 - iface MIXER - name 'Mic Capture Switch' - value true - } - control.6 { - comment.access 'read write' - comment.type INTEGER - comment.count 1 - comment.range '0 - 16' - iface MIXER - name 'Mic Capture Volume' - value 5 - } - control.7 { - comment.access 'read write' - comment.type BOOLEAN - comment.count 1 - iface MIXER - name 'Auto Gain Control' - value false - } -} diff --git a/src/mod/endpoints/mod_gsmopen/asterisk/Makefile b/src/mod/endpoints/mod_gsmopen/asterisk/Makefile deleted file mode 100644 index 6aed86266e..0000000000 --- a/src/mod/endpoints/mod_gsmopen/asterisk/Makefile +++ /dev/null @@ -1,81 +0,0 @@ -# -# Asterisk -- A telephony toolkit for Linux. -# -# Makefile for channel drivers -# -# Copyright (C) 1999-2005, Mark Spencer -# -# Mark Spencer -# -# Edited By Belgarath <> Aug 28 2004 -# Added bare bones ultrasparc-linux support. -# -# This program is free software, distributed under the terms of -# the GNU General Public License -# - -#ASTERISK INCLUDE FILES -#The directory that contains the Asterisk include files (eg: /usr/include or /usr/include/asterisk or /usr/src/asterisk/include or ...) -#AST_INCLUDE_DIR=/usr/src/off_dev/asterisk-1.2.rev137401/include -AST_INCLUDE_DIR=/usr/src/asterisk-1.4.27.1/include -#AST_INCLUDE_DIR=/usr/src/asterisk-1.6.0.10/include - -#ASTERISK VERSION -#Uncomment one of the following lines to match your Asterisk series -#CFLAGS+=-DASTERISK_VERSION_1_2 -CFLAGS+=-DASTERISK_VERSION_1_4 -#CFLAGS+=-DASTERISK_VERSION_1_6_0 - -CFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -CFLAGS+=-g3 - - - -CFLAGS+=-I$(AST_INCLUDE_DIR) -I. -CFLAGS+=-D_REENTRANT -D_GNU_SOURCE -#CFLAGS+=-O6 -#CFLAGS+=-march=i586 -CFLAGS+=-fomit-frame-pointer -ifeq ($(shell uname -m),x86_64) -CFLAGS+=-fPIC -endif - -SVNDEF := -D'CELLIAX_SVN_VERSION="$(shell svnversion -n .)"' -CFLAGS += $(SVNDEF) - - -SOLINK=-shared -Xlinker -x -CHANNEL_LIBS=chan_celliax.so -CC=gcc - -OSARCH=$(shell uname -s) - -ifeq ($(findstring CYGWIN,$(OSARCH)),CYGWIN) -# definition of pthread_kill as a printf (or as a noop) is required for Asterisk (and celliax) to run on Cygwin -# without it, each time (often) pthread_kill is called (by any thread, with any signal, URG included), bad things happen -CC=gcc -D pthread_kill=cyg_no_pthreadkill -AST_DLL_DIR=/home/maruzz/devel/svn_asterisk_branches_12 -CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols cyg_no_pthread_kill.o -CYGSOLIB=-L/usr/lib/w32api -lrpcrt4 -L/lib/mingw -lwinmm -L$(AST_DLL_DIR) -lasterisk.dll -L$(AST_DLL_DIR)/res -lres_features.so -CHANNEL_LIBS=cyg_no_pthread_kill.o chan_celliax.so -endif - -all: $(CHANNEL_LIBS) - -clean: - rm -f *.so *.o *.so.a - - -#chan_celliax section begins - -#to debug threads and lock on 1.4 uncomment the following -#CFLAGS+=-include /usr/src/asterisk/include/asterisk/autoconfig.h - -cyg_no_pthread_kill.o: cyg_no_pthread_kill.c - $(CC) $(CFLAGS) -c -o cyg_no_pthread_kill.o cyg_no_pthread_kill.c -chan_celliax.o: chan_celliax.c - $(CC) $(CFLAGS) -c -o chan_celliax.o chan_celliax.c -chan_celliax.so: chan_celliax.o celliax_spandsp.o celliax_libcsv.o celliax_additional.o - $(CC) $(SOLINK) -o $@ ${CYGSOLINK} chan_celliax.o celliax_spandsp.o celliax_libcsv.o celliax_additional.o -lm -ldl -lasound ${CYGSOLIB} -#chan_celliax section ends - diff --git a/src/mod/endpoints/mod_gsmopen/asterisk/README b/src/mod/endpoints/mod_gsmopen/asterisk/README deleted file mode 100644 index c5921ca6b3..0000000000 --- a/src/mod/endpoints/mod_gsmopen/asterisk/README +++ /dev/null @@ -1,96 +0,0 @@ -************************************************************** -* CHAN_CELLIAX DRIVER FOR AN EXISTING ASTERISK INSTALLATION -* (works for Asterisk 1.2.xx 1.4.xx 1.6.0.xx series) -* (do NOT works for Asterisk 1.6.1.xx series) -************************************************************** -============================================================== -1) To build celliax you need the ALSA development libraries -============================================================== - -To build celliax on Linux you need to install ALSA-dev libs - -You can do it on Debian/Ubuntu with: -# apt-get install libasound2-dev - -You can do it on Fedora/CentOS with: -# yum --nogpgcheck -y install alsa-lib-devel - -=============================================================== -2) build chan_celliax -=============================================================== - -go into the celliax source directory, edit the Makefile, -insert the asterisk version (1.2.x or 1.4.x or 1.6.0.x, -NOT 1.6.1.x), the location of your asterisk sources, then - -# make clean -# make - -copy chan_celliax.so in the asterisk modules directory - -=============================================================== -2) configure chan_celliax and asterisk -=============================================================== - -edit and copy celliax.conf in the asterisk configuration -directory - -copy ciapalo (or your program that accepts text in stdini) in -the location defined in celliax.conf (sms_receiving_program) - -edit modules.conf and put noload in front of *BOTH* chan_oss.so -AND chan_alsa.so AND chan_console.so - -copy asound.conf in /etc/asound.conf - -if you enable debug in logger.conf and "set debug 100" on -Asterisk, you'll get *a lot* of info on celliax inner workings - -=============================================================== -3) Troubleshooting -=============================================================== -Check that you set the correct serial device in celliax.conf -You can check how the device is called on your platform with: -dmesg | grep ttyU -dmesg | grep ttyA - -Check that you set the correct audio device in celliax.conf -You can check how the device is called on your platform with: -aplay -l -it will give you the number to put on "plughw:N" in celliax.conf - -Check the volume for both play and capture, and that capture -is activated (press spacebar when alsamixer in capture mode) -alsamixer -c[soundcard_number] -Vplay -alsamixer -c[soundcard_number] -Vcapture -we found good results with capt(31) autogain(on) speaker(75) - -If you get double digits (bounces) on DTMFs, check if the capture -volume is too high - -The SMSs are managed in Unicode (UTF8) for international characters -compatibility. Check that your console and/or text editor displays -UTF8 characters - -If you have bad sound, it's a timing problem. Use a 1000HZ kernel, -or add a timing device (ztdummy or zaptel interfaces) -*************************************************************** -* END CHAN_CELLIAX DRIVER FOR AN EXISTING ASTERISK INSTALLATION -*************************************************************** - - - -chan_celliax adds to Asterisk the DIALPLAN application: - - CelliaxSendsms - -You can type at the Asterisk CLI 'show application [application]' -to obtain more specific info on usage. - - - -Enjoy! - --giovanni - -< gmaruzz at gmail dot com > diff --git a/src/mod/endpoints/mod_gsmopen/asterisk/asound.conf b/src/mod/endpoints/mod_gsmopen/asterisk/asound.conf deleted file mode 100644 index 71d6119670..0000000000 --- a/src/mod/endpoints/mod_gsmopen/asterisk/asound.conf +++ /dev/null @@ -1,2 +0,0 @@ -#defaults.pcm.rate_converter "speexrate" -defaults.pcm.rate_converter "linear" diff --git a/src/mod/endpoints/mod_gsmopen/asterisk/celliax.conf b/src/mod/endpoints/mod_gsmopen/asterisk/celliax.conf deleted file mode 100644 index 1b84c577d8..0000000000 --- a/src/mod/endpoints/mod_gsmopen/asterisk/celliax.conf +++ /dev/null @@ -1,205 +0,0 @@ -;; -;; -; Celliax Asterisk Driver -; -; Configuration file -; lines beginning with semicolon (" are ignored (commented out) -; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; -; The first interface (named line0) -[line0] -;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;; -; general settings, valid on all platforms -; -; -; Default language -; -language=en -; -; Default context (is overridden with @context syntax) -; -context=default -; -; Default extension (in extensions.conf) where incoming calls land -; -extension=s -; -;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;; -; Debugging settings, valid globally for all interfaces on all platforms -; -; the debug values are global for all the interfaces. -; -; default is no celliax debugging output, you **have** to activate debugging here to obtain debugging from celliax -; -; To see the debugging output you have to "set debug 100" from the Asterisk CLI or launch -; Asterisk with -ddddddddddd option, and have the logger.conf file activating debug info for console and messages -; -; You can activate each of the following separately, but you can't disactivate. Eg: debug_at=no does not subtract debug_at from debug_all -; debug_all activate all possible debugging info -; -;debug_all=yes -debug_at=yes -;debug_fbus2=yes -debug_serial=yes -debug_pbx=yes -debug_sound=yes -;debug_locks=yes -debug_call=yes -;debug_monitorlocks=yes -;debug_cvm=yes - -;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;; -; This is the program that will receive in stdin the incoming SMSs -sms_receiving_program=/usr/local/asterisk/usr/sbin/ciapalo - -;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;; -; serial settings, valid for all platforms -; -;control_device_protocol can be AT or FBUS2 or NO_SERIAL (with NO_SERIAL the speed and name of the port are ignored) -control_device_protocol=at - -;speed of the serial port -control_device_speed=115200 - -;name of the serial port device -control_device_name=/dev/ttyACM0 ; this is a Celliax Official Device, recognized as a modem by Linux -;control_device_name=/dev/ttyUSB0 ; this is an alternative form of a Celliax Official Device, recognized as a modem by Linux - -;watch the soundcard for noise (ring), because the serial port do not tell us about incoming calls (eg 3310nokia), NO_SERIAL protocol watch for acoustic ring in any case -need_acoustic_ring=0 - -;audio noise threshold beyond which we declare there is a ring (512 is default, put it to 1024 or 2048 if you have false positive), ignored if not watching for ring -dsp_silence_threshold=1024 - -;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;; -; audio boost settings, valid for all platforms, to compensate for different soundcard/phone input/output signal levels -; tweak it if you get horrible (or not hearable) sound -; -;boost can be positive or negative (-40 to +40) in db -;experiment to find which values are best for your soundcard -playback_boost=0 ; -capture_boost=0 ; - -;;;;;;;;;;;;;;;;;;;;;;;;;;; -; which audio device to use -;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;names of the sound devices in linux -;if you don't use skype on this interface (eg don't need to share the audio device with other applications while celliax is running), use the plughw:n devices (plughw:0 is the first, plughw:1 is the second soundcard, etc). They have the best latency -;if you use skype on this interface use the default:n devices (default:0 is the first, default:1 is the second soundcard, etc). They have worst latency, but you can share them - -alsa_capture_device_name=plughw:1 -alsa_playback_device_name=plughw:1 - -alsa_period_size=160 -alsa_periods_in_buffer=4 - -;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;; -; at "modem" commands settings for this interface (if controldevice_protocol is not AT they are ignored) -; -;what the modem is expecting in the part of the dial command before the number to be dialed (eg: ATD) -;at_dial_pre_number=AT+CKPD="EEE -at_dial_pre_number=ATD -;what the modem is expecting in the part of the dial command after the number to be dialed. If you want it to wait for a semicolon (;), just comment out the followin line. Wait for semicolon is the default -;at_dial_post_number=S" -;what the modem will answer after succesful execution of the dial command -at_dial_expect=OK - -;command to hangup the current call -;at_hangup=AT+CKPD="EEE" -at_hangup=ATH -;what the modem will answer after succesful execution of the hangup command -at_hangup_expect=OK - -;command to answer an incoming call -at_answer=ATA -;what the modem will answer after succesful execution of the answer command -at_answer_expect=OK - -;pause right after serial port opening, before any command is sent, in usecs (1million usec= 1sec) -at_initial_pause=500000 -;custom commands to be sent after the initial pause and before the "built in" initialization commands, and what the modem is expected to send as reply -;the first empty string stop the preinit sending -at_preinit_1=atciapa ; nonsense entry, just to show the preinit -at_preinit_1_expect=OK -at_preinit_2= -at_preinit_2_expect= -at_preinit_3= -at_preinit_3_expect= -at_preinit_4= -at_preinit_4_expect= -at_preinit_5= -at_preinit_5_expect= -;pause right after the custom preinit commands, before any "built in" command is sent, in usecs (1million usec= 1sec) -at_after_preinit_pause=500000 -;custom commands to be sent after the "built in" initialization commands, and what the modem is expected to send as reply -;the first empty string stop the postinit sending -;at_postinit_1=atcucu ; nonsense entry, just to show the postinit -at_postinit_1=at+cmic=0,9 ; modem's microphone sensitivity (our spk) -at_postinit_1_expect=OK -at_postinit_2=AT+CKPD="EEE" ;send three "end" buttonpress, to have the phone in a sane state, ready to dialing with furter CKPDs ***THIS IS IMPORTANT, needed on c650*** -at_postinit_2_expect=OK -at_postinit_3=AT+CSSN=1,0 -at_postinit_3_expect=OK -at_postinit_4=at+sidet=0 ; no sidetone in modem, please -at_postinit_4_expect=OK -at_postinit_5=at+clvl=99 ; modem's speaker level, out mic -at_postinit_5_expect=OK - -;what command to query the battery status, and what the modem is expected to send as reply -at_query_battchg=AT+CBC -at_query_battchg_expect=OK -;what command to query the signal status, and what the modem is expected to send as reply -at_query_signal=AT+CSQ -at_query_signal_expect=OK - -;what command to send a DTMF -at_send_dtmf=AT+VTS - -;the modem will send us the following messages to signal that the visual indicators on the phone has changed because of events (without us to ask for them), loosely based on ETSI standard (see CIND/CIEV/CMER in ETSI). Variable by manufacturer and phone model -; no service -at_indicator_noservice_string=+CIEV: 2,0 -; no signal -at_indicator_nosignal_string=+CIEV: 5,0 -; low signal -at_indicator_lowsignal_string=+CIEV: 5,1 -; low battery -at_indicator_lowbattchg_string=+CIEV: 0,1 -; no battery battery -at_indicator_nobattchg_string=+CIEV: 0,0 -; call is up -at_indicator_callactive_string=+CIEV: 3,1 -; call is down -at_indicator_nocallactive_string=+CIEV: 3,0 -; call is no more in process -at_indicator_nocallsetup_string=+CIEV: 6,0 -; call incoming is in process -at_indicator_callsetupincoming_string=+CIEV: 6,1 -; call outgoing is in process -at_indicator_callsetupoutgoing_string=+CIEV: 6,2 -; remote party is ringing because of our call outgoing -at_indicator_callsetupremoteringing_string=+CIEV: 6,3 - -;call processing unsolicited messages, proprietary for each phone manufacturer -;the modem will send us the following mesage to signal that the line is idle (eg. after an outgoing call has failed, or after hangup) -at_call_idle=+MCST: 1 -;the modem will send us the following mesage to signal that there is an incoming voice call -at_call_incoming=+MCST: 2 -;the modem will send us the following mesage to signal that there is an active call (eg. the remote party has answered us, or we answered them) -;at_call_active=+MCST: 3 -at_call_active=+CSSI: 7 -;the modem will send us the following mesage to signal that our outgoing call has failed -at_call_failed=+MCST: 65 -;the modem will send us the following mesage to signal that our outgoing call is in the calling phase -;at_call_calling=+MCST: 64 -at_call_calling=+CSSI: 1 - diff --git a/src/mod/endpoints/mod_gsmopen/asterisk/celliax.h b/src/mod/endpoints/mod_gsmopen/asterisk/celliax.h deleted file mode 100644 index ed8c2b122c..0000000000 --- a/src/mod/endpoints/mod_gsmopen/asterisk/celliax.h +++ /dev/null @@ -1,909 +0,0 @@ -//indent -gnu -ts4 -br -brs -cdw -lp -ce -nbfda -npcs -nprs -npsl -nbbo -saf -sai -saw -cs -bbo -nhnl -nut -sob -l90 -#undef GIOVA48 -#define CELLIAX_ALSA -#ifndef _CELLIAX_H_ -#define _CELLIAX_H_ - -#ifndef CELLIAX_SVN_VERSION -#define CELLIAX_SVN_VERSION "????NO_REVISION???" -#endif - -#include /* needed here for conditional compilation on version.h */ - /* the following #defs are for LINUX */ -#ifndef __CYGWIN__ -#ifndef ASTERISK_VERSION_1_6_0 -#ifndef ASTERISK_VERSION_1_4 -#ifndef ASTERISK_VERSION_1_2 -#define ASTERISK_VERSION_1_4 -#if(ASTERISK_VERSION_NUM == 999999) -#undef ASTERISK_VERSION_1_4 -#elif(ASTERISK_VERSION_NUM < 10400) -#undef ASTERISK_VERSION_1_4 -#endif /* ASTERISK_VERSION_NUM == 999999 || ASTERISK_VERSION_NUM < 10400 */ -#endif /* ASTERISK_VERSION_1_2 */ -#endif /* ASTERISK_VERSION_1_4 */ -#endif /* ASTERISK_VERSION_1_6_0 */ -#ifdef ASTERISK_VERSION_1_2 -#undef ASTERISK_VERSION_1_4 -#endif /* ASTERISK_VERSION_1_2 */ -#ifdef ASTERISK_VERSION_1_6_0 -#define ASTERISK_VERSION_1_4 -#endif /* ASTERISK_VERSION_1_6_0 */ -#define CELLIAX_DIR -#undef CELLIAX_LIBCSV -#endif /* NOT __CYGWIN__ */ - /* the following #defs are for WINDOWS */ -#ifdef __CYGWIN__ -#undef ASTERISK_VERSION_1_4 -#undef ASTERISK_VERSION_1_6_0 -#define CELLIAX_DIR -#undef CELLIAX_LIBCSV -#endif /* __CYGWIN__ */ - -/* CELLIAX_CVM */ -#undef CELLIAX_CVM -/* CELLIAX_CVM */ - -#undef CELLIAX_FBUS2 -#define CELLIAX_DIR -#define CELLIAX_LIBCSV - -/* INCLUDES */ -#ifdef ASTERISK_VERSION_1_6_0 -#include /* some asterisk-devel package do not contains asterisk.h, but seems that is needed for the 1.6 series, at least from trunk */ -#endif /* ASTERISK_VERSION_1_6_0 */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef ASTERISK_VERSION_1_4 -#include -#include -#endif /* ASTERISK_VERSION_1_4 */ -#ifndef CELLIAX_ALSA -#include "pablio.h" -#endif /* CELLIAX_ALSA */ -//#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef ASTERISK_VERSION_1_6_0 -#include -#include -#endif /* ASTERISK_VERSION_1_6_0 */ -#ifdef ASTERISK_VERSION_1_4 -#include -#include -#include -#include -#endif /* ASTERISK_VERSION_1_4 */ -#ifdef ASTERISK_VERSION_1_2 -#include -#include -#endif /* ASTERISK_VERSION_1_2 */ -#ifdef HAVE_CONFIG_H -#include -#endif -#include "celliax_spandsp.h" -#ifdef CELLIAX_LIBCSV -#include "celliax_libcsv.h" -#endif /* CELLIAX_LIBCSV */ -#ifdef __CYGWIN__ -#include -#endif /* __CYGWIN__ */ -#ifndef AST_DIGIT_ANYDIG -#define AST_DIGIT_ANYDIG "0123456789*#" -#else -#warning Please review Celliax AST_DIGIT_ANYDIG -#endif -#ifndef _ASTERISK_H -#define AST_CONFIG_MAX_PATH 255 /* defined in asterisk.h, but some asterisk-devel package do not contains asterisk.h */ -extern char ast_config_AST_CONFIG_DIR[AST_CONFIG_MAX_PATH]; -int ast_register_atexit(void (*func) (void)); /* in asterisk.h, but some asterisk-devel package do not contains asterisk.h */ -void ast_unregister_atexit(void (*func) (void)); /* in asterisk.h, but some asterisk-devel package do not contains asterisk.h */ -#endif -#ifdef CELLIAX_ALSA -#define ALSA_PCM_NEW_HW_PARAMS_API -#define ALSA_PCM_NEW_SW_PARAMS_API -#include -#endif /* CELLIAX_ALSA */ - -/* DEFINITIONS */ -/* LUIGI RIZZO's magic */ -/* boost support. BOOST_SCALE * 10 ^(BOOST_MAX/20) must - * be representable in 16 bits to avoid overflows. - */ -#define BOOST_SCALE (1<<9) -#define BOOST_MAX 40 /* slightly less than 7 bits */ -/* call flow from the device */ -#define FBUS2_OUTGOING_ACK 999 -#define FBUS2_SECURITY_COMMAND_ON 444 -#define CALLFLOW_CALL_IDLE AST_STATE_DOWN -#define CALLFLOW_INCOMING_RING AST_STATE_RING -#define CALLFLOW_CALL_DIALING AST_STATE_DIALING -#define CALLFLOW_CALL_LINEBUSY AST_STATE_BUSY -#define CALLFLOW_CALL_ACTIVE 300 -#define CALLFLOW_INCOMING_HANGUP 100 -#define CALLFLOW_CALL_RELEASED 101 -#define CALLFLOW_CALL_NOCARRIER 102 -#define CALLFLOW_CALL_INFLUX 103 -#define CALLFLOW_CALL_INCOMING 104 -#define CALLFLOW_CALL_FAILED 105 -#define CALLFLOW_CALL_NOSERVICE 106 -#define CALLFLOW_CALL_OUTGOINGRESTRICTED 107 -#define CALLFLOW_CALL_SECURITYFAIL 108 -#define CALLFLOW_CALL_NOANSWER 109 -#define CALLFLOW_CALL_HANGUP_REQUESTED 110 - //fixme CALLFLOW_GOT_IMEI to be removed -#define CALLFLOW_GOT_IMEI 1009 - //fixme CALLFLOW_INCOMING_CALLID to be removed -#define CALLFLOW_INCOMING_CALLID 1019 -#define AT_OK 0 -#define AT_ERROR 1 -/* FBUS2 (old Nokia phones) undocumented proprietary protocol */ -#define FBUS2_ACK_BYTE 0x7f -#define FBUS2_CALL_CALLID 0x05 -#define FBUS2_CALL_HANGUP 0x04 -#define FBUS2_CALL_STATUS_OFF 0x01 -#define FBUS2_CALL_STATUS_ON 0x02 -#define FBUS2_COMMAND_BYTE_1 0x00 -#define FBUS2_COMMAND_BYTE_2 0x01 -#define FBUS2_DEVICE_PC 0x0c -#define FBUS2_DEVICE_PHONE 0x00 -#define FBUS2_IRDA_FRAME_ID 0x1c -#define FBUS2_IS_LAST_FRAME 0x01 -#define FBUS2_MAX_TRANSMIT_LENGTH 120 -#define FBUS2_NETWORK_STATUS_REGISTERED 0x71 -#define FBUS2_SECURIY_CALL_COMMAND_ANSWER 0x02 -#define FBUS2_SECURIY_CALL_COMMAND_CALL 0x01 -#define FBUS2_SECURIY_CALL_COMMAND_RELEASE 0x03 -#define FBUS2_SECURIY_CALL_COMMANDS 0x7c -#define FBUS2_SECURIY_EXTENDED_COMMAND_ON 0x01 -#define FBUS2_SECURIY_EXTENDED_COMMANDS 0x64 -#define FBUS2_SECURIY_IMEI_COMMAND_GET 0x00 -#define FBUS2_SECURIY_IMEI_COMMANDS 0x66 -#define FBUS2_SEQNUM_MAX 0x47 -#define FBUS2_SEQNUM_MIN 0x40 -#define FBUS2_SERIAL_FRAME_ID 0x1e -#define FBUS2_SMS_INCOMING 0x10 -#define FBUS2_TYPE_CALL 0x01 -#define FBUS2_TYPE_CALL_DIVERT 0x06 -#define FBUS2_TYPE_CALL_STATUS 0x0d -#define FBUS2_TYPE_NETWORK_STATUS 0x0a -#define FBUS2_TYPE_SECURITY 0x40 -#define FBUS2_TYPE_SMS 0x02 -#define FBUS2_TYPE_MODEL_ASK 0xd1 -#define FBUS2_TYPE_MODEL_ANSWER 0xd2 -//#define FBUS2_TYPE_MODEL_ANSWER 0xffffffd2 -#ifdef CELLIAX_CVM -#define CVM_BUSMAIL_SEQNUM_MAX 0x7 -#endif /* CELLIAX_CVM */ -/* debugging bitmask */ -#define DEBUG_SOUND 1 -#define DEBUG_SERIAL 2 -#define DEBUG_SKYPE 4 -#define DEBUG_AT 8 -#define DEBUG_FBUS2 16 -#define DEBUG_CALL 32 -#define DEBUG_LOCKS 64 -#define DEBUG_PBX 128 -#define DEBUG_MONITORLOCKS 256 -#ifndef CELLIAX_CVM -#define DEBUG_ALL DEBUG_SOUND|DEBUG_SERIAL|DEBUG_SKYPE|DEBUG_AT|DEBUG_FBUS2|DEBUG_CALL|DEBUG_PBX|DEBUG_LOCKS|DEBUG_MONITORLOCKS -#else -#define DEBUG_CVM 512 -#define DEBUG_ALL DEBUG_SOUND|DEBUG_SERIAL|DEBUG_SKYPE|DEBUG_AT|DEBUG_FBUS2|DEBUG_CALL|DEBUG_PBX|DEBUG_LOCKS|DEBUG_MONITORLOCKS|DEBUG_CVM -#endif /* CELLIAX_CVM */ -/* wrappers for ast_log */ -#define DEBUGA_SOUND(...) if (celliax_debug & DEBUG_SOUND) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_SOUND %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define DEBUGA_SERIAL(...) if (celliax_debug & DEBUG_SERIAL) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_SERIAL %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define DEBUGA_SKYPE(...) if (celliax_debug & DEBUG_SKYPE) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_SKYPE %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define DEBUGA_AT(...) if (celliax_debug & DEBUG_AT) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_AT %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define DEBUGA_FBUS2(...) if (celliax_debug & DEBUG_FBUS2) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_FBUS2 %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define DEBUGA_CALL(...) if (celliax_debug & DEBUG_CALL) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_CALL %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define DEBUGA_PBX(...) if (celliax_debug & DEBUG_PBX) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_PBX %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#ifdef CELLIAX_CVM -#define DEBUGA_CVM(...) if (celliax_debug & DEBUG_CVM) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_CVM %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#endif /* CELLIAX_CVM */ -#define ERRORA(...) ast_log(LOG_ERROR, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][ERROR %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define NOTICA(...) ast_log(LOG_NOTICE, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][NOTICE %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define WARNINGA(...) ast_log(LOG_WARNING, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][WARNING %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -/* macros for logging */ -#define CELLIAX_P_LOG p ? p->owner : NULL, (unsigned long)pthread_self(), __LINE__, p ? p->name ? p->name : "none" : "none", p ? p->owner ? p->owner->_state : -1 : -1, p ? p->interface_state : -1, p ? p->phone_callflow : -1 -#define CELLIAX_TMP_LOG tmp ? tmp->owner : NULL, (unsigned long)pthread_self(), __LINE__, tmp ? tmp->name ? tmp->name : "none" : "none", tmp ? tmp->owner ? tmp->owner->_state : -1 : -1, tmp ? tmp->interface_state : -1, tmp ? tmp->phone_callflow : -1 -/* logging wrappers for ast_mutex_lock and ast_mutex_unlock */ -#define LOKKA(x) if (celliax_debug & DEBUG_LOCKS) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_LOCKS %-5d][%-10s][%2d,%2d,%2d] going to lock %p (%s)\n", CELLIAX_P_LOG, x, x == &celliax_monlock ? "MONLOCK" : x == &celliax_iflock ? "IFLOCK" : x == &celliax_usecnt_lock ? "USECNT_LOCK" : x == &p->controldev_lock ? "CONTROLDEV_LOCK" : x == &p->fbus2_outgoing_list_lock ? "FBUS2_OUTGOING_LIST_LOCK" : "?????"); if (ast_mutex_lock(x)) ast_log(LOG_ERROR, "ast_mutex_lock failed, BAD\n"); if (celliax_debug & DEBUG_LOCKS) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_LOCKS %-5d][%-10s][%2d,%2d,%2d] locked %p (%s)\n", CELLIAX_P_LOG, x, x == &celliax_monlock ? "MONLOCK" : x == &celliax_iflock ? "IFLOCK" : x == &celliax_usecnt_lock ? "USECNT_LOCK" : x == &p->controldev_lock ? "CONTROLDEV_LOCK" : x == &p->fbus2_outgoing_list_lock ? "FBUS2_OUTGOING_LIST_LOCK" : "?????"); -#define UNLOCKA(x) if (celliax_debug & DEBUG_LOCKS) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_LOCKS %-5d][%-10s][%2d,%2d,%2d] going to unlock %p (%s)\n", CELLIAX_P_LOG, x, x == &celliax_monlock ? "MONLOCK" : x == &celliax_iflock ? "IFLOCK" : x == &celliax_usecnt_lock ? "USECNT_LOCK" : x == &p->controldev_lock ? "CONTROLDEV_LOCK" : x == &p->fbus2_outgoing_list_lock ? "FBUS2_OUTGOING_LIST_LOCK" : "?????"); if (ast_mutex_unlock(x)) ast_log(LOG_ERROR, "ast_mutex_lock failed, BAD\n"); if (celliax_debug & DEBUG_LOCKS) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_LOCKS %-5d][%-10s][%2d,%2d,%2d] unlocked %p (%s)\n", CELLIAX_P_LOG, x, x == &celliax_monlock ? "MONLOCK" : x == &celliax_iflock ? "IFLOCK" : x == &celliax_usecnt_lock ? "USECNT_LOCK" : x == &p->controldev_lock ? "CONTROLDEV_LOCK" : x == &p->fbus2_outgoing_list_lock ? "FBUS2_OUTGOING_LIST_LOCK" : "?????"); -#define CVM_LOKKA(x) if (celliax_debug & DEBUG_LOCKS) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_LOCKS %-5d][%-10s][%2d,%2d,%2d] going to lock %p (%s)\n", CELLIAX_P_LOG, x, x == &celliax_monlock ? "MONLOCK" : x == &celliax_iflock ? "IFLOCK" : x == &celliax_usecnt_lock ? "USECNT_LOCK" : x == &p->controldev_lock ? "CONTROLDEV_LOCK" : x == &p->cvm_busmail_outgoing_list_lock ? "FBUS2_OUTGOING_LIST_LOCK" : "?????"); if (ast_mutex_lock(x)) ast_log(LOG_ERROR, "ast_mutex_lock failed, BAD\n"); if (celliax_debug & DEBUG_LOCKS) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_LOCKS %-5d][%-10s][%2d,%2d,%2d] locked %p (%s)\n", CELLIAX_P_LOG, x, x == &celliax_monlock ? "MONLOCK" : x == &celliax_iflock ? "IFLOCK" : x == &celliax_usecnt_lock ? "USECNT_LOCK" : x == &p->controldev_lock ? "CONTROLDEV_LOCK" : x == &p->cvm_busmail_outgoing_list_lock ? "CVM_BUSMAIL_OUTGOING_LIST_LOCK" : "?????"); -#define CVM_UNLOCKA(x) if (celliax_debug & DEBUG_LOCKS) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_LOCKS %-5d][%-10s][%2d,%2d,%2d] going to unlock %p (%s)\n", CELLIAX_P_LOG, x, x == &celliax_monlock ? "MONLOCK" : x == &celliax_iflock ? "IFLOCK" : x == &celliax_usecnt_lock ? "USECNT_LOCK" : x == &p->controldev_lock ? "CONTROLDEV_LOCK" : x == &p->cvm_busmail_outgoing_list_lock ? "FBUS2_OUTGOING_LIST_LOCK" : "?????"); if (ast_mutex_unlock(x)) ast_log(LOG_ERROR, "ast_mutex_lock failed, BAD\n"); if (celliax_debug & DEBUG_LOCKS) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_LOCKS %-5d][%-10s][%2d,%2d,%2d] unlocked %p (%s)\n", CELLIAX_P_LOG, x, x == &celliax_monlock ? "MONLOCK" : x == &celliax_iflock ? "IFLOCK" : x == &celliax_usecnt_lock ? "USECNT_LOCK" : x == &p->controldev_lock ? "CONTROLDEV_LOCK" : x == &p->cvm_busmail_outgoing_list_lock ? "CVM_BUSMAIL_OUTGOING_LIST_LOCK" : "?????"); -#define PUSHA_UNLOCKA(x) pthread_cleanup_push(celliax_unlocka_log, (void *) x); -#define POPPA_UNLOCKA(x) pthread_cleanup_pop(0); -#define MONITORLOKKA(x) if (celliax_debug & DEBUG_MONITORLOCKS) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_MONITORLOCKS %-5d][%-10s][%2d,%2d,%2d] going to lock %p (%s)\n", CELLIAX_P_LOG, x, x == &celliax_monlock ? "MONLOCK" : x == &celliax_iflock ? "IFLOCK" : x == &celliax_usecnt_lock ? "USECNT_LOCK" : x == &p->controldev_lock ? "CONTROLDEV_LOCK" : x == &p->fbus2_outgoing_list_lock ? "FBUS2_OUTGOING_LIST_LOCK" : "?????"); if (ast_mutex_lock(x)) ast_log(LOG_ERROR, "ast_mutex_lock failed, BAD\n"); if (celliax_debug & DEBUG_MONITORLOCKS) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_MONITORLOCKS %-5d][%-10s][%2d,%2d,%2d] locked %p (%s)\n", CELLIAX_P_LOG, x, x == &celliax_monlock ? "MONLOCK" : x == &celliax_iflock ? "IFLOCK" : x == &celliax_usecnt_lock ? "USECNT_LOCK" : x == &p->controldev_lock ? "CONTROLDEV_LOCK" : x == &p->fbus2_outgoing_list_lock ? "FBUS2_OUTGOING_LIST_LOCK" : "?????"); -#define MONITORUNLOCKA(x) if (celliax_debug & DEBUG_MONITORLOCKS) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_MONITORLOCKS %-5d][%-10s][%2d,%2d,%2d] going to unlock %p (%s)\n", CELLIAX_P_LOG, x, x == &celliax_monlock ? "MONLOCK" : x == &celliax_iflock ? "IFLOCK" : x == &celliax_usecnt_lock ? "USECNT_LOCK" : x == &p->controldev_lock ? "CONTROLDEV_LOCK" : x == &p->fbus2_outgoing_list_lock ? "FBUS2_OUTGOING_LIST_LOCK" : "?????"); if (ast_mutex_unlock(x)) ast_log(LOG_ERROR, "ast_mutex_lock failed, BAD\n"); if (celliax_debug & DEBUG_MONITORLOCKS) ast_log(LOG_DEBUG, "rev "CELLIAX_SVN_VERSION "[%p|%-7lx][DEBUG_MONITORLOCKS %-5d][%-10s][%2d,%2d,%2d] unlocked %p (%s)\n", CELLIAX_P_LOG, x, x == &celliax_monlock ? "MONLOCK" : x == &celliax_iflock ? "IFLOCK" : x == &celliax_usecnt_lock ? "USECNT_LOCK" : x == &p->controldev_lock ? "CONTROLDEV_LOCK" : x == &p->fbus2_outgoing_list_lock ? "FBUS2_OUTGOING_LIST_LOCK" : "?????"); -/* macros used for config file parsing */ -#define M_BOOL(tag, dst) M_F(tag, (dst) = ast_true(__val) ) -#define M_END(x) x; -#define M_F(tag, f) if (!strcasecmp((__s), tag)) { f; } else -#ifdef ASTERISK_VERSION_1_6_0 -#define M_START(var, val) const char *__s = var; const char *__val = val; -#else -#define M_START(var, val) char *__s = var; char *__val = val; -#endif /* ASTERISK_VERSION_1_6_0 */ -#define M_STR(tag, dst) M_F(tag, ast_copy_string(dst, __val, sizeof(dst))) -#define M_UINT(tag, dst) M_F(tag, (dst) = strtoul(__val, NULL, 0) ) -/* which protocol we use to control the phone through serial device */ -#ifdef CELLIAX_CVM -#define PROTOCOL_CVM_BUSMAIL 5 -#endif /* CELLIAX_CVM */ -#define PROTOCOL_ALSA_VOICEMODEM 4 -#define PROTOCOL_AT 2 -#define PROTOCOL_FBUS2 1 -#define PROTOCOL_NO_SERIAL 3 -#ifndef GIOVA48 -#define CELLIAX_FRAME_SIZE 160 -#else //GIOVA48 -#define CELLIAX_FRAME_SIZE 960 -#endif //GIOVA48 -#define AT_BUFSIZ 8192 -#define AT_MESG_MAX_LENGTH 2048 /* much more than 10 SMSs */ -#define AT_MESG_MAX_LINES 256 /* 256 lines, so it can contains the results of AT+CLAC, that gives all the AT commands the phone supports */ - -#ifdef CELLIAX_CVM -/* MAIL PRIMITIVES */ -/* CVM -> CELLIAX */ -#define API_PP_LOCKED_IND 0x8558 //PP locked with FP -#define API_PP_UNLOCKED_IND 0x8559 //PP out of service, unlocked from FP - -#define API_PP_SETUP_IND 0x8574 //Incoming call to PP - -#define API_PP_SETUP_IND_CALL_TYPE_OFFSET 0x0 -#define API_PP_SETUP_IND_RING_TYPE_OFFSET 0x1 - -#define API_PP_SETUP_IND_CALL_EXT 0x0 -#define API_PP_SETUP_IND_CALL_INT 0x1 - -#define API_PP_SETUP_IND_RING_INT_CALL 0x40 -#define API_PP_SETUP_IND_RING_PAGE_ALL 0x46 - -#define API_PP_SETUP_ACK_IND 0x857F //internal connection established with FPs, waiting for handsetnumber - -#define API_PP_CONNECT_IND 0x8576 //air-link established with FPs -#define API_PP_CONNECT_CFM 0x8578 //PP answered incoming call - -#define API_PP_ALERT_IND 0x8581 -#define API_PP_ALERT_ON_IND 0x857D -#define API_PP_ALERT_OFF_IND 0x857E - -#define API_PP_SIGNAL_ON_IND 0x2F9C -#define API_PP_SIGNAL_OFF_IND 0x2F9D - -#define API_PP_RELEASE_IND 0x857B -#define API_PP_RELEASE_CFM 0x857A -#define API_PP_REJECT_IND 0x8564 - -#define API_PP_ACCESS_RIGHTS_CFM 0x8568 -#define API_PP_ACCESS_RIGHTS_REJ 0x8569 - -#define API_PP_DELETE_SUBS_CFM 0x8561 -#define API_PP_REMOTE_DELETE_SUBS_CFM 0x2F9F - -#define API_PP_CLIP_IND 0x2F93 -#define API_PP_SW_STATUS_IND 0x2FC2 -#define API_PP_MESSAGE_WAITING_IND 0x2FA1 - -#define CVM_PP_PLUG_STATUS_IND 0x2F4F -#define CVM_PP_LINE_STATUS_IND 0x2F53 -#define CVM_PP_ON_KEY_IND 0x2F64 - -#define API_PP_READ_RSSI_CFM 0x2FC7 -#define API_PP_ALERT_BROADCAST_IND 0x2FA3 - -/* CELLIAX -> CVM */ -#define API_PP_LOCK_REQ 0x8554 //select FP to lock once -#define API_PP_SETUP_REQ 0x8571 //setup air-link PP<->FP - -#define API_PP_KEYPAD_REQ 0x858A //send string for dialing - -#define API_PP_CONNECT_REQ 0x8577 //answer incoming call - -#define API_PP_ALERT_REQ 0x2F8D //inform FP that alering is started - -#define API_PP_RELEASE_REQ 0x8579 //release connection -#define API_PP_RELEASE_RES 0x857C //confirm FP initiated release of connection -#define API_PP_REJECT_REQ 0x8565 //PP reject incoming call - -#define API_PP_ACCESS_RIGHTS_REQ 0x8566 //init registration to FP -#define API_PP_DELETE_SUBS_REQ 0x8560 //deregister from FP (locally only in PP) -#define API_PP_REMOTE_DELETE_SUBS_REQ 0x2F9E //remotly deregister from FP - -#define API_PP_STOP_PROTOCOL_REQ 0x2FC4 //stop protocol from running (even registration) - -#define API_PP_READ_RSSI_REQ 0x2FC6 //RSSI readout request -#define API_PP_READ_RSSI_CFM 0x2FC7 //RSSI readout result - -#define CVM_PP_AUDIO_OPEN_REQ 0x2F0E //Enable audio -#define CVM_PP_AUDIO_CLOSE_REQ 0x2F0F //Disable audio - -#define CVM_PP_AUDIO_SET_VOLUME_REQ 0x2F1D //set volume - -#define CVM_PP_AUDIO_UNMUTE_MIC_REQ 0x2F1A //unmute mic -#define CVM_PP_AUDIO_MUTE_MIC_REQ 0x2F19 //mute mic - -#define CVM_PP_AUDIO_HS_PLUG_IND 0x2F1C //mute mic - -#define CVM_PP_AUDIO_OPEN_ADPCM_OFF_REQ 0x2F68 //open audio even before making connection - -/* END OF MAIL PRIMITIVES */ - -enum CvmLockState { - CVM_UNKNOWN_LOCK_STATE = 0, - CVM_UNLOCKED_TO_FP, - CVM_LOCKED_TO_FP -}; - -enum CvmRegisterState { - CVM_UNKNOWN_REGISTER_STATE = 0, - CVM_UNREGISTERED_TO_FP, - CVM_REGISTERED_TO_FP -}; - -#define BUSMAIL_MAIL_MAX_PARAMS_LENGTH 128 -#define BUSMAIL_MAX_FRAME_LENGTH (BUSMAIL_MAIL_MAX_PARAMS_LENGTH + 9) - -#define BUSMAIL_OFFSET_SOF 0 -#define BUSMAIL_OFFSET_LEN_MSB 1 -#define BUSMAIL_OFFSET_LEN_LSB 2 -#define BUSMAIL_OFFSET_HEADER 3 -#define BUSMAIL_OFFSET_MAIL BUSMAIL_OFFSET_MAIL_PROGRAM_ID -#define BUSMAIL_OFFSET_MAIL_PROGRAM_ID 4 -#define BUSMAIL_OFFSET_MAIL_TASK_ID 5 -#define BUSMAIL_OFFSET_MAIL_PRIMITIVE_MSB 7 -#define BUSMAIL_OFFSET_MAIL_PRIMITIVE_LSB 6 -#define BUSMAIL_OFFSET_MAIL_PARAMS 8 - -#define BUSMAIL_MAIL_PRIMITIVE_MSB 1 -#define BUSMAIL_MAIL_PRIMITIVE_LSB 0 -#define BUSMAIL_LEN_MSB 0 -#define BUSMAIL_LEN_LSB 1 - -#define BUSMAIL_SOF 0x10 - -#define BUSMAIL_MAIL_PROGRAM_ID 0x0 -#define BUSMAIL_MAIL_USERTASK_TASK_ID 0x0f -#define BUSMAIL_MAIL_TBHANDLE_TASK_ID 0x0 -#define BUSMAIL_MAIL_TASK_ID BUSMAIL_MAIL_USERTASK_TASK_ID - -#define BUSMAIL_HEADER_IC_BIT_MASK 0x80 -#define BUSMAIL_HEADER_SU_BIT_MASK 0x40 -#define BUSMAIL_HEADER_PF_BIT_MASK 0x08 -#define BUSMAIL_HEADER_TXSEQ_MASK 0x70 -#define BUSMAIL_HEADER_RXSEQ_MASK 0x07 -#define BUSMAIL_HEADER_SUID_MASK 0x30 -#define BUSMAIL_HEADER_UNID_MASK BUSMAIL_HEADER_SUID_MASK - -#define BUSMAIL_HEADER_INFO_FRAME 0x0 -#define BUSMAIL_HEADER_CTRL_FRAME 0x80 -#define BUSMAIL_HEADER_CTRL_SU_FRAME 0x0 -#define BUSMAIL_HEADER_CTRL_UN_FRAME 0x40 - -#define BUSMAIL_HEADER_UNID_SABM 0x0 -#define BUSMAIL_HEADER_SUID_RR 0x0 -#define BUSMAIL_HEADER_SUID_REJ 0x10 -#define BUSMAIL_HEADER_SUID_RNR 0x20 - -#define BUSMAIL_HEADER_SABM_MASK (BUSMAIL_HEADER_IC_BIT_MASK | BUSMAIL_HEADER_SU_BIT_MASK | BUSMAIL_HEADER_UNID_MASK) -#define BUSMAIL_HEADER_SABM (BUSMAIL_HEADER_CTRL_FRAME | BUSMAIL_HEADER_CTRL_UN_FRAME | BUSMAIL_HEADER_UNID_SABM) - -#define BUSMAIL_HEADER_REJ_MASK (BUSMAIL_HEADER_IC_BIT_MASK | BUSMAIL_HEADER_SU_BIT_MASK | BUSMAIL_HEADER_SUID_MASK) -#define BUSMAIL_HEADER_REJ (BUSMAIL_HEADER_CTRL_FRAME | BUSMAIL_HEADER_CTRL_SU_FRAME | BUSMAIL_HEADER_SUID_REJ) - -#define BUSMAIL_HEADER_SU_FRAME_MASK (BUSMAIL_HEADER_IC_BIT_MASK | BUSMAIL_HEADER_SU_BIT_MASK) -#define BUSMAIL_HEADER_SU_FRAME (BUSMAIL_HEADER_CTRL_FRAME | BUSMAIL_HEADER_CTRL_SU_FRAME) - -/*! - * \brief structure holding raw data to be send throught serial - */ -struct cvm_busmail_msg { - int valid; - unsigned char busmail_msg_buffer[BUSMAIL_MAX_FRAME_LENGTH]; - unsigned int busmail_msg_len; - - unsigned int tv_sec; - unsigned int tv_usec; - - unsigned char txseqno; - int acknowledged; - int how_many_sent; - int sent; - - struct cvm_busmail_msg *next; - struct cvm_busmail_msg *previous; -}; - -/*! - * \brief structure holding busmail frame, for internal use - */ -struct cvm_busmail_frame { - unsigned char busmail_sof; - unsigned char busmail_len[2]; - unsigned char busmail_header; - unsigned char busmail_mail_program_id; - unsigned char busmail_mail_task_id; - unsigned char busmail_mail_primitive[2]; - unsigned char busmail_mail_params_buffer[BUSMAIL_MAIL_MAX_PARAMS_LENGTH]; - unsigned int busmail_mail_params_buffer_len; - unsigned char busmail_crc; -}; -#endif /* CELLIAX_CVM */ - -/* CELLIAX INTERNAL STRUCTS */ - -/*! - * \brief structure for the linked list of FBUS2 Nokia proprietary protocol messages - */ -struct fbus2_msg { - int msg; - int seqnum; - int len; - int acknowledged; - int how_many_sent; - int sent; - unsigned int tv_sec; - unsigned int tv_usec; - unsigned char buffer[FBUS2_MAX_TRANSMIT_LENGTH + 10]; - struct fbus2_msg *next; - struct fbus2_msg *previous; -}; - -/*! - * \brief structure for storing the results of AT commands, in an array of AT_MESG_MAX_LINES * AT_MESG_MAX_LENGTH chars - */ -struct s_result { - int elemcount; - char result[AT_MESG_MAX_LINES][AT_MESG_MAX_LENGTH]; -}; - -/*! - * \brief PVT structure for a celliax interface (channel), created by celliax_mkif - */ -struct celliax_pvt { - char *name; /*!< \brief 'name' of the interface (channel) */ - int interface_state; /*!< \brief 'state' of the interface (channel) */ - int phone_callflow; /*!< \brief 'callflow' of the phone interface (as opposed to skype interface) */ - struct ast_channel *owner; /*!< \brief channel we belong to, possibly NULL */ - struct celliax_pvt *next; /*!< \brief Next interface (channel) in list */ - int readpos; /*!< \brief read position above */ - struct ast_frame read_f; /*!< \brief returned by oss_read */ - char context[AST_MAX_EXTENSION]; /*!< \brief default Asterisk dialplan context for this interface */ - char language[MAX_LANGUAGE]; /*!< \brief default Asterisk dialplan language for this interface */ - char exten[AST_MAX_EXTENSION]; /*!< \brief default Asterisk dialplan extension for this interface */ - struct ast_dsp *dsp; /*!< \brief Used for in-band DTMF detection */ - int celliax_sound_rate; /*!< \brief rate of the sound device, in Hz, eg: 8000 */ - int celliax_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */ - char controldevice_name[50]; /*!< \brief name of the serial device controlling the interface, possibly none */ - int controldevprotocol; /*!< \brief which protocol is used for serial control of this interface */ - char controldevprotocolname[50]; /*!< \brief name of the serial device controlling protocol, one of "at" "fbus2" "no_serial" "alsa_voicemodem" */ - int controldevfd; /*!< \brief serial controlling file descriptor for this interface */ - char callid_name[50]; - char callid_number[50]; - unsigned char rxm[255]; /*!< \brief read buffer for FBUS2 serial protocol controlling Nokia phones */ - unsigned char array[255]; /*!< \brief read buffer for FBUS2 serial protocol controlling Nokia phones */ - int arraycounter; /*!< \brief position in the 'array' read buffer for FBUS2 serial protocol controlling Nokia phones */ - int seqnumfbus; /*!< \brief sequential number of FBUS2 messages, hex, revolving */ - pthread_t controldev_thread; /*!< \brief serial control thread for this interface, running during the call */ - struct fbus2_msg *fbus2_outgoing_list; /*!< \brief list used to track FBUS2 traffic acknowledgement and resending */ - ast_mutex_t fbus2_outgoing_list_lock; - int dsp_silence_threshold; - int need_acoustic_ring; /*!< \brief bool, this interface get the incoming ring from soundcard, not serial */ - char oss_write_buf[CELLIAX_FRAME_SIZE * 2]; - int oss_write_dst; - char oss_read_buf[CELLIAX_FRAME_SIZE * 2 + AST_FRIENDLY_OFFSET]; /*!< in bytes */ - time_t celliax_serial_synced_timestamp; - time_t celliax_serial_sync_period; - time_t audio_play_reset_timestamp; - time_t audio_capture_reset_timestamp; - speed_t controldevice_speed; - struct s_result line_array; - struct timeval ringtime; - struct timeval call_incoming_time; - int at_result; - - char at_dial_pre_number[64]; - char at_dial_post_number[64]; - char at_dial_expect[64]; - unsigned int at_early_audio; - char at_hangup[64]; - char at_hangup_expect[64]; - char at_answer[64]; - char at_answer_expect[64]; - unsigned int at_initial_pause; - char at_preinit_1[64]; - char at_preinit_1_expect[64]; - char at_preinit_2[64]; - char at_preinit_2_expect[64]; - char at_preinit_3[64]; - char at_preinit_3_expect[64]; - char at_preinit_4[64]; - char at_preinit_4_expect[64]; - char at_preinit_5[64]; - char at_preinit_5_expect[64]; - unsigned int at_after_preinit_pause; - - char at_postinit_1[64]; - char at_postinit_1_expect[64]; - char at_postinit_2[64]; - char at_postinit_2_expect[64]; - char at_postinit_3[64]; - char at_postinit_3_expect[64]; - char at_postinit_4[64]; - char at_postinit_4_expect[64]; - char at_postinit_5[64]; - char at_postinit_5_expect[64]; - - char at_send_dtmf[64]; - - char at_query_battchg[64]; - char at_query_battchg_expect[64]; - char at_query_signal[64]; - char at_query_signal_expect[64]; - char at_call_idle[64]; - char at_call_incoming[64]; - char at_call_active[64]; - char at_call_failed[64]; - char at_call_calling[64]; - -#define CIEV_STRING_SIZE 64 - char at_indicator_noservice_string[64]; - char at_indicator_nosignal_string[64]; - char at_indicator_lowsignal_string[64]; - char at_indicator_lowbattchg_string[64]; - char at_indicator_nobattchg_string[64]; - char at_indicator_callactive_string[64]; - char at_indicator_nocallactive_string[64]; - char at_indicator_nocallsetup_string[64]; - char at_indicator_callsetupincoming_string[64]; - char at_indicator_callsetupoutgoing_string[64]; - char at_indicator_callsetupremoteringing_string[64]; - - int at_indicator_callp; - int at_indicator_callsetupp; - int at_indicator_roamp; - int at_indicator_battchgp; - int at_indicator_servicep; - int at_indicator_signalp; - - int at_has_clcc; - int at_has_ecam; - - double playback_boost; - double capture_boost; - int stripmsd; - int controldev_dead; - ast_mutex_t controldev_lock; - struct timeval fbus2_list_tv; - struct timezone fbus2_list_tz; - dtmf_rx_state_t dtmf_state; - int dtmf_inited; - pthread_t sync_thread; - pthread_t celliax_sound_monitor_thread; - pthread_t celliax_serial_monitor_thread; - int celliax_serial_monitoring; - int skype; /*!< \brief config flag, bool, Skype support on this interface (0 if false, -1 if true) */ - int phonebook_listing; - int phonebook_querying; - int phonebook_listing_received_calls; - - int phonebook_first_entry; - int phonebook_last_entry; - int phonebook_number_lenght; - int phonebook_text_lenght; - FILE *phonebook_writing_fp; - int celliax_dir_entry_extension_prefix; -#ifdef CELLIAX_CVM - char cvm_subsc_1_pin[20]; - char cvm_subsc_2_pin[20]; - int cvm_subsc_no; - int cvm_lock_state; - int cvm_register_state; - int cvm_volume_level; - int cvm_celliax_serial_delay; - unsigned char cvm_handset_no; - unsigned char cvm_fp_is_cvm; - unsigned char cvm_rssi; - - unsigned char busmail_rxseq_cvm_last; /*!< \brief sequential number of BUSMAIL messages, (0-7) */ - unsigned char busmail_txseq_celliax_last; /*!< \brief sequential number of BUSMAIL messages, (0-7) */ - - struct cvm_busmail_msg *cvm_busmail_outgoing_list; /*!< \brief list used to track CVM BUSMAIL traffic acknowledgement and resending */ - ast_mutex_t cvm_busmail_outgoing_list_lock; - - struct timeval cvm_busmail_list_tv; - struct timezone cvm_busmail_list_tz; -#endif /* CELLIAX_CVM */ -#ifdef CELLIAX_LIBCSV - int csv_separator_is_semicolon; - int csv_complete_name_pos; - int csv_email_pos; - int csv_home_phone_pos; - int csv_mobile_phone_pos; - int csv_business_phone_pos; - int csv_first_row_is_title; - int csv_fields; - int csv_rows; - char csv_complete_name[256]; - char csv_email[256]; - char csv_home_phone[256]; - char csv_mobile_phone[256]; - char csv_business_phone[256]; -#endif /* CELLIAX_LIBCSV */ - int audio_play_reset_period; - - char at_cmgw[16]; - - int isInputInterleaved; - int isOutputInterleaved; - int numInputChannels; - int numOutputChannels; - int framesPerCallback; -#ifndef CELLIAX_ALSA - PABLIO_Stream *stream; -#endif /* CELLIAX_ALSA */ - int audiopipe[2]; - int speexecho; - int speexpreprocess; - int portaudiocindex; /*!< \brief Index of the Portaudio capture audio device */ - int portaudiopindex; /*!< \brief Index of the Portaudio playback audio device */ - int control_to_send; - int unread_sms_msg_id; - int reading_sms_msg; - char sms_message[4800]; - int sms_cnmi_not_supported; - char sms_receiving_program[256]; - int celliax_dir_prefix; - int no_ucs2; -#ifdef CELLIAX_ALSA - snd_pcm_t *alsac; /*!< \brief handle of the ALSA capture audio device */ - snd_pcm_t *alsap; /*!< \brief handle of the ALSA playback audio device */ - char alsacname[50]; /*!< \brief name of the ALSA capture audio device */ - char alsapname[50]; /*!< \brief name of the ALSA playback audio device */ - int alsa_period_size; /*!< \brief ALSA period_size, in byte */ - int alsa_periods_in_buffer; /*!< \brief how many periods in ALSA buffer, to calculate buffer_size */ - unsigned long int alsa_buffer_size; /*!< \brief ALSA buffer_size, in byte */ - int alsawrite_filled; - int alsa_capture_is_mono; - int alsa_play_is_mono; - struct pollfd pfd; -#endif /* CELLIAX_ALSA */ - - struct timeval dtmf_timestamp; -}; - -/* LOCKS */ -/*! \brief Protect the celliax_usecnt */ -AST_MUTEX_DEFINE_STATIC(celliax_usecnt_lock); -/*! \brief Protect the monitoring thread, so only one process can kill or start it, and not - * when it's doing something critical. */ -AST_MUTEX_DEFINE_STATIC(celliax_monlock); -/*! \brief Protect the interfaces list */ -AST_MUTEX_DEFINE_STATIC(celliax_iflock); - -/* FUNCTIONS */ - -/* module helpers functions */ -int load_module(void); -int unload_module(void); -int usecount(void); -char *description(void); -char *key(void); - -/* chan_celliax internal functions */ -void celliax_unlocka_log(void *x); -#ifdef CELLIAX_FBUS2 -int celliax_serial_sync_FBUS2(struct celliax_pvt *p); -int celliax_serial_answer_FBUS2(struct celliax_pvt *p); -int celliax_serial_call_FBUS2(struct celliax_pvt *p, char *dstr); -int celliax_serial_hangup_FBUS2(struct celliax_pvt *p); -int celliax_serial_config_FBUS2(struct celliax_pvt *p); -int celliax_serial_read_FBUS2(struct celliax_pvt *p); -int celliax_serial_getstatus_FBUS2(struct celliax_pvt *p); -int celliax_serial_get_seqnum_FBUS2(struct celliax_pvt *p); -int celliax_serial_security_command_FBUS2(struct celliax_pvt *p); -int celliax_serial_send_FBUS2(struct celliax_pvt *p, int len, unsigned char *buffer2); -int celliax_serial_list_acknowledge_FBUS2(struct celliax_pvt *p, int seqnum); -int celliax_serial_send_if_time_FBUS2(struct celliax_pvt *p); -int celliax_serial_write_FBUS2(struct celliax_pvt *p, unsigned char *MsgBuffer, - int MsgLength, unsigned char MsgType); -int celliax_serial_send_ack_FBUS2(struct celliax_pvt *p, unsigned char MsgType, - unsigned char MsgSequence); -struct fbus2_msg *celliax_serial_list_init_FBUS2(struct celliax_pvt *p); -int celliax_serial_list_print_FBUS2(struct celliax_pvt *p, struct fbus2_msg *list); - -#endif /* CELLIAX_FBUS2 */ - -#ifdef CELLIAX_CVM -int celliax_serial_sync_CVM_BUSMAIL(struct celliax_pvt *p); -int celliax_serial_answer_CVM_BUSMAIL(struct celliax_pvt *p); -int celliax_serial_call_CVM_BUSMAIL(struct celliax_pvt *p, char *dstr); -int celliax_serial_hangup_CVM_BUSMAIL(struct celliax_pvt *p); -int celliax_serial_config_CVM_BUSMAIL(struct celliax_pvt *p); -int celliax_serial_read_CVM_BUSMAIL(struct celliax_pvt *p); -int celliax_serial_getstatus_CVM_BUSMAIL(struct celliax_pvt *p); -int celliax_serial_send_CVM_BUSMAIL(struct celliax_pvt *p, int len, - unsigned char *mesg_ptr); -int celliax_serial_list_acknowledge_CVM_BUSMAIL(struct celliax_pvt *p, - unsigned char TxSeqNo); -int celliax_serial_send_if_time_CVM_BUSMAIL(struct celliax_pvt *p); -int celliax_serial_write_CVM_BUSMAIL(struct celliax_pvt *p, - struct cvm_busmail_frame *busmail_frame); -int celliax_serial_send_ctrl_frame_CVM_BUSMAIL(struct celliax_pvt *p, - unsigned char FrameType); -int celliax_serial_send_info_frame_CVM_BUSMAIL(struct celliax_pvt *p, int FrameType, - unsigned char ParamsLen, - unsigned char *Params); -struct cvm_busmail_msg *celliax_serial_list_init_CVM_BUSMAIL(struct celliax_pvt *p); -int celliax_serial_list_print_CVM_BUSMAIL(struct celliax_pvt *p, - struct cvm_busmail_msg *list); -int celliax_serial_lists_free_CVM_BUSMAIL(struct celliax_pvt *p); - -#endif /* CELLIAX_CVM */ - -/* CHAN_CELLIAX.C */ -int celliax_queue_control(struct ast_channel *chan, int control); -struct celliax_pvt *celliax_console_find_desc(char *dev); -int celliax_serial_call(struct celliax_pvt *p, char *dstr); - -/* FUNCTIONS */ -/* PBX interface functions */ -struct ast_channel *celliax_request(const char *type, int format, void *data, int *cause); -int celliax_answer(struct ast_channel *c); -int celliax_hangup(struct ast_channel *c); -int celliax_call(struct ast_channel *c, char *idest, int timeout); -struct ast_frame *celliax_read(struct ast_channel *chan); -int celliax_write(struct ast_channel *c, struct ast_frame *f); -int celliax_fixup(struct ast_channel *oldchan, struct ast_channel *newchan); -#ifndef ASTERISK_VERSION_1_4 -int celliax_indicate(struct ast_channel *c, int cond); -#else -int celliax_indicate(struct ast_channel *c, int cond, const void *data, size_t datalen); -#endif -int celliax_devicestate(void *data); -#ifdef ASTERISK_VERSION_1_4 -int celliax_senddigit_begin(struct ast_channel *ast, char digit); -int celliax_senddigit_end(struct ast_channel *ast, char digit, unsigned int duration); -#else /* ASTERISK_VERSION_1_4 */ -int celliax_senddigit(struct ast_channel *ast, char digit); -#endif /* ASTERISK_VERSION_1_4 */ - -/* chan_celliax internal functions */ - -struct celliax_pvt *celliax_mkif(struct ast_config *cfg, char *ctg, - int is_first_category); -struct ast_channel *celliax_new(struct celliax_pvt *p, int state, char *context); -int celliax_restart_monitor(void); -void *celliax_do_monitor(void *data); -void *celliax_do_audio_monitor(void *data); -int celliax_sound_boost(struct ast_frame *f, double boost); -int celliax_sound_init(struct celliax_pvt *p); -int celliax_sound_shutdown(struct celliax_pvt *p); -struct ast_frame *celliax_sound_dsp_analize(struct celliax_pvt *p, struct ast_frame *f, - int dsp_silence_threshold); -int celliax_sound_dsp_set(struct celliax_pvt *p, int dsp_silence_threshold, - int silence_suppression); -struct ast_frame *celliax_sound_read(struct celliax_pvt *p); -int celliax_sound_write(struct celliax_pvt *p, struct ast_frame *f); -int celliax_sound_monitor(struct celliax_pvt *p); -void *celliax_do_controldev_thread(void *data); -int celliax_serial_init(struct celliax_pvt *p, speed_t controldevice_speed); -int celliax_serial_monitor(struct celliax_pvt *p); -int celliax_serial_read(struct celliax_pvt *p); -int celliax_serial_sync(struct celliax_pvt *p); -int celliax_serial_getstatus(struct celliax_pvt *p); -int celliax_serial_config(struct celliax_pvt *p); -int celliax_serial_hangup(struct celliax_pvt *p); -int celliax_serial_answer(struct celliax_pvt *p); - -#define celliax_serial_write_AT_expect(P, D, S) celliax_serial_write_AT_expect1(P, D, S, 1, 2) -#define celliax_serial_write_AT_expect_noexpcr(P, D, S) celliax_serial_write_AT_expect1(P, D, S, 0, 2) -#define celliax_serial_write_AT_expect_noexpcr_tout(P, D, S, T) celliax_serial_write_AT_expect1(P, D, S, 0, T) -// 20.5 sec timeout, used for querying the SIM and sending SMSs -#define celliax_serial_write_AT_expect_longtime(P, D, S) celliax_serial_write_AT_expect1(P, D, S, 1, 20) -#define celliax_serial_write_AT_expect_longtime_noexpcr(P, D, S) celliax_serial_write_AT_expect1(P, D, S, 0, 20) -int celliax_serial_write_AT(struct celliax_pvt *p, const char *data); -int celliax_serial_write_AT_nocr(struct celliax_pvt *p, const char *data); -int celliax_serial_write_AT_ack(struct celliax_pvt *p, const char *data); -int celliax_serial_write_AT_ack_nocr_longtime(struct celliax_pvt *p, const char *data); -int celliax_serial_write_AT_noack(struct celliax_pvt *p, const char *data); -int celliax_serial_write_AT_expect1(struct celliax_pvt *p, const char *data, - const char *expected_string, int expect_crlf, - int seconds); -int celliax_serial_AT_expect(struct celliax_pvt *p, const char *expected_string, - int expect_crlf, int seconds); -int celliax_serial_read_AT(struct celliax_pvt *p, int look_for_ack, int timeout_usec, - int timeout_sec, const char *expected_string, int expect_crlf); -int celliax_serial_answer_AT(struct celliax_pvt *p); -int celliax_serial_hangup_AT(struct celliax_pvt *p); -int celliax_serial_config_AT(struct celliax_pvt *p); -int celliax_serial_call_AT(struct celliax_pvt *p, char *dstr); -int celliax_serial_sync_AT(struct celliax_pvt *p); -int celliax_serial_getstatus_AT(struct celliax_pvt *p); - -#ifdef ASTERISK_VERSION_1_6_0 -void celliax_store_boost(const char *s, double *boost); -#else -void celliax_store_boost(char *s, double *boost); -#endif /* ASTERISK_VERSION_1_6_0 */ -int celliax_console_set_active(int fd, int argc, char *argv[]); -#ifndef ASTERISK_VERSION_1_6_0 -int celliax_console_hangup(int fd, int argc, char *argv[]); -#else /* ASTERISK_VERSION_1_6_0 */ -char *celliax_console_hangup(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a); -#endif /* ASTERISK_VERSION_1_6_0 */ -int celliax_console_playback_boost(int fd, int argc, char *argv[]); -int celliax_console_capture_boost(int fd, int argc, char *argv[]); -int celliax_console_celliax(int fd, int argc, char *argv[]); -#ifdef CELLIAX_DIR -int celliax_console_celliax_dir_import(int fd, int argc, char *argv[]); -int celliax_console_celliax_dir_export(int fd, int argc, char *argv[]); -#endif /* CELLIAX_DIR */ -int celliax_console_dial(int fd, int argc, char *argv[]); -int celliax_console_sendsms(int fd, int argc, char *argv[]); -int celliax_portaudio_init(struct celliax_pvt *p); -int celliax_portaudio_shutdown(struct celliax_pvt *p); -struct ast_frame *celliax_portaudio_read(struct celliax_pvt *p); -int celliax_portaudio_write(struct celliax_pvt *p, struct ast_frame *f); -int celliax_portaudio_devlist(struct celliax_pvt *p); -#ifdef CELLIAX_DIR -int celliax_dir_exec(struct ast_channel *chan, void *data); -int celliax_dir_create_extensions(void); -int celliax_dir_play_mailbox_owner(struct ast_channel *chan, char *context, - char *dialcontext, char *ext, char *name); -struct ast_config *celliax_dir_realtime(char *context); -int celliax_dir_do(struct ast_channel *chan, struct ast_config *cfg, char *context, - char *dialcontext, char digit, int last); -#endif /* CELLIAX_DIR */ -#ifdef CELLIAX_LIBCSV -void celliax_cb1(char *s, size_t len, void *data); -void celliax_cb2(char c, void *data); -#endif /* CELLIAX_LIBCSV */ -int celliax_sendsms(struct ast_channel *c, void *data); -int celliax_console_echo(int fd, int argc, char *argv[]); -int celliax_console_at(int fd, int argc, char *argv[]); -#ifdef ASTERISK_VERSION_1_2 -int celliax_manager_sendsms(struct mansession *s, struct message *m); -#endif //ASTERISK_VERSION_1_2 -#ifdef ASTERISK_VERSION_1_4 -int celliax_manager_sendsms(struct mansession *s, const struct message *m); -#endif //ASTERISK_VERSION_1_4 -int utf_to_ucs2(struct celliax_pvt *p, char *utf_in, size_t inbytesleft, char *ucs2_out, - size_t outbytesleft); -int ucs2_to_utf8(struct celliax_pvt *p, char *ucs2_in, char *utf8_out, - size_t outbytesleft); -#endif /* _CELLIAX_H_ */ -#ifdef CELLIAX_ALSA -int console_alsa_period(int fd, int argc, char *argv[]); -#endif /* CELLIAX_ALSA */ -#ifdef CELLIAX_ALSA -int alsa_init(struct celliax_pvt *p); -int alsa_shutdown(struct celliax_pvt *p); -snd_pcm_t *alsa_open_dev(struct celliax_pvt *p, snd_pcm_stream_t stream); -struct ast_frame *alsa_read(struct celliax_pvt *p); -int alsa_write(struct celliax_pvt *p, struct ast_frame *f); -#endif /* CELLIAX_ALSA */ diff --git a/src/mod/endpoints/mod_gsmopen/asterisk/celliax_additional.c b/src/mod/endpoints/mod_gsmopen/asterisk/celliax_additional.c deleted file mode 100644 index efae699ab7..0000000000 --- a/src/mod/endpoints/mod_gsmopen/asterisk/celliax_additional.c +++ /dev/null @@ -1,7027 +0,0 @@ -//indent -gnu -ts4 -br -brs -cdw -lp -ce -nbfda -npcs -nprs -npsl -nbbo -saf -sai -saw -cs -bbo -nhnl -nut -sob -l90 -#include "celliax.h" -#include "iconv.h" - -extern int celliax_debug; -extern char *celliax_console_active; -extern char celliax_type[]; -extern struct celliax_pvt *celliax_iflist; -extern int celliax_dir_entry_extension; - -#ifndef GIOVA48 -#define SAMPLES_PER_FRAME 160 -#else // GIOVA48 -#define SAMPLES_PER_FRAME 960 -#endif // GIOVA48 - -#ifdef CELLIAX_ALSA -/*! \brief ALSA pcm format, according to endianess */ -#if __BYTE_ORDER == __LITTLE_ENDIAN -snd_pcm_format_t celliax_format = SND_PCM_FORMAT_S16_LE; -#else -snd_pcm_format_t celliax_format = SND_PCM_FORMAT_S16_BE; -#endif - -/*! - * \brief Initialize the ALSA soundcard channels (capture AND playback) used by one interface (a multichannel soundcard can be used by multiple interfaces) - * \param p the celliax_pvt of the interface - * - * This function call alsa_open_dev to initialize the ALSA soundcard for each channel (capture AND playback) used by one interface (a multichannel soundcard can be used by multiple interfaces). Called by sound_init - * - * \return zero on success, -1 on error. - */ -int alsa_init(struct celliax_pvt *p) -{ - p->alsac = alsa_open_dev(p, SND_PCM_STREAM_CAPTURE); - if (!p->alsac) { - ERRORA("Failed opening ALSA capture device: %s\n", CELLIAX_P_LOG, p->alsacname); - if (alsa_shutdown(p)) { - ERRORA("alsa_shutdown failed\n", CELLIAX_P_LOG); - return -1; - } - return -1; - } - p->alsap = alsa_open_dev(p, SND_PCM_STREAM_PLAYBACK); - if (!p->alsap) { - ERRORA("Failed opening ALSA playback device: %s\n", CELLIAX_P_LOG, p->alsapname); - if (alsa_shutdown(p)) { - ERRORA("alsa_shutdown failed\n", CELLIAX_P_LOG); - return -1; - } - return -1; - } - - /* make valgrind very happy */ - snd_config_update_free_global(); - return 0; -} - -/*! - * \brief Shutdown the ALSA soundcard channels (input and output) used by one interface (a multichannel soundcard can be used by multiple interfaces) - * \param p the celliax_pvt of the interface - * - * This function shutdown the ALSA soundcard channels (input and output) used by one interface (a multichannel soundcard can be used by multiple interfaces). Called by sound_init - * - * \return zero on success, -1 on error. - */ - -int alsa_shutdown(struct celliax_pvt *p) -{ - - int err; - - if (p->alsap) { - err = snd_pcm_drop(p->alsap); - if (err < 0) { - ERRORA("device [%s], snd_pcm_drop failed with error '%s'\n", CELLIAX_P_LOG, - p->alsapname, snd_strerror(err)); - return -1; - } - err = snd_pcm_close(p->alsap); - if (err < 0) { - ERRORA("device [%s], snd_pcm_close failed with error '%s'\n", CELLIAX_P_LOG, - p->alsapname, snd_strerror(err)); - return -1; - } - } - if (p->alsac) { - err = snd_pcm_drop(p->alsac); - if (err < 0) { - ERRORA("device [%s], snd_pcm_drop failed with error '%s'\n", CELLIAX_P_LOG, - p->alsacname, snd_strerror(err)); - return -1; - } - err = snd_pcm_close(p->alsac); - if (err < 0) { - ERRORA("device [%s], snd_pcm_close failed with error '%s'\n", CELLIAX_P_LOG, - p->alsacname, snd_strerror(err)); - return -1; - } - } - - return 0; -} - -/*! - * \brief Setup and open the ALSA device (capture OR playback) - * \param p the celliax_pvt of the interface - * \param stream the ALSA capture/playback definition - * - * This function setup and open the ALSA device (capture OR playback). Called by alsa_init - * - * \return zero on success, -1 on error. - */ -snd_pcm_t *alsa_open_dev(struct celliax_pvt * p, snd_pcm_stream_t stream) -{ - - snd_pcm_t *handle = NULL; - snd_pcm_hw_params_t *params; - snd_pcm_sw_params_t *swparams; - snd_pcm_uframes_t buffer_size; - int err; - size_t n; - //snd_pcm_uframes_t xfer_align; - unsigned int rate; - snd_pcm_uframes_t start_threshold, stop_threshold; - snd_pcm_uframes_t period_size = 0; - snd_pcm_uframes_t chunk_size = 0; - int start_delay = 0; - int stop_delay = 0; - snd_pcm_state_t state; - snd_pcm_info_t *info; - - period_size = p->alsa_period_size; - - snd_pcm_hw_params_alloca(¶ms); - snd_pcm_sw_params_alloca(&swparams); - - if (stream == SND_PCM_STREAM_CAPTURE) { - err = snd_pcm_open(&handle, p->alsacname, stream, 0 | SND_PCM_NONBLOCK); - } else { - err = snd_pcm_open(&handle, p->alsapname, stream, 0 | SND_PCM_NONBLOCK); - } - if (err < 0) { - ERRORA - ("snd_pcm_open failed with error '%s' on device '%s', if you are using a plughw:n device please change it to be a default:n device (so to allow it to be shared with other concurrent programs), or maybe you are using an ALSA voicemodem and slmodemd" - " is running?\n", CELLIAX_P_LOG, snd_strerror(err), - stream == SND_PCM_STREAM_CAPTURE ? p->alsacname : p->alsapname); - return NULL; - } - - snd_pcm_info_alloca(&info); - - if ((err = snd_pcm_info(handle, info)) < 0) { - ERRORA("info error: %s", CELLIAX_P_LOG, snd_strerror(err)); - return NULL; - } - - err = snd_pcm_nonblock(handle, 1); - if (err < 0) { - ERRORA("nonblock setting error: %s", CELLIAX_P_LOG, snd_strerror(err)); - return NULL; - } - - err = snd_pcm_hw_params_any(handle, params); - if (err < 0) { - ERRORA("Broken configuration for this PCM, no configurations available: %s\n", - CELLIAX_P_LOG, snd_strerror(err)); - return NULL; - } - - err = snd_pcm_hw_params_set_access(handle, params, SND_PCM_ACCESS_RW_INTERLEAVED); - if (err < 0) { - ERRORA("Access type not available: %s\n", CELLIAX_P_LOG, snd_strerror(err)); - return NULL; - } - err = snd_pcm_hw_params_set_format(handle, params, celliax_format); - if (err < 0) { - ERRORA("Sample format non available: %s\n", CELLIAX_P_LOG, snd_strerror(err)); - return NULL; - } - err = snd_pcm_hw_params_set_channels(handle, params, 1); - if (err < 0) { - DEBUGA_SOUND("Channels count set failed: %s\n", CELLIAX_P_LOG, snd_strerror(err)); - } -#if 1 - unsigned int chan_num; - err = snd_pcm_hw_params_get_channels(params, &chan_num); - if (err < 0) { - ERRORA("Channels count non available: %s\n", CELLIAX_P_LOG, snd_strerror(err)); - return NULL; - } - if (chan_num < 1 || chan_num > 2) { - ERRORA("Channels count MUST BE 1 or 2, it is: %d\n", CELLIAX_P_LOG, chan_num); - ERRORA("Channels count MUST BE 1 or 2, it is: %d on %s %s\n", CELLIAX_P_LOG, chan_num, - p->alsapname, p->alsacname); - return NULL; - } else { - if (chan_num == 1) { - if (stream == SND_PCM_STREAM_CAPTURE) - p->alsa_capture_is_mono = 1; - else - p->alsa_play_is_mono = 1; - } else { - if (stream == SND_PCM_STREAM_CAPTURE) - p->alsa_capture_is_mono = 0; - else - p->alsa_play_is_mono = 0; - } - } -#else - p->alsa_capture_is_mono = 1; - p->alsa_play_is_mono = 1; -#endif - -#if 0 - unsigned int buffer_time = 0; - unsigned int period_time = 0; - snd_pcm_uframes_t period_frames = 0; - snd_pcm_uframes_t buffer_frames = 0; - - if (buffer_time == 0 && buffer_frames == 0) { - err = snd_pcm_hw_params_get_buffer_time_max(params, &buffer_time, 0); - assert(err >= 0); - if (buffer_time > 500000) - buffer_time = 500000; - } - if (period_time == 0 && period_frames == 0) { - if (buffer_time > 0) - period_time = buffer_time / 4; - else - period_frames = buffer_frames / 4; - } - if (period_time > 0) - err = snd_pcm_hw_params_set_period_time_near(handle, params, &period_time, 0); - else - err = snd_pcm_hw_params_set_period_size_near(handle, params, &period_frames, 0); - assert(err >= 0); - if (buffer_time > 0) { - err = snd_pcm_hw_params_set_buffer_time_near(handle, params, &buffer_time, 0); - } else { - err = snd_pcm_hw_params_set_buffer_size_near(handle, params, &buffer_frames); - } -#endif - -#if 1 - rate = p->celliax_sound_rate; - err = snd_pcm_hw_params_set_rate_near(handle, params, &rate, 0); - if ((float) p->celliax_sound_rate * 1.05 < rate - || (float) p->celliax_sound_rate * 0.95 > rate) { - WARNINGA("Rate is not accurate (requested = %iHz, got = %iHz)\n", CELLIAX_P_LOG, - p->celliax_sound_rate, rate); - } - - if (err < 0) { - ERRORA("Error setting rate: %s\n", CELLIAX_P_LOG, snd_strerror(err)); - return NULL; - } - p->celliax_sound_rate = rate; - - err = snd_pcm_hw_params_set_period_size_near(handle, params, &period_size, 0); - - if (err < 0) { - ERRORA("Error setting period_size: %s\n", CELLIAX_P_LOG, snd_strerror(err)); - return NULL; - } - - p->alsa_period_size = period_size; - - p->alsa_buffer_size = p->alsa_period_size * p->alsa_periods_in_buffer; - - err = snd_pcm_hw_params_set_buffer_size_near(handle, params, &p->alsa_buffer_size); - - if (err < 0) { - ERRORA("Error setting buffer_size: %s\n", CELLIAX_P_LOG, snd_strerror(err)); - return NULL; - } -#endif - - err = snd_pcm_hw_params(handle, params); - if (err < 0) { - ERRORA("Unable to install hw params: %s\n", CELLIAX_P_LOG, snd_strerror(err)); - return NULL; - } - - snd_pcm_hw_params_get_period_size(params, &chunk_size, 0); - snd_pcm_hw_params_get_buffer_size(params, &buffer_size); - if (chunk_size == buffer_size) { - ERRORA("Can't use period equal to buffer size (%lu == %lu)\n", CELLIAX_P_LOG, - chunk_size, buffer_size); - return NULL; - } - - snd_pcm_sw_params_current(handle, swparams); - -#if 0 - err = snd_pcm_sw_params_get_xfer_align(swparams, &xfer_align); - if (err < 0) { - ERRORA("Unable to obtain xfer align: %s\n", CELLIAX_P_LOG, snd_strerror(err)); - } - NOTICA("xfer_align: %d\n", CELLIAX_P_LOG, xfer_align); - /* for some reason, on some platforms, xfer_align here is zero, that gives a floating point exception later. So, let's try to force it to 160, the frame size used by celliax */ - xfer_align = p->alsa_period_size; - NOTICA("xfer_align: %d\n", CELLIAX_P_LOG, xfer_align); - - err = snd_pcm_sw_params_set_xfer_align(handle, swparams, xfer_align); - if (err < 0) { - ERRORA("Error setting xfer_align: %s\n", CELLIAX_P_LOG, snd_strerror(err)); - } - NOTICA("xfer_align: %d\n", CELLIAX_P_LOG, xfer_align); - - err = snd_pcm_sw_params_get_xfer_align(swparams, &xfer_align); - if (err < 0) { - ERRORA("Unable to obtain xfer align: %s\n", CELLIAX_P_LOG, snd_strerror(err)); - } - NOTICA("xfer_align: %d\n", CELLIAX_P_LOG, xfer_align); -#endif - - /* - if (sleep_min) - xfer_align = 1; - err = snd_pcm_sw_params_set_sleep_min(handle, swparams, - 0); - - if (err < 0) { - ERRORA("Error setting slep_min: %s\n", CELLIAX_P_LOG, snd_strerror(err)); - } - */ - n = chunk_size; - err = snd_pcm_sw_params_set_avail_min(handle, swparams, n); - if (err < 0) { - ERRORA("Error setting avail_min: %s\n", CELLIAX_P_LOG, snd_strerror(err)); - } -#if 0 - /* round up to closest transfer boundary */ - if (xfer_align == 0) { //so to avoid floating point exception ???? - xfer_align = 160; - } - //original n = (buffer_size / xfer_align) * xfer_align; - n = (chunk_size / xfer_align) * xfer_align; -#endif - if (stream == SND_PCM_STREAM_CAPTURE) { - start_delay = 1; - } - if (start_delay <= 0) { - start_threshold = n + (double) rate *start_delay / 1000000; - } else { - start_threshold = (double) rate *start_delay / 1000000; - } - if (start_threshold < 1) - start_threshold = 1; - if (start_threshold > n) - start_threshold = n; - err = snd_pcm_sw_params_set_start_threshold(handle, swparams, start_threshold); - if (err < 0) { - ERRORA("Error setting start_threshold: %s\n", CELLIAX_P_LOG, snd_strerror(err)); - } - - if (stop_delay <= 0) - stop_threshold = buffer_size + (double) rate *stop_delay / 1000000; - else - stop_threshold = (double) rate *stop_delay / 1000000; - - if (stream == SND_PCM_STREAM_CAPTURE) { - stop_threshold = -1; - } - - err = snd_pcm_sw_params_set_stop_threshold(handle, swparams, stop_threshold); - - if (err < 0) { - ERRORA("Error setting stop_threshold: %s\n", CELLIAX_P_LOG, snd_strerror(err)); - } -#if 0 - err = snd_pcm_sw_params_set_xfer_align(handle, swparams, xfer_align); - - if (err < 0) { - ERRORA("Error setting xfer_align: %s\n", CELLIAX_P_LOG, snd_strerror(err)); - } -#endif - - if (snd_pcm_sw_params(handle, swparams) < 0) { - ERRORA("Error installing software parameters: %s\n", CELLIAX_P_LOG, - snd_strerror(err)); - } - - err = snd_pcm_poll_descriptors_count(handle); - if (err <= 0) { - ERRORA("Unable to get a poll descriptors count, error is %s\n", CELLIAX_P_LOG, - snd_strerror(err)); - return NULL; - } - - if (err != 1) { //number of poll descriptors - DEBUGA_SOUND("Can't handle more than one device\n", CELLIAX_P_LOG); - return NULL; - } - - err = snd_pcm_poll_descriptors(handle, &p->pfd, err); - if (err != 1) { - ERRORA("snd_pcm_poll_descriptors failed, %s\n", CELLIAX_P_LOG, snd_strerror(err)); - return NULL; - } - DEBUGA_SOUND("Acquired fd %d from the poll descriptor\n", CELLIAX_P_LOG, p->pfd.fd); - - if (stream == SND_PCM_STREAM_CAPTURE) { - p->celliax_sound_capt_fd = p->pfd.fd; - } - - state = snd_pcm_state(handle); - - if (state != SND_PCM_STATE_RUNNING) { - if (state != SND_PCM_STATE_PREPARED) { - err = snd_pcm_prepare(handle); - if (err) { - ERRORA("snd_pcm_prepare failed, %s\n", CELLIAX_P_LOG, snd_strerror(err)); - return NULL; - } - DEBUGA_SOUND("prepared!\n", CELLIAX_P_LOG); - } - if (stream == SND_PCM_STREAM_CAPTURE) { - err = snd_pcm_start(handle); - if (err) { - ERRORA("snd_pcm_start failed, %s\n", CELLIAX_P_LOG, snd_strerror(err)); - return NULL; - } - DEBUGA_SOUND("started!\n", CELLIAX_P_LOG); - } - } - if (option_debug > 1) { - snd_output_t *output = NULL; - err = snd_output_stdio_attach(&output, stdout, 0); - if (err < 0) { - ERRORA("snd_output_stdio_attach failed: %s\n", CELLIAX_P_LOG, snd_strerror(err)); - } - snd_pcm_dump(handle, output); - } - if (option_debug > 1) - DEBUGA_SOUND("ALSA handle = %ld\n", CELLIAX_P_LOG, (long int) handle); - return handle; - -} - -/*! \brief Read audio frames from interface */ - -struct ast_frame *alsa_read(struct celliax_pvt *p) -{ - static struct ast_frame f; - static short __buf[CELLIAX_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2]; - static short __buf2[(CELLIAX_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2]; - short *buf; - short *buf2; - static int readpos = 0; - static int left = CELLIAX_FRAME_SIZE; - snd_pcm_state_t state; - int r = 0; - int off = 0; - int error = 0; - //time_t now_timestamp; - - //memset(&f, 0, sizeof(struct ast_frame)); //giova - - f.frametype = AST_FRAME_NULL; - f.subclass = 0; - f.samples = 0; - f.datalen = 0; - f.data = NULL; - f.offset = 0; - f.src = celliax_type; - f.mallocd = 0; - f.delivery.tv_sec = 0; - f.delivery.tv_usec = 0; - - state = snd_pcm_state(p->alsac); - if (state != SND_PCM_STATE_RUNNING) { - DEBUGA_SOUND("ALSA read state is not SND_PCM_STATE_RUNNING\n", CELLIAX_P_LOG); - - if (state != SND_PCM_STATE_PREPARED) { - error = snd_pcm_prepare(p->alsac); - if (error) { - ERRORA("snd_pcm_prepare failed, %s\n", CELLIAX_P_LOG, snd_strerror(error)); - return &f; - } - DEBUGA_SOUND("prepared!\n", CELLIAX_P_LOG); - } - usleep(1000); - error = snd_pcm_start(p->alsac); - if (error) { - ERRORA("snd_pcm_start failed, %s\n", CELLIAX_P_LOG, snd_strerror(error)); - return &f; - } - DEBUGA_SOUND("started!\n", CELLIAX_P_LOG); - usleep(1000); - } - - buf = __buf + AST_FRIENDLY_OFFSET / 2; - buf2 = __buf2 + ((AST_FRIENDLY_OFFSET / 2) * 2); - - if (p->alsa_capture_is_mono) { - r = snd_pcm_readi(p->alsac, buf + readpos, left); - } else { - r = snd_pcm_readi(p->alsac, buf2 + (readpos * 2), left); - - int a = 0; - int i = 0; - for (i = 0; i < (CELLIAX_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2;) { - __buf[a] = (__buf2[i] + __buf2[i + 1]) / 2; //comment out this line to use only left - //__buf[a] = __buf2[i]; // enable this line to use only left - a++; - i++; - i++; - } - } - - if (r == -EPIPE) { - ERRORA("XRUN read\n\n\n\n\n", CELLIAX_P_LOG); - return &f; - } else if (r == -ESTRPIPE) { - ERRORA("-ESTRPIPE\n", CELLIAX_P_LOG); - return &f; - - } else if (r == -EAGAIN) { - DEBUGA_SOUND("ALSA read -EAGAIN, the soundcard is not ready to be read by celliax\n", - CELLIAX_P_LOG); - while (r == -EAGAIN) { - usleep(1000); - - if (p->alsa_capture_is_mono) { - r = snd_pcm_readi(p->alsac, buf + readpos, left); - } else { - r = snd_pcm_readi(p->alsac, buf2 + (readpos * 2), left); - - int a = 0; - int i = 0; - for (i = 0; i < (CELLIAX_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2;) { - __buf[a] = (__buf2[i] + __buf2[i + 1]) / 2; - a++; - i++; - i++; - } - } - - } - } else if (r < 0) { - WARNINGA("ALSA Read error: %s\n", CELLIAX_P_LOG, snd_strerror(r)); - } else if (r >= 0) { - //DEBUGA_SOUND("read: r=%d, readpos=%d, left=%d, off=%d\n", CELLIAX_P_LOG, r, readpos, left, off); - off -= r; //what is the meaning of this? a leftover, probably - } - /* Update positions */ - readpos += r; - left -= r; - - if (readpos >= CELLIAX_FRAME_SIZE) { - /* A real frame */ - readpos = 0; - left = CELLIAX_FRAME_SIZE; - - f.frametype = AST_FRAME_VOICE; - f.subclass = AST_FORMAT_SLINEAR; - f.samples = CELLIAX_FRAME_SIZE; - f.datalen = CELLIAX_FRAME_SIZE * 2; - f.data = buf; - f.offset = AST_FRIENDLY_OFFSET; - f.src = celliax_type; - f.mallocd = 0; -#ifdef ALSA_MONITOR - alsa_monitor_read((char *) buf, CELLIAX_FRAME_SIZE * 2); -#endif - - } - return &f; -} - -/*! \brief Write audio frames to interface */ -int alsa_write(struct celliax_pvt *p, struct ast_frame *f) -{ - static char sizbuf[8000]; - static char sizbuf2[16000]; - static char silencebuf[8000]; - static int sizpos = 0; - int len = sizpos; - int pos; - int res = 0; - time_t now_timestamp; - /* size_t frames = 0; */ - snd_pcm_state_t state; - snd_pcm_sframes_t delayp1; - snd_pcm_sframes_t delayp2; - - /* We have to digest the frame in 160-byte portions */ - if (f->datalen > sizeof(sizbuf) - sizpos) { - ERRORA("Frame too large\n", CELLIAX_P_LOG); - res = -1; - } else { - memcpy(sizbuf + sizpos, f->data, f->datalen); - len += f->datalen; - pos = 0; -#ifdef ALSA_MONITOR - alsa_monitor_write(sizbuf, len); -#endif - state = snd_pcm_state(p->alsap); - if (state == SND_PCM_STATE_XRUN) { - int i; - - DEBUGA_SOUND - ("You've got an ALSA write XRUN in the past (celliax can't fill the soundcard buffer fast enough). If this happens often (not after silence or after a pause in the speech, that's OK), and appear to damage the sound quality, first check if you have some IRQ problem, maybe sharing the soundcard IRQ with a broken or heavy loaded ethernet or graphic card. Then consider to increase the alsa_periods_in_buffer (now is set to %d) for this interface in the config file\n", - CELLIAX_P_LOG, p->alsa_periods_in_buffer); - res = snd_pcm_prepare(p->alsap); - if (res) { - ERRORA("audio play prepare failed: %s\n", CELLIAX_P_LOG, snd_strerror(res)); - } else { - res = snd_pcm_format_set_silence(celliax_format, silencebuf, len / 2); - if (res < 0) { - DEBUGA_SOUND("Silence error %s\n", CELLIAX_P_LOG, snd_strerror(res)); - res = -1; - } - for (i = 0; i < (p->alsa_periods_in_buffer - 1); i++) { - res = snd_pcm_writei(p->alsap, silencebuf, len / 2); - if (res != len / 2) { - DEBUGA_SOUND("Write returned a different quantity: %d\n", CELLIAX_P_LOG, res); - res = -1; - } else if (res < 0) { - DEBUGA_SOUND("Write error %s\n", CELLIAX_P_LOG, snd_strerror(res)); - res = -1; - } - } - } - - } - - res = snd_pcm_delay(p->alsap, &delayp1); - if (res < 0) { - DEBUGA_SOUND("Error %d on snd_pcm_delay: \"%s\"\n", CELLIAX_P_LOG, res, - snd_strerror(res)); - res = snd_pcm_prepare(p->alsap); - if (res) { - DEBUGA_SOUND("snd_pcm_prepare failed: '%s'\n", CELLIAX_P_LOG, snd_strerror(res)); - } - res = snd_pcm_delay(p->alsap, &delayp1); - } - - delayp2 = snd_pcm_avail_update(p->alsap); - if (delayp2 < 0) { - DEBUGA_SOUND("Error %d on snd_pcm_avail_update: \"%s\"\n", CELLIAX_P_LOG, - (int) delayp2, snd_strerror(delayp2)); - - res = snd_pcm_prepare(p->alsap); - if (res) { - DEBUGA_SOUND("snd_pcm_prepare failed: '%s'\n", CELLIAX_P_LOG, snd_strerror(res)); - } - delayp2 = snd_pcm_avail_update(p->alsap); - } - - if ( /* delayp1 != 0 && delayp1 != 160 */ - delayp1 < 160 || delayp2 > p->alsa_buffer_size) { - - res = snd_pcm_prepare(p->alsap); - if (res) { - DEBUGA_SOUND - ("snd_pcm_prepare failed while trying to prevent an ALSA write XRUN: %s, delayp1=%d, delayp2=%d\n", - CELLIAX_P_LOG, snd_strerror(res), (int) delayp1, (int) delayp2); - } else { - - int i; - for (i = 0; i < (p->alsa_periods_in_buffer - 1); i++) { - res = snd_pcm_format_set_silence(celliax_format, silencebuf, len / 2); - if (res < 0) { - DEBUGA_SOUND("Silence error %s\n", CELLIAX_P_LOG, snd_strerror(res)); - res = -1; - } - res = snd_pcm_writei(p->alsap, silencebuf, len / 2); - if (res < 0) { - DEBUGA_SOUND("Write error %s\n", CELLIAX_P_LOG, snd_strerror(res)); - res = -1; - } else if (res != len / 2) { - DEBUGA_SOUND("Write returned a different quantity: %d\n", CELLIAX_P_LOG, res); - res = -1; - } - } - - DEBUGA_SOUND - ("PREVENTING an ALSA write XRUN (celliax can't fill the soundcard buffer fast enough). If this happens often (not after silence or after a pause in the speech, that's OK), and appear to damage the sound quality, first check if you have some IRQ problem, maybe sharing the soundcard IRQ with a broken or heavy loaded ethernet or graphic card. Then consider to increase the alsa_periods_in_buffer (now is set to %d) for this interface in the config file. delayp1=%d, delayp2=%d\n", - CELLIAX_P_LOG, p->alsa_periods_in_buffer, (int) delayp1, (int) delayp2); - } - - } - - memset(sizbuf2, 0, sizeof(sizbuf2)); - if (p->alsa_play_is_mono) { - res = snd_pcm_writei(p->alsap, sizbuf, len / 2); - } else { - int a = 0; - int i = 0; - for (i = 0; i < 8000;) { - sizbuf2[a] = sizbuf[i]; - a++; - i++; - sizbuf2[a] = sizbuf[i]; - a++; - i--; - sizbuf2[a] = sizbuf[i]; // comment out this line to use only left - a++; - i++; - sizbuf2[a] = sizbuf[i]; // comment out this line to use only left - a++; - i++; - } - res = snd_pcm_writei(p->alsap, sizbuf2, len); - } - if (res == -EPIPE) { - DEBUGA_SOUND - ("ALSA write EPIPE (XRUN) (celliax can't fill the soundcard buffer fast enough). If this happens often (not after silence or after a pause in the speech, that's OK), and appear to damage the sound quality, first check if you have some IRQ problem, maybe sharing the soundcard IRQ with a broken or heavy loaded ethernet or graphic card. Then consider to increase the alsa_periods_in_buffer (now is set to %d) for this interface in the config file. delayp1=%d, delayp2=%d\n", - CELLIAX_P_LOG, p->alsa_periods_in_buffer, (int) delayp1, (int) delayp2); - res = snd_pcm_prepare(p->alsap); - if (res) { - ERRORA("audio play prepare failed: %s\n", CELLIAX_P_LOG, snd_strerror(res)); - } else { - - if (p->alsa_play_is_mono) { - res = snd_pcm_writei(p->alsap, sizbuf, len / 2); - } else { - int a = 0; - int i = 0; - for (i = 0; i < 8000;) { - sizbuf2[a] = sizbuf[i]; - a++; - i++; - sizbuf2[a] = sizbuf[i]; - a++; - i--; - sizbuf2[a] = sizbuf[i]; - a++; - i++; - sizbuf2[a] = sizbuf[i]; - a++; - i++; - } - res = snd_pcm_writei(p->alsap, sizbuf2, len); - } - - } - - } else { - if (res == -ESTRPIPE) { - ERRORA("You've got some big problems\n", CELLIAX_P_LOG); - } else if (res == -EAGAIN) { - res = 0; - } else if (res < 0) { - ERRORA("Error %d on audio write: \"%s\"\n", CELLIAX_P_LOG, res, - snd_strerror(res)); - } - } - } - - if (p->audio_play_reset_period) { - time(&now_timestamp); - if ((now_timestamp - p->audio_play_reset_timestamp) > p->audio_play_reset_period) { - if (option_debug) - DEBUGA_SOUND("reset audio play\n", CELLIAX_P_LOG); - res = snd_pcm_wait(p->alsap, 1000); - if (res < 0) { - ERRORA("audio play wait failed: %s\n", CELLIAX_P_LOG, snd_strerror(res)); - } - res = snd_pcm_drop(p->alsap); - if (res) { - ERRORA("audio play drop failed: %s\n", CELLIAX_P_LOG, snd_strerror(res)); - } - res = snd_pcm_prepare(p->alsap); - if (res) { - ERRORA("audio play prepare failed: %s\n", CELLIAX_P_LOG, snd_strerror(res)); - } - res = snd_pcm_wait(p->alsap, 1000); - if (res < 0) { - ERRORA("audio play wait failed: %s\n", CELLIAX_P_LOG, snd_strerror(res)); - } - time(&p->audio_play_reset_timestamp); - } - } - res = 0; - if (res > 0) - res = 0; - return res; -} - - -/*! \brief Write audio frames to interface */ -#endif /* CELLIAX_ALSA */ - -#ifdef CELLIAX_PORTAUDIO -int celliax_portaudio_devlist(struct celliax_pvt *p) -{ - int i, numDevices; - const PaDeviceInfo *deviceInfo; - - numDevices = Pa_GetDeviceCount(); - if (numDevices < 0) { - return 0; - } - for (i = 0; i < numDevices; i++) { - deviceInfo = Pa_GetDeviceInfo(i); - NOTICA - ("Found PORTAUDIO device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", - CELLIAX_P_LOG, i, deviceInfo->name, deviceInfo->maxInputChannels, - deviceInfo->maxOutputChannels); - } - - return numDevices; -} - -int celliax_portaudio_init(struct celliax_pvt *p) -{ - PaError err; - int c; - PaStreamParameters inputParameters, outputParameters; - int numdevices; - const PaDeviceInfo *deviceInfo; - -#ifndef GIOVA48 - setenv("PA_ALSA_PLUGHW", "1", 1); -#endif // GIOVA48 - - err = Pa_Initialize(); - if (err != paNoError) - return err; - - numdevices = celliax_portaudio_devlist(p); - - if (p->portaudiocindex > (numdevices - 1)) { - ERRORA("Portaudio Capture id=%d is out of range: valid id are from 0 to %d\n", - CELLIAX_P_LOG, p->portaudiocindex, (numdevices - 1)); - return -1; - } - - if (p->portaudiopindex > (numdevices - 1)) { - ERRORA("Portaudio Playback id=%d is out of range: valid id are from 0 to %d\n", - CELLIAX_P_LOG, p->portaudiopindex, (numdevices - 1)); - return -1; - } - //inputParameters.device = 0; - if (p->portaudiocindex != -1) { - inputParameters.device = p->portaudiocindex; - } else { - inputParameters.device = Pa_GetDefaultInputDevice(); - } - deviceInfo = Pa_GetDeviceInfo(inputParameters.device); - NOTICA - ("Using INPUT PORTAUDIO device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", - CELLIAX_P_LOG, inputParameters.device, deviceInfo->name, - deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels); - if (deviceInfo->maxInputChannels == 0) { - ERRORA - ("No INPUT channels on device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", - CELLIAX_P_LOG, inputParameters.device, deviceInfo->name, - deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels); - return -1; - } - inputParameters.channelCount = 1; - inputParameters.sampleFormat = paInt16; - //inputParameters.suggestedLatency = Pa_GetDeviceInfo(inputParameters.device)->defaultHighInputLatency; - inputParameters.suggestedLatency = 0.1; - inputParameters.hostApiSpecificStreamInfo = NULL; - - //outputParameters.device = 3; - if (p->portaudiopindex != -1) { - outputParameters.device = p->portaudiopindex; - } else { - outputParameters.device = Pa_GetDefaultOutputDevice(); - } - deviceInfo = Pa_GetDeviceInfo(outputParameters.device); - NOTICA - ("Using OUTPUT PORTAUDIO device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", - CELLIAX_P_LOG, outputParameters.device, deviceInfo->name, - deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels); - if (deviceInfo->maxOutputChannels == 0) { - ERRORA - ("No OUTPUT channels on device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n", - CELLIAX_P_LOG, inputParameters.device, deviceInfo->name, - deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels); - return -1; - } -#ifndef GIOVA48 - outputParameters.channelCount = 1; -#else // GIOVA48 - outputParameters.channelCount = 2; -#endif // GIOVA48 - outputParameters.sampleFormat = paInt16; - //outputParameters.suggestedLatency = Pa_GetDeviceInfo(outputParameters.device)->defaultHighOutputLatency; - outputParameters.suggestedLatency = 0.1; - outputParameters.hostApiSpecificStreamInfo = NULL; - -/* build the pipe that will be polled on by pbx */ - c = pipe(p->audiopipe); - if (c) { - ERRORA("Unable to create audio pipe\n", CELLIAX_P_LOG); - return -1; - } - fcntl(p->audiopipe[0], F_SETFL, O_NONBLOCK); - fcntl(p->audiopipe[1], F_SETFL, O_NONBLOCK); - - err = -#ifndef GIOVA48 - OpenAudioStream(&p->stream, &inputParameters, &outputParameters, 8000, - paDitherOff | paClipOff, SAMPLES_PER_FRAME, p->audiopipe[1], - &p->speexecho, &p->speexpreprocess, &p->owner); - -#else // GIOVA48 - OpenAudioStream(&p->stream, &inputParameters, &outputParameters, 48000, - paDitherOff | paClipOff, SAMPLES_PER_FRAME, p->audiopipe[1], - &p->speexecho, &p->speexpreprocess, &p->owner); - -#endif // GIOVA48 - if (err != paNoError) { - ERRORA("Unable to open audio stream: %s\n", CELLIAX_P_LOG, Pa_GetErrorText(err)); - return -1; - } - -/* the pipe is our audio fd for pbx to poll on */ - p->celliax_sound_capt_fd = p->audiopipe[0]; - - return 0; -} - -int celliax_portaudio_write(struct celliax_pvt *p, struct ast_frame *f) -{ - int samples; -#ifdef GIOVA48 - //short buf[CELLIAX_FRAME_SIZE * 2]; - short buf[3840]; - short *buf2; - - //ERRORA("1 f->datalen=: %d\n", CELLIAX_P_LOG, f->datalen); - - memset(buf, '\0', CELLIAX_FRAME_SIZE * 2); - - buf2 = f->data; - - int i = 0, a = 0; - - for (i = 0; i < f->datalen / sizeof(short); i++) { -//stereo, 2 chan 48 -> mono 8 - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - buf[a] = buf2[i]; - a++; - /* - */ - } - f->data = &buf; - f->datalen = f->datalen * 6; - //ERRORA("2 f->datalen=: %d\n", CELLIAX_P_LOG, f->datalen); - //f->datalen = f->datalen; -#endif // GIOVA48 - -#ifdef ASTERISK_VERSION_1_6_0_1 - samples = - WriteAudioStream(p->stream, (short *) f->data.ptr, - (int) (f->datalen / sizeof(short))); -#else - samples = - WriteAudioStream(p->stream, (short *) f->data, (int) (f->datalen / sizeof(short))); -#endif /* ASTERISK_VERSION_1_6_0_1 */ - - if (samples != (int) (f->datalen / sizeof(short))) - ERRORA("WriteAudioStream wrote: %d of %d\n", CELLIAX_P_LOG, samples, - (int) (f->datalen / sizeof(short))); - - return 0; -} - -struct ast_frame *celliax_portaudio_read(struct celliax_pvt *p) -{ - static struct ast_frame f; - static short __buf[CELLIAX_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2]; - short *buf; - static short __buf2[CELLIAX_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2]; - short *buf2; - int samples; - char c; - - memset(__buf, '\0', (CELLIAX_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2)); - - buf = __buf + AST_FRIENDLY_OFFSET / 2; - - memset(__buf2, '\0', (CELLIAX_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2)); - - buf2 = __buf2 + AST_FRIENDLY_OFFSET / 2; - - f.frametype = AST_FRAME_NULL; - f.subclass = 0; - f.samples = 0; - f.datalen = 0; - -#ifdef ASTERISK_VERSION_1_6_0_1 - f.data.ptr = NULL; -#else - f.data = NULL; -#endif /* ASTERISK_VERSION_1_6_0_1 */ - f.offset = 0; - f.src = celliax_type; - f.mallocd = 0; - f.delivery.tv_sec = 0; - f.delivery.tv_usec = 0; - - if ((samples = ReadAudioStream(p->stream, buf, SAMPLES_PER_FRAME)) == 0) { - //do nothing - } else { -#ifdef GIOVA48 - int i = 0, a = 0; - - samples = samples / 6; - for (i = 0; i < samples; i++) { - buf2[i] = buf[a]; - a = a + 6; //mono, 1 chan 48 -> 8 - } - buf = buf2; - - /* A real frame */ - f.frametype = AST_FRAME_VOICE; - f.subclass = AST_FORMAT_SLINEAR; - f.samples = CELLIAX_FRAME_SIZE / 6; - f.datalen = CELLIAX_FRAME_SIZE * 2 / 6; -#else // GIOVA48 - /* A real frame */ - f.frametype = AST_FRAME_VOICE; - f.subclass = AST_FORMAT_SLINEAR; - f.samples = CELLIAX_FRAME_SIZE; - f.datalen = CELLIAX_FRAME_SIZE * 2; -#endif // GIOVA48 - -#ifdef ASTERISK_VERSION_1_6_0_1 - f.data.ptr = buf; -#else - f.data = buf; -#endif /* ASTERISK_VERSION_1_6_0_1 */ - f.offset = AST_FRIENDLY_OFFSET; - f.src = celliax_type; - f.mallocd = 0; - } - - read(p->audiopipe[0], &c, 1); - - return &f; -} - -int celliax_portaudio_shutdown(struct celliax_pvt *p) -{ - PaError err; - - err = CloseAudioStream(p->stream); - - if (err != paNoError) - ERRORA("not able to CloseAudioStream\n", CELLIAX_P_LOG); - - Pa_Terminate(); - return 0; -} -#endif // CELLIAX_PORTAUDIO - -int celliax_serial_sync_AT(struct celliax_pvt *p) -{ - usleep(10000); /* 10msec */ - time(&p->celliax_serial_synced_timestamp); - return 0; -} - -int celliax_serial_getstatus_AT(struct celliax_pvt *p) -{ - int res; - - if (p->owner) { - if (p->owner->_state != AST_STATE_UP && p->owner->_state != AST_STATE_DOWN) { - DEBUGA_AT("No getstatus, we're neither UP nor DOWN\n", CELLIAX_P_LOG); - return 0; - } - } - - PUSHA_UNLOCKA(&p->controldev_lock); - LOKKA(&p->controldev_lock); - res = celliax_serial_write_AT_ack(p, "AT"); - if (res) { - ERRORA("AT was not acknowledged, continuing but maybe there is a problem\n", - CELLIAX_P_LOG); - } - usleep(1000); - - if (strlen(p->at_query_battchg)) { - res = - celliax_serial_write_AT_expect(p, p->at_query_battchg, p->at_query_battchg_expect); - if (res) { - WARNINGA("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, - p->at_query_battchg, p->at_query_battchg_expect); - } - usleep(1000); - } - - if (strlen(p->at_query_signal)) { - res = - celliax_serial_write_AT_expect(p, p->at_query_signal, p->at_query_signal_expect); - if (res) { - WARNINGA("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, - p->at_query_signal, p->at_query_signal_expect); - } - usleep(1000); - } - //FIXME all the following commands in config! - - if (p->sms_cnmi_not_supported) { - res = celliax_serial_write_AT_ack(p, "AT+MMGL=\"HEADER ONLY\""); - if (res) { - WARNINGA - ("%s does not get %s from the modem, maybe a long msg is incoming. If this cellmodem is not a Motorola, you are arriving here because your cellmodem do not supports CNMI kind of incoming SMS alert; please let it know to the developers of Celliax. If this cellmodem is a Motorola and this message keeps repeating, and you cannot correctly receive SMSs from this interface, please manually clean all messages from the cellmodem/SIM. Continuing.\n", - CELLIAX_P_LOG, "AT+MMGL=\"HEADER ONLY\"", "OK"); - } else { - usleep(1000); - if (p->unread_sms_msg_id) { - char at_command[256]; - - if (p->no_ucs2 == 0) { - res = celliax_serial_write_AT_ack(p, "AT+CSCS=\"UCS2\""); - if (res) { - ERRORA - ("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone\n", - CELLIAX_P_LOG); - memset(p->sms_message, 0, sizeof(p->sms_message)); - } - } - - memset(at_command, 0, sizeof(at_command)); - sprintf(at_command, "AT+CMGR=%d", p->unread_sms_msg_id); - memset(p->sms_message, 0, sizeof(p->sms_message)); - - p->reading_sms_msg = 1; - res = celliax_serial_write_AT_ack(p, at_command); - p->reading_sms_msg = 0; - if (res) { - ERRORA - ("AT+CMGR (read SMS) do not got OK from the phone, message sent was:|||%s|||\n", - CELLIAX_P_LOG, at_command); - } - res = celliax_serial_write_AT_ack(p, "AT+CSCS=\"GSM\""); - if (res) { - ERRORA - ("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n", - CELLIAX_P_LOG); - } - memset(at_command, 0, sizeof(at_command)); - sprintf(at_command, "AT+CMGD=%d", p->unread_sms_msg_id); /* delete the message */ - p->unread_sms_msg_id = 0; - res = celliax_serial_write_AT_ack(p, at_command); - if (res) { - ERRORA - ("AT+CMGD (Delete SMS) do not got OK from the phone, message sent was:|||%s|||\n", - CELLIAX_P_LOG, at_command); - } - - if (strlen(p->sms_message)) { - - manager_event(EVENT_FLAG_SYSTEM, "CELLIAXincomingsms", - "Interface: %s\r\nSMS_Message: %s\r\n", p->name, p->sms_message); - - if (strlen(p->sms_receiving_program)) { - int fd1[2]; - pid_t pid1; - char *arg1[] = { p->sms_receiving_program, (char *) NULL }; - int i; - - NOTICA("incoming SMS message:>>>%s<<<\n", CELLIAX_P_LOG, p->sms_message); - pipe(fd1); - pid1 = switch_fork(); - - if (pid1 == 0) { //child - int err; - - dup2(fd1[0], 0); // Connect stdin to pipe output - close(fd1[1]); // close input pipe side - setsid(); //session id - err = execvp(arg1[0], arg1); //exec our program, with stdin connected to pipe output - if (err) { - ERRORA - ("'sms_receiving_program' is set in config file to '%s', and it gave us back this error: %d, (%s). SMS received was:---%s---\n", - CELLIAX_P_LOG, p->sms_receiving_program, err, strerror(errno), - p->sms_message); - } - close(fd1[0]); // close output pipe side - } //starting here continue the parent - close(fd1[0]); // close output pipe side - // write the msg on the pipe input - for (i = 0; i < strlen(p->sms_message); i++) { - write(fd1[1], &p->sms_message[i], 1); - } - close(fd1[1]); // close pipe input, let our program know we've finished - } else { - ERRORA - ("got SMS incoming message, but 'sms_receiving_program' is not set in config file. SMS received was:---%s---\n", - CELLIAX_P_LOG, p->sms_message); - } - } -#if 1 //is this one needed? maybe it can interrupt an incoming call that is just to announce itself - if (p->phone_callflow == CALLFLOW_CALL_IDLE - && p->interface_state == AST_STATE_DOWN && p->owner == NULL) { - /* we're not in a call, neither calling */ - res = celliax_serial_write_AT_ack(p, "AT+CKPD=\"EEE\""); - if (res) { - ERRORA - ("AT+CKPD=\"EEE\" (cellphone screen back to user) do not got OK from the phone\n", - CELLIAX_P_LOG); - } - } -#endif - } - } - } - - UNLOCKA(&p->controldev_lock); - POPPA_UNLOCKA(&p->controldev_lock); - return 0; -} - -int celliax_serial_read_AT(struct celliax_pvt *p, int look_for_ack, int timeout_usec, - int timeout_sec, const char *expected_string, int expect_crlf) -{ - int select_err; - int res; - fd_set read_fds; - struct timeval timeout; - char tmp_answer[AT_BUFSIZ]; - char tmp_answer2[AT_BUFSIZ]; - char *tmp_answer_ptr; - char *last_line_ptr; - int i = 0; - int read_count = 0; - int la_counter = 0; - int at_ack = -1; - int la_read = 0; - - FD_ZERO(&read_fds); - FD_SET(p->controldevfd, &read_fds); - - //NOTICA (" INSIDE this celliax_serial_device %s \n", CELLIAX_P_LOG, p->controldevice_name); - tmp_answer_ptr = tmp_answer; - memset(tmp_answer, 0, sizeof(char) * AT_BUFSIZ); - - timeout.tv_sec = timeout_sec; - timeout.tv_usec = timeout_usec; - PUSHA_UNLOCKA(&p->controldev_lock); - LOKKA(&p->controldev_lock); - - while ((select_err = select(p->controldevfd + 1, &read_fds, NULL, NULL, &timeout)) > 0) { - timeout.tv_sec = timeout_sec; //reset the timeout, linux modify it - timeout.tv_usec = timeout_usec; //reset the timeout, linux modify it - read_count = - read(p->controldevfd, tmp_answer_ptr, AT_BUFSIZ - (tmp_answer_ptr - tmp_answer)); - - if (read_count == 0) { - ERRORA - ("read 0 bytes!!! Nenormalno! Marking this celliax_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n", - CELLIAX_P_LOG, p->controldevice_name); - p->controldev_dead = 1; - close(p->controldevfd); - UNLOCKA(&p->controldev_lock); - if (p->owner) { - p->owner->hangupcause = AST_CAUSE_FAILURE; - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - } - return -1; - } - - if (option_debug > 90) { - //DEBUGA_AT("1 read %d bytes, --|%s|--\n", CELLIAX_P_LOG, read_count, tmp_answer_ptr); - //DEBUGA_AT("2 read %d bytes, --|%s|--\n", CELLIAX_P_LOG, read_count, tmp_answer); - } - tmp_answer_ptr = tmp_answer_ptr + read_count; - - char *token_ptr; - - la_counter = 0; - memset(tmp_answer2, 0, sizeof(char) * AT_BUFSIZ); - strcpy(tmp_answer2, tmp_answer); - if ((token_ptr = strtok(tmp_answer2, "\n\r"))) { - last_line_ptr = token_ptr; - strncpy(p->line_array.result[la_counter], token_ptr, AT_MESG_MAX_LENGTH); - if (strlen(token_ptr) > AT_MESG_MAX_LENGTH) { - WARNINGA - ("AT mesg longer than buffer, original message was: |%s|, in buffer only: |%s|\n", - CELLIAX_P_LOG, token_ptr, p->line_array.result[la_counter]); - } - la_counter++; - while ((token_ptr = strtok(NULL, "\n\r"))) { - last_line_ptr = token_ptr; - strncpy(p->line_array.result[la_counter], token_ptr, AT_MESG_MAX_LENGTH); - if (strlen(token_ptr) > AT_MESG_MAX_LENGTH) { - WARNINGA - ("AT mesg longer than buffer, original message was: |%s|, in buffer only: |%s|\n", - CELLIAX_P_LOG, token_ptr, p->line_array.result[la_counter]); - } - la_counter++; - } - } else { - last_line_ptr = tmp_answer; - } - - if (expected_string && !expect_crlf) { - DEBUGA_AT - ("last_line_ptr=|%s|, expected_string=|%s|, expect_crlf=%d, memcmp(last_line_ptr, expected_string, strlen(expected_string)) = %d\n", - CELLIAX_P_LOG, last_line_ptr, expected_string, expect_crlf, memcmp(last_line_ptr, - expected_string, - strlen - (expected_string))); - } - - if (expected_string && !expect_crlf - && !memcmp(last_line_ptr, expected_string, strlen(expected_string)) - ) { - strncpy(p->line_array.result[la_counter], last_line_ptr, AT_MESG_MAX_LENGTH); - // match expected string -> accept it withtout CRLF - la_counter++; - - } - /* if the last line read was not a complete line, we'll read the rest in the future */ - else if (tmp_answer[strlen(tmp_answer) - 1] != '\r' - && tmp_answer[strlen(tmp_answer) - 1] != '\n') - la_counter--; - - /* let's list the complete lines read so far, without re-listing the lines that has yet been listed */ - if (option_debug > 1) { - for (i = la_read; i < la_counter; i++) - DEBUGA_AT("Read line %d: |%s|\n", CELLIAX_P_LOG, i, p->line_array.result[i]); - } - - /* let's interpret the complete lines read so far (WITHOUT looking for OK, ERROR, and EXPECTED_STRING), without re-interpreting the lines that has been yet interpreted, so we're sure we don't miss anything */ - for (i = la_read; i < la_counter; i++) { - - if ((strcmp(p->line_array.result[i], "RING") == 0)) { - /* with first RING we wait for callid */ - gettimeofday(&(p->ringtime), NULL); - /* give CALLID (+CLIP) a chance, wait for the next RING before answering */ - if (p->phone_callflow == CALLFLOW_INCOMING_RING) { - /* we're at the second ring, set the interface state, will be answered by celliax_do_monitor */ - DEBUGA_AT("|%s| got second RING\n", CELLIAX_P_LOG, p->line_array.result[i]); - p->interface_state = AST_STATE_RING; - } else { - /* we're at the first ring, so there is no CALLID yet thus clean the previous one - just in case we don't receive the caller identification in this new call */ - memset(p->callid_name, 0, sizeof(p->callid_name)); - memset(p->callid_number, 0, sizeof(p->callid_number)); - /* only send AT+CLCC? if the device previously reported its support */ - if (p->at_has_clcc != 0) { - /* we're at the first ring, try to get CALLID (with +CLCC) */ - DEBUGA_AT("|%s| got first RING, sending AT+CLCC?\n", CELLIAX_P_LOG, - p->line_array.result[i]); - res = celliax_serial_write_AT_noack(p, "AT+CLCC?"); - if (res) { - ERRORA("AT+CLCC? (call list) was not correctly sent to the phone\n", - CELLIAX_P_LOG); - } - } else { - DEBUGA_AT("|%s| got first RING, but not sending AT+CLCC? as this device " - "seems not to support\n", CELLIAX_P_LOG, p->line_array.result[i]); - } - } - p->phone_callflow = CALLFLOW_INCOMING_RING; - } - - if ((strncmp(p->line_array.result[i], "+CLCC", 5) == 0)) { - /* with clcc we wait for clip */ - memset(p->callid_name, 0, sizeof(p->callid_name)); - memset(p->callid_number, 0, sizeof(p->callid_number)); - int commacount = 0; - int a = 0; - int b = 0; - int c = 0; - - for (a = 0; a < strlen(p->line_array.result[i]); a++) { - - if (p->line_array.result[i][a] == ',') { - commacount++; - } - if (commacount == 5) { - if (p->line_array.result[i][a] != ',' && p->line_array.result[i][a] != '"') { - p->callid_number[b] = p->line_array.result[i][a]; - b++; - } - } - if (commacount == 7) { - if (p->line_array.result[i][a] != ',' && p->line_array.result[i][a] != '"') { - p->callid_name[c] = p->line_array.result[i][a]; - c++; - } - } - } - - p->phone_callflow = CALLFLOW_INCOMING_RING; - DEBUGA_AT("|%s| CLCC CALLID: name is %s, number is %s\n", CELLIAX_P_LOG, - p->line_array.result[i], - p->callid_name[0] ? p->callid_name : "not available", - p->callid_number[0] ? p->callid_number : "not available"); - } - - if ((strncmp(p->line_array.result[i], "+CLIP", 5) == 0)) { - /* with CLIP, we want to answer right away */ - memset(p->callid_name, 0, sizeof(p->callid_name)); - memset(p->callid_number, 0, sizeof(p->callid_number)); - - int commacount = 0; - int a = 0; - int b = 0; - int c = 0; - - for (a = 7; a < strlen(p->line_array.result[i]); a++) { - if (p->line_array.result[i][a] == ',') { - commacount++; - } - if (commacount == 0) { - if (p->line_array.result[i][a] != ',' && p->line_array.result[i][a] != '"') { - p->callid_number[b] = p->line_array.result[i][a]; - b++; - } - } - if (commacount == 4) { - if (p->line_array.result[i][a] != ',' && p->line_array.result[i][a] != '"') { - p->callid_name[c] = p->line_array.result[i][a]; - c++; - } - } - } - - if (p->interface_state != AST_STATE_RING) { - gettimeofday(&(p->call_incoming_time), NULL); - DEBUGA_AT("AST_STATE_RING call_incoming_time.tv_sec=%ld\n", - CELLIAX_P_LOG, p->call_incoming_time.tv_sec); - - } - - p->interface_state = AST_STATE_RING; - p->phone_callflow = CALLFLOW_INCOMING_RING; - DEBUGA_AT("|%s| CLIP INCOMING CALLID: name is %s, number is %s\n", CELLIAX_P_LOG, - p->line_array.result[i], - p->callid_name[0] != 1 ? p->callid_name : "not available", - p->callid_number[0] ? p->callid_number : "not available"); - } - - if ((strcmp(p->line_array.result[i], "BUSY") == 0)) { - p->phone_callflow = CALLFLOW_CALL_LINEBUSY; - if (option_debug > 1) - DEBUGA_AT("|%s| CALLFLOW_CALL_LINEBUSY\n", CELLIAX_P_LOG, - p->line_array.result[i]); - if (p->interface_state != AST_STATE_DOWN && p->owner) { - ast_setstate(p->owner, AST_STATE_BUSY); - celliax_queue_control(p->owner, AST_CONTROL_BUSY); - } else { - ERRORA("Why BUSY now?\n", CELLIAX_P_LOG); - } - } - if ((strcmp(p->line_array.result[i], "NO ANSWER") == 0)) { - p->phone_callflow = CALLFLOW_CALL_NOANSWER; - if (option_debug > 1) - DEBUGA_AT("|%s| CALLFLOW_CALL_NOANSWER\n", CELLIAX_P_LOG, - p->line_array.result[i]); - if (p->interface_state != AST_STATE_DOWN && p->owner) { - p->owner->hangupcause = AST_CAUSE_NO_ANSWER; - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - } else { - ERRORA("Why NO ANSWER now?\n", CELLIAX_P_LOG); - } - } - if ((strcmp(p->line_array.result[i], "NO CARRIER") == 0)) { - if (p->phone_callflow != CALLFLOW_CALL_HANGUP_REQUESTED) { - p->phone_callflow = CALLFLOW_CALL_NOCARRIER; - if (option_debug > 1) - DEBUGA_AT("|%s| CALLFLOW_CALL_NOCARRIER\n", CELLIAX_P_LOG, - p->line_array.result[i]); - p->control_to_send = 0; - usleep(20000); - if (p->interface_state != AST_STATE_DOWN && p->owner) { - p->owner->hangupcause = AST_CAUSE_FAILURE; - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - } else { - ERRORA("Why NO CARRIER now?\n", CELLIAX_P_LOG); - } - } - } - - if ((strncmp(p->line_array.result[i], "+CBC:", 5) == 0)) { - int power_supply, battery_strenght, err; - - power_supply = battery_strenght = 0; - - err = - sscanf(&p->line_array.result[i][6], "%d,%d", &power_supply, &battery_strenght); - if (err < 2) { - DEBUGA_AT("|%s| is not formatted as: |+CBC: xx,yy| now trying |+CBC:xx,yy|\n", - CELLIAX_P_LOG, p->line_array.result[i]); - - err = - sscanf(&p->line_array.result[i][5], "%d,%d", &power_supply, - &battery_strenght); - DEBUGA_AT("|%s| +CBC: Powered by %s, battery strenght=%d\n", CELLIAX_P_LOG, - p->line_array.result[i], power_supply ? "power supply" : "battery", - battery_strenght); - - } - - if (err < 2) { - DEBUGA_AT("|%s| is not formatted as: |+CBC:xx,yy| giving up\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - - else { - if (option_debug > 1) - DEBUGA_AT("|%s| +CBC: Powered by %s, battery strenght=%d\n", CELLIAX_P_LOG, - p->line_array.result[i], power_supply ? "power supply" : "battery", - battery_strenght); - if (!power_supply) { - if (battery_strenght < 10) { - ERRORA("|%s| BATTERY ALMOST EXHAUSTED\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } else if (battery_strenght < 20) { - WARNINGA("|%s| BATTERY LOW\n", CELLIAX_P_LOG, p->line_array.result[i]); - - } - - } - } - - } - - if ((strncmp(p->line_array.result[i], "+CSQ:", 5) == 0)) { - int signal_quality, ber, err; - - signal_quality = ber = 0; - - err = sscanf(&p->line_array.result[i][6], "%d,%d", &signal_quality, &ber); - if (option_debug > 1) - DEBUGA_AT("|%s| +CSQ: Signal Quality: %d, Error Rate=%d\n", CELLIAX_P_LOG, - p->line_array.result[i], signal_quality, ber); - if (err < 2) { - ERRORA("|%s| is not formatted as: |+CSQ: xx,yy|\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } else { - if (signal_quality < 11 || signal_quality == 99) { - WARNINGA - ("|%s| CELLPHONE GETS ALMOST NO SIGNAL, consider to move it or additional antenna\n", - CELLIAX_P_LOG, p->line_array.result[i]); - } else if (signal_quality < 15) { - WARNINGA("|%s| CELLPHONE GETS SIGNAL LOW\n", CELLIAX_P_LOG, - p->line_array.result[i]); - - } - - } - - } - if ((strncmp(p->line_array.result[i], "+CMGW:", 6) == 0)) { - int err; - - err = sscanf(&p->line_array.result[i][7], "%s", p->at_cmgw); - DEBUGA_AT("|%s| +CMGW: %s\n", CELLIAX_P_LOG, p->line_array.result[i], p->at_cmgw); - if (err < 1) { - ERRORA("|%s| is not formatted as: |+CMGW: xxxx|\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - - } - - /* at_call_* are unsolicited messages sent by the modem to signal us about call processing activity and events */ - if ((strcmp(p->line_array.result[i], p->at_call_idle) == 0)) { - p->phone_callflow = CALLFLOW_CALL_IDLE; - if (option_debug > 1) - DEBUGA_AT("|%s| CALLFLOW_CALL_IDLE\n", CELLIAX_P_LOG, p->line_array.result[i]); - if (p->interface_state != AST_STATE_DOWN && p->owner) { - DEBUGA_AT("just received a remote HANGUP\n", CELLIAX_P_LOG); - p->owner->hangupcause = AST_CAUSE_NORMAL; - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - DEBUGA_AT("just sent AST_CONTROL_HANGUP\n", CELLIAX_P_LOG); - } - } - - if ((strcmp(p->line_array.result[i], p->at_call_incoming) == 0)) { - - //char list_command[64]; - - if (option_debug > 1) - DEBUGA_AT("|%s| CALLFLOW_CALL_INCOMING\n", CELLIAX_P_LOG, - p->line_array.result[i]); - - if (p->phone_callflow != CALLFLOW_CALL_INCOMING - && p->phone_callflow != CALLFLOW_INCOMING_RING) { - //mark the time of CALLFLOW_CALL_INCOMING - gettimeofday(&(p->call_incoming_time), NULL); - p->phone_callflow = CALLFLOW_CALL_INCOMING; - DEBUGA_AT("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld\n", - CELLIAX_P_LOG, p->call_incoming_time.tv_sec); - - } - } - - if ((strcmp(p->line_array.result[i], p->at_call_active) == 0)) { - p->phone_callflow = CALLFLOW_CALL_ACTIVE; - if (option_debug > 1) - DEBUGA_AT("|%s| CALLFLOW_CALL_ACTIVE\n", CELLIAX_P_LOG, - p->line_array.result[i]); - - if (p->owner && p->interface_state == CALLFLOW_CALL_DIALING) { - DEBUGA_PBX("just received a remote ANSWER\n", CELLIAX_P_LOG); - if (p->owner->_state != AST_STATE_UP) { - celliax_queue_control(p->owner, AST_CONTROL_RINGING); - DEBUGA_PBX("just sent AST_CONTROL_RINGING\n", CELLIAX_P_LOG); - DEBUGA_PBX("going to send AST_CONTROL_ANSWER\n", CELLIAX_P_LOG); - celliax_queue_control(p->owner, AST_CONTROL_ANSWER); - DEBUGA_PBX("just sent AST_CONTROL_ANSWER\n", CELLIAX_P_LOG); - } - } else { - } - p->interface_state = AST_STATE_UP; - DEBUGA_PBX("just interface_state UP\n", CELLIAX_P_LOG); - } - - if ((strcmp(p->line_array.result[i], p->at_call_calling) == 0)) { - p->phone_callflow = CALLFLOW_CALL_DIALING; - if (option_debug > 1) - DEBUGA_AT("|%s| CALLFLOW_CALL_DIALING\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - if ((strcmp(p->line_array.result[i], p->at_call_failed) == 0)) { - p->phone_callflow = CALLFLOW_CALL_FAILED; - if (option_debug > 1) - DEBUGA_AT("|%s| CALLFLOW_CALL_FAILED\n", CELLIAX_P_LOG, - p->line_array.result[i]); - if (p->interface_state != AST_STATE_DOWN && p->owner) { - p->owner->hangupcause = AST_CAUSE_FAILURE; - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - } - } - - if ((strncmp(p->line_array.result[i], "+CSCA:", 6) == 0)) { //TODO SMS FIXME in config! - if (option_debug > 1) - DEBUGA_AT("|%s| +CSCA: Message Center Address!\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - - if ((strncmp(p->line_array.result[i], "+CMGF:", 6) == 0)) { //TODO SMS FIXME in config! - if (option_debug > 1) - DEBUGA_AT("|%s| +CMGF: Message Format!\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - - if ((strncmp(p->line_array.result[i], "+CMTI:", 6) == 0)) { //TODO SMS FIXME in config! - int err; - int pos; - - //FIXME all the following commands in config! - if (option_debug) - DEBUGA_AT("|%s| +CMTI: Incoming SMS!\n", CELLIAX_P_LOG, - p->line_array.result[i]); - - err = sscanf(&p->line_array.result[i][12], "%d", &pos); - if (err < 1) { - ERRORA("|%s| is not formatted as: |+CMTI: \"MT\",xx|\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } else { - DEBUGA_AT("|%s| +CMTI: Incoming SMS in position: %d!\n", CELLIAX_P_LOG, - p->line_array.result[i], pos); - p->unread_sms_msg_id = pos; - usleep(1000); - - if (p->unread_sms_msg_id) { - char at_command[256]; - - if (p->no_ucs2 == 0) { - res = celliax_serial_write_AT_ack(p, "AT+CSCS=\"UCS2\""); - if (res) { - ERRORA - ("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone, continuing\n", - CELLIAX_P_LOG); - //memset(p->sms_message, 0, sizeof(p->sms_message)); - } - } - - memset(at_command, 0, sizeof(at_command)); - sprintf(at_command, "AT+CMGR=%d", p->unread_sms_msg_id); - memset(p->sms_message, 0, sizeof(p->sms_message)); - - p->reading_sms_msg = 1; - res = celliax_serial_write_AT_ack(p, at_command); - p->reading_sms_msg = 0; - if (res) { - ERRORA - ("AT+CMGR (read SMS) do not got OK from the phone, message sent was:|||%s|||\n", - CELLIAX_P_LOG, at_command); - } - res = celliax_serial_write_AT_ack(p, "AT+CSCS=\"GSM\""); - if (res) { - ERRORA - ("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n", - CELLIAX_P_LOG); - } - memset(at_command, 0, sizeof(at_command)); - sprintf(at_command, "AT+CMGD=%d", p->unread_sms_msg_id); /* delete the message */ - p->unread_sms_msg_id = 0; - res = celliax_serial_write_AT_ack(p, at_command); - if (res) { - ERRORA - ("AT+CMGD (Delete SMS) do not got OK from the phone, message sent was:|||%s|||\n", - CELLIAX_P_LOG, at_command); - } - - if (strlen(p->sms_message)) { - manager_event(EVENT_FLAG_SYSTEM, "CELLIAXincomingsms", - "Interface: %s\r\nSMS_Message: %s\r\n", p->name, - p->sms_message); - if (strlen(p->sms_receiving_program)) { - int fd1[2]; - pid_t pid1; - char *arg1[] = { p->sms_receiving_program, (char *) NULL }; - int i; - - NOTICA("incoming SMS message:>>>%s<<<\n", CELLIAX_P_LOG, p->sms_message); - pipe(fd1); - pid1 = switch_fork(); - - if (pid1 == 0) { //child - int err; - - dup2(fd1[0], 0); // Connect stdin to pipe output - close(fd1[1]); // close input pipe side - close(p->controldevfd); - setsid(); //session id - err = execvp(arg1[0], arg1); //exec our program, with stdin connected to pipe output - if (err) { - ERRORA - ("'sms_receiving_program' is set in config file to '%s', and it gave us back this error: %d, (%s). SMS received was:---%s---\n", - CELLIAX_P_LOG, p->sms_receiving_program, err, strerror(errno), - p->sms_message); - } - close(fd1[0]); // close output pipe side - } -//starting here continue the parent - close(fd1[0]); // close output pipe side - // write the msg on the pipe input - for (i = 0; i < strlen(p->sms_message); i++) { - write(fd1[1], &p->sms_message[i], 1); - } - close(fd1[1]); // close pipe input, let our program know we've finished - } else { - ERRORA - ("got SMS incoming message, but 'sms_receiving_program' is not set in config file. SMS received was:---%s---\n", - CELLIAX_P_LOG, p->sms_message); - } - } -#if 1 //is this one needed? maybe it can interrupt an incoming call that is just to announce itself - if (p->phone_callflow == CALLFLOW_CALL_IDLE - && p->interface_state == AST_STATE_DOWN && p->owner == NULL) { - /* we're not in a call, neither calling */ - res = celliax_serial_write_AT_ack(p, "AT+CKPD=\"EEE\""); - if (res) { - ERRORA - ("AT+CKPD=\"EEE\" (cellphone screen back to user) do not got OK from the phone\n", - CELLIAX_P_LOG); - } - } -#endif - } //unread_msg_id - - } //CMTI well formatted - - } //CMTI - - if ((strncmp(p->line_array.result[i], "+MMGL:", 6) == 0)) { //TODO MOTOROLA SMS FIXME in config! - int err = 0; - //int unread_msg_id=0; - - if (option_debug) - DEBUGA_AT("|%s| +MMGL: Listing Motorola SMSs!\n", CELLIAX_P_LOG, - p->line_array.result[i]); - - err = sscanf(&p->line_array.result[i][7], "%d", &p->unread_sms_msg_id); - if (err < 1) { - ERRORA("|%s| is not formatted as: |+MMGL: xx|\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - } - if ((strncmp(p->line_array.result[i], "+CMGL:", 6) == 0)) { //TODO SMS FIXME in config! - if (option_debug) - DEBUGA_AT("|%s| +CMGL: Listing SMSs!\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - if ((strncmp(p->line_array.result[i], "+MMGR:", 6) == 0)) { //TODO MOTOROLA SMS FIXME in config! - if (option_debug) - DEBUGA_AT("|%s| +MMGR: Reading Motorola SMS!\n", CELLIAX_P_LOG, - p->line_array.result[i]); - if (p->reading_sms_msg) - p->reading_sms_msg++; - } - if ((strncmp(p->line_array.result[i], "+CMGR: \"STO U", 13) == 0)) { //TODO SMS FIXME in config! - if (option_debug) - DEBUGA_AT("|%s| +CMGR: Reading stored UNSENT SMS!\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } else if ((strncmp(p->line_array.result[i], "+CMGR: \"STO S", 13) == 0)) { //TODO SMS FIXME in config! - if (option_debug) - DEBUGA_AT("|%s| +CMGR: Reading stored SENT SMS!\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } else if ((strncmp(p->line_array.result[i], "+CMGR: \"REC R", 13) == 0)) { //TODO SMS FIXME in config! - if (option_debug) - DEBUGA_AT("|%s| +CMGR: Reading received READ SMS!\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } else if ((strncmp(p->line_array.result[i], "+CMGR: \"REC U", 13) == 0)) { //TODO SMS FIXME in config! - if (option_debug) - DEBUGA_AT("|%s| +CMGR: Reading received UNREAD SMS!\n", CELLIAX_P_LOG, - p->line_array.result[i]); - if (p->reading_sms_msg) - p->reading_sms_msg++; - } - - if ((strcmp(p->line_array.result[i], "+MCST: 17") == 0)) { /* motorola call processing unsolicited messages */ - p->phone_callflow = CALLFLOW_CALL_INFLUX; - if (option_debug > 1) - DEBUGA_AT("|%s| CALLFLOW_CALL_INFLUX\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - - if ((strcmp(p->line_array.result[i], "+MCST: 68") == 0)) { /* motorola call processing unsolicited messages */ - p->phone_callflow = CALLFLOW_CALL_NOSERVICE; - if (option_debug > 1) - DEBUGA_AT("|%s| CALLFLOW_CALL_NOSERVICE\n", CELLIAX_P_LOG, - p->line_array.result[i]); - if (p->interface_state != AST_STATE_DOWN && p->owner) { - p->owner->hangupcause = AST_CAUSE_FAILURE; - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - } - } - if ((strcmp(p->line_array.result[i], "+MCST: 70") == 0)) { /* motorola call processing unsolicited messages */ - p->phone_callflow = CALLFLOW_CALL_OUTGOINGRESTRICTED; - if (option_debug > 1) - DEBUGA_AT("|%s| CALLFLOW_CALL_OUTGOINGRESTRICTED\n", CELLIAX_P_LOG, - p->line_array.result[i]); - if (p->interface_state != AST_STATE_DOWN && p->owner) { - p->owner->hangupcause = AST_CAUSE_FAILURE; - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - } - } - if ((strcmp(p->line_array.result[i], "+MCST: 72") == 0)) { /* motorola call processing unsolicited messages */ - p->phone_callflow = CALLFLOW_CALL_SECURITYFAIL; - if (option_debug > 1) - DEBUGA_AT("|%s| CALLFLOW_CALL_SECURITYFAIL\n", CELLIAX_P_LOG, - p->line_array.result[i]); - if (p->interface_state != AST_STATE_DOWN && p->owner) { - p->owner->hangupcause = AST_CAUSE_FAILURE; - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - } - } - - if ((strncmp(p->line_array.result[i], "+CPBR", 5) == 0)) { /* phonebook stuff begins */ - - if (p->phonebook_querying) { /* probably phonebook struct begins */ - int err, first_entry, last_entry, number_lenght, text_lenght; - - if (option_debug) - DEBUGA_AT("phonebook struct: |%s|\n", CELLIAX_P_LOG, p->line_array.result[i]); - - err = - sscanf(&p->line_array.result[i][8], "%d-%d),%d,%d", &first_entry, &last_entry, - &number_lenght, &text_lenght); - if (err < 4) { - - err = - sscanf(&p->line_array.result[i][7], "%d-%d,%d,%d", &first_entry, - &last_entry, &number_lenght, &text_lenght); - } - - if (err < 4) { - ERRORA - ("phonebook struct: |%s| is nor formatted as: |+CPBR: (1-750),40,14| neither as: |+CPBR: 1-750,40,14|\n", - CELLIAX_P_LOG, p->line_array.result[i]); - } else { - - if (option_debug) - DEBUGA_AT - ("First entry: %d, last entry: %d, phone number max lenght: %d, text max lenght: %d\n", - CELLIAX_P_LOG, first_entry, last_entry, number_lenght, text_lenght); - p->phonebook_first_entry = first_entry; - p->phonebook_last_entry = last_entry; - p->phonebook_number_lenght = number_lenght; - p->phonebook_text_lenght = text_lenght; - } - - } else { /* probably phonebook entry begins */ - - if (p->phonebook_listing) { - int err, entry_id, entry_type; - - char entry_number[256]; - char entry_text[256]; - - if (option_debug) - DEBUGA_AT("phonebook entry: |%s|\n", CELLIAX_P_LOG, - p->line_array.result[i]); - - err = - sscanf(&p->line_array.result[i][7], "%d,\"%255[0-9+]\",%d,\"%255[^\"]\"", - &entry_id, entry_number, &entry_type, entry_text); - if (err < 4) { - ERRORA - ("err=%d, phonebook entry: |%s| is not formatted as: |+CPBR: 504,\"+39025458068\",145,\"ciao a tutti\"|\n", - CELLIAX_P_LOG, err, p->line_array.result[i]); - } else { - //TODO: sanitize entry_text - if (option_debug) - DEBUGA_AT("Number: %s, Text: %s, Type: %d\n", CELLIAX_P_LOG, entry_number, - entry_text, entry_type); - /* write entry in phonebook file */ - if (p->phonebook_writing_fp) { - celliax_dir_entry_extension++; - - fprintf(p->phonebook_writing_fp, - "%s => ,%sSKO,,,hidefromdir=%s|phonebook_direct_calling_ext=%d%s%.4d|phonebook_entry_fromcell=%s|phonebook_entry_owner=%s\n", - entry_number, entry_text, "no", - p->celliax_dir_entry_extension_prefix, "2", - celliax_dir_entry_extension, "yes", "not_specified"); - fprintf(p->phonebook_writing_fp, - "%s => ,%sDO,,,hidefromdir=%s|phonebook_direct_calling_ext=%d%s%.4d|phonebook_entry_fromcell=%s|phonebook_entry_owner=%s\n", - entry_number, entry_text, "no", - p->celliax_dir_entry_extension_prefix, "3", - celliax_dir_entry_extension, "yes", "not_specified"); - } - } - - } - - if (p->phonebook_listing_received_calls) { - int err, entry_id, entry_type; - - char entry_number[256] = ""; - char entry_text[256] = ""; - - if (option_debug) - DEBUGA_AT("phonebook entry: |%s|\n", CELLIAX_P_LOG, - p->line_array.result[i]); - - err = - sscanf(&p->line_array.result[i][7], "%d,\"%255[0-9+]\",%d,\"%255[^\"]\"", - &entry_id, entry_number, &entry_type, entry_text); - if (err < 1) { //we match only on the progressive id, maybe the remote party has not sent its number, and/or there is no corresponding text entry in the phone directory - ERRORA - ("err=%d, phonebook entry: |%s| is not formatted as: |+CPBR: 504,\"+39025458068\",145,\"ciao a tutti\"|\n", - CELLIAX_P_LOG, err, p->line_array.result[i]); - } else { - //TODO: sanitize entry_text - - if (option_debug) - DEBUGA_AT("Number: %s, Text: %s, Type: %d\n", CELLIAX_P_LOG, entry_number, - entry_text, entry_type); - memset(p->callid_name, 0, sizeof(p->callid_name)); - memset(p->callid_number, 0, sizeof(p->callid_number)); - strncpy(p->callid_name, entry_text, sizeof(p->callid_name)); - strncpy(p->callid_number, entry_number, sizeof(p->callid_number)); - if (option_debug) - DEBUGA_AT("incoming callid: Text: %s, Number: %s\n", CELLIAX_P_LOG, - p->callid_name, p->callid_number); - - DEBUGA_AT("|%s| CPBR INCOMING CALLID: name is %s, number is %s\n", - CELLIAX_P_LOG, p->line_array.result[i], - p->callid_name[0] != 1 ? p->callid_name : "not available", - p->callid_number[0] ? p->callid_number : "not available"); - - /* mark the time of RING */ - gettimeofday(&(p->ringtime), NULL); - p->interface_state = AST_STATE_RING; - p->phone_callflow = CALLFLOW_INCOMING_RING; - - } - - } - - else { - DEBUGA_AT("phonebook entry: |%s|\n", CELLIAX_P_LOG, p->line_array.result[i]); - - } - } - - } - - if ((strncmp(p->line_array.result[i], "*ECAV", 5) == 0) || (strncmp(p->line_array.result[i], "*ECAM", 5) == 0)) { /* sony-ericsson call processing unsolicited messages */ - int res, ccid, ccstatus, calltype, processid, exitcause, number, type; - res = ccid = ccstatus = calltype = processid = exitcause = number = type = 0; - res = - sscanf(&p->line_array.result[i][6], "%d,%d,%d,%d,%d,%d,%d", &ccid, &ccstatus, - &calltype, &processid, &exitcause, &number, &type); - /* only changes the phone_callflow if enought parameters were parsed */ - if (res >= 3) { - switch (ccstatus) { - case 0: - if (p->owner) { - ast_setstate(p->owner, AST_STATE_DOWN); - p->owner->hangupcause = AST_CAUSE_NORMAL; - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - } - p->phone_callflow = CALLFLOW_CALL_IDLE; - p->interface_state = AST_STATE_DOWN; - if (option_debug > 1) - DEBUGA_AT("|%s| Sony-Ericsson *ECAM/*ECAV: IDLE\n", CELLIAX_P_LOG, - p->line_array.result[i]); - break; - case 1: - if (option_debug > 1) - DEBUGA_AT("|%s| Sony-Ericsson *ECAM/*ECAV: CALLING\n", CELLIAX_P_LOG, - p->line_array.result[i]); - break; - case 2: - if (p->owner) { - ast_setstate(p->owner, AST_STATE_DIALING); - } - p->interface_state = CALLFLOW_CALL_DIALING; - if (option_debug > 1) - DEBUGA_AT("|%s| Sony-Ericsson *ECAM/*ECAV: CONNECTING\n", CELLIAX_P_LOG, - p->line_array.result[i]); - break; - case 3: - if (p->owner) { - ast_setstate(p->owner, AST_STATE_UP); - celliax_queue_control(p->owner, AST_CONTROL_ANSWER); - } - p->phone_callflow = CALLFLOW_CALL_ACTIVE; - p->interface_state = AST_STATE_UP; - if (option_debug > 1) - DEBUGA_AT("|%s| Sony-Ericsson *ECAM/*ECAV: ACTIVE\n", CELLIAX_P_LOG, - p->line_array.result[i]); - break; - case 4: - if (option_debug > 1) - DEBUGA_AT - ("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle HOLD event\n", - CELLIAX_P_LOG, p->line_array.result[i]); - break; - case 5: - if (option_debug > 1) - DEBUGA_AT - ("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle WAITING event\n", - CELLIAX_P_LOG, p->line_array.result[i]); - break; - case 6: - if (option_debug > 1) - DEBUGA_AT - ("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle ALERTING event\n", - CELLIAX_P_LOG, p->line_array.result[i]); - break; - case 7: - if (p->owner) { - ast_setstate(p->owner, AST_STATE_BUSY); - celliax_queue_control(p->owner, AST_CONTROL_BUSY); - } - p->phone_callflow = CALLFLOW_CALL_LINEBUSY; - p->interface_state = AST_STATE_BUSY; - if (option_debug > 1) - DEBUGA_AT("|%s| Sony-Ericsson *ECAM/*ECAV: BUSY\n", CELLIAX_P_LOG, - p->line_array.result[i]); - break; - } - } else { - if (option_debug > 1) - DEBUGA_AT("|%s| Sony-Ericsson *ECAM/*ECAV: could not parse parameters\n", - CELLIAX_P_LOG, p->line_array.result[i]); - } - - } - - /* at_indicator_* are unsolicited messages sent by the phone to signal us that some of its visual indicators on its screen has changed, based on CIND CMER ETSI docs */ - if ((strcmp(p->line_array.result[i], p->at_indicator_noservice_string) == 0)) { - if (option_debug > 1) - ERRORA("|%s| at_indicator_noservice_string\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - - if ((strcmp(p->line_array.result[i], p->at_indicator_nosignal_string) == 0)) { - if (option_debug > 1) - ERRORA("|%s| at_indicator_nosignal_string\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - - if ((strcmp(p->line_array.result[i], p->at_indicator_lowsignal_string) == 0)) { - if (option_debug > 1) - WARNINGA("|%s| at_indicator_lowsignal_string\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - - if ((strcmp(p->line_array.result[i], p->at_indicator_lowbattchg_string) == 0)) { - if (option_debug > 1) - WARNINGA("|%s| at_indicator_lowbattchg_string\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - - if ((strcmp(p->line_array.result[i], p->at_indicator_nobattchg_string) == 0)) { - if (option_debug > 1) - ERRORA("|%s| at_indicator_nobattchg_string\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - - if ((strcmp(p->line_array.result[i], p->at_indicator_callactive_string) == 0)) { - if (option_debug > 1) - DEBUGA_AT("|%s| at_indicator_callactive_string\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - - if ((strcmp(p->line_array.result[i], p->at_indicator_nocallactive_string) == 0)) { - if (option_debug > 1) - DEBUGA_AT("|%s| at_indicator_nocallactive_string\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - - if ((strcmp(p->line_array.result[i], p->at_indicator_nocallsetup_string) == 0)) { - if (option_debug > 1) - DEBUGA_AT("|%s| at_indicator_nocallsetup_string\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - - if ((strcmp(p->line_array.result[i], p->at_indicator_callsetupincoming_string) == - 0)) { - if (option_debug > 1) - DEBUGA_AT("|%s| at_indicator_callsetupincoming_string\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - - if ((strcmp(p->line_array.result[i], p->at_indicator_callsetupoutgoing_string) == - 0)) { - if (option_debug > 1) - DEBUGA_AT("|%s| at_indicator_callsetupoutgoing_string\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - - if ((strcmp(p->line_array.result[i], p->at_indicator_callsetupremoteringing_string) - == 0)) { - if (option_debug > 1) - DEBUGA_AT("|%s| at_indicator_callsetupremoteringing_string\n", CELLIAX_P_LOG, - p->line_array.result[i]); - } - - } - - /* let's look for OK, ERROR and EXPECTED_STRING in the complete lines read so far, without re-looking at the lines that has been yet looked at */ - for (i = la_read; i < la_counter; i++) { - if (expected_string) { - if ((strncmp(p->line_array.result[i], expected_string, strlen(expected_string)) - == 0)) { - if (option_debug > 1) - DEBUGA_AT("|%s| got what EXPECTED\n", CELLIAX_P_LOG, p->line_array.result[i]); - at_ack = AT_OK; - } - } else { - //if ((strcmp(p->line_array.result[i], "OK") == 0)) { - if ((strcmp(p->line_array.result[i], "OK") == 0) || (strcmp(p->line_array.result[i], "NO CARRIER") == 0) ) { - if (option_debug > 1) - DEBUGA_AT("got OK\n", CELLIAX_P_LOG); - at_ack = AT_OK; - } - } - if ((strcmp(p->line_array.result[i], "ERROR") == 0)) { - if (option_debug > 1) - DEBUGA_AT("got ERROR\n", CELLIAX_P_LOG); - at_ack = AT_ERROR; - } - - /* if we are reading an sms message from memory, put the line into the sms buffer if the line is not "OK" or "ERROR" */ - if (p->reading_sms_msg > 1 && at_ack == -1) { - int c; - char sms_body[16000]; - int err; - - if (strncmp(p->line_array.result[i], "+CMGR", 5) == 0) { /* we are reading the "header" of an SMS */ - char content[512]; - char content2[512]; - - memset(content, '\0', sizeof(content)); - - int inside_comma = 0; - int inside_quote = 0; - int d = 0; - - for (c = 0; c < strlen(p->line_array.result[i]); c++) { - if (p->line_array.result[i][c] == ',' - && p->line_array.result[i][c - 1] != '\\' && inside_quote == 0) { - if (inside_comma) { - inside_comma = 0; - //NOTICA("inside_comma=%d, inside_quote=%d, we're at=%s\n", CELLIAX_P_LOG, inside_comma, inside_quote, &p->line_array.result[i][c]); - } else { - inside_comma = 1; - //NOTICA("inside_comma=%d, inside_quote=%d, we're at=%s\n", CELLIAX_P_LOG, inside_comma, inside_quote, &p->line_array.result[i][c]); - } - } - if (p->line_array.result[i][c] == '"' - && p->line_array.result[i][c - 1] != '\\') { - if (inside_quote) { - inside_quote = 0; - //ERRORA("END_CONTENT inside_comma=%d, inside_quote=%d, we're at=%s\n", CELLIAX_P_LOG, inside_comma, inside_quote, &p->line_array.result[i][c]); - DEBUGA_AT("content=%s\n", CELLIAX_P_LOG, content); - - strncat(p->sms_message, "---", - ((sizeof(p->sms_message) - strlen(p->sms_message)) - 1)); - strncat(p->sms_message, content, - ((sizeof(p->sms_message) - strlen(p->sms_message)) - 1)); - strncat(p->sms_message, "|||", - ((sizeof(p->sms_message) - strlen(p->sms_message)) - 1)); - - memset(content2, '\0', sizeof(content2)); - err = ucs2_to_utf8(p, content, content2, sizeof(content2)); - - strncat(p->sms_message, "---", - ((sizeof(p->sms_message) - strlen(p->sms_message)) - 1)); - if (!err) - strncat(p->sms_message, content2, - ((sizeof(p->sms_message) - strlen(p->sms_message)) - 1)); - strncat(p->sms_message, "|||", - ((sizeof(p->sms_message) - strlen(p->sms_message)) - 1)); - memset(content, '\0', sizeof(content)); - d = 0; - } else { - inside_quote = 1; - //WARNINGA("START_CONTENT inside_comma=%d, inside_quote=%d, we're at=%s\n", CELLIAX_P_LOG, inside_comma, inside_quote, &p->line_array.result[i][c]); - } - } - if (inside_quote && p->line_array.result[i][c] != '"') { - - content[d] = p->line_array.result[i][c]; - d++; - - } - - } - } //it was the +CMGR answer from the cellphone - else { - strncat(p->sms_message, "---", - ((sizeof(p->sms_message) - strlen(p->sms_message)) - 1)); - strncat(p->sms_message, p->line_array.result[i], - ((sizeof(p->sms_message) - strlen(p->sms_message)) - 1)); - strncat(p->sms_message, "|||", - ((sizeof(p->sms_message) - strlen(p->sms_message)) - 1)); - - memset(sms_body, '\0', sizeof(sms_body)); - err = ucs2_to_utf8(p, p->line_array.result[i], sms_body, sizeof(sms_body)); - - strncat(p->sms_message, "---", - ((sizeof(p->sms_message) - strlen(p->sms_message)) - 1)); - if (!err) - strncat(p->sms_message, sms_body, - ((sizeof(p->sms_message) - strlen(p->sms_message)) - 1)); - strncat(p->sms_message, "|||", - ((sizeof(p->sms_message) - strlen(p->sms_message)) - 1)); - - DEBUGA_AT("sms_message=%s\n", CELLIAX_P_LOG, p->sms_message); - - } //it was the UCS2 from cellphone - - } //we were reading the SMS - - } - - la_read = la_counter; - - if (look_for_ack && at_ack > -1) - break; - - if (la_counter > AT_MESG_MAX_LINES) { - ERRORA("Too many lines in result (>%d). Stopping reader.\n", CELLIAX_P_LOG, - AT_MESG_MAX_LINES); - at_ack = AT_ERROR; - break; - } - } - - UNLOCKA(&p->controldev_lock); - POPPA_UNLOCKA(&p->controldev_lock); - if (select_err == -1) { - ERRORA("select returned -1 on %s, setting controldev_dead, error was: %s\n", - CELLIAX_P_LOG, p->controldevice_name, strerror(errno)); - p->controldev_dead = 1; - close(p->controldevfd); - if (p->owner) - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - return -1; - } - - if (p->phone_callflow == CALLFLOW_CALL_INCOMING && p->call_incoming_time.tv_sec) { //after three sec of CALLFLOW_CALL_INCOMING, we assume the phone is incapable of notifying RING (eg: motorola c350), so we try to answer - char list_command[64]; - struct timeval call_incoming_timeout; - gettimeofday(&call_incoming_timeout, NULL); - call_incoming_timeout.tv_sec -= 3; - DEBUGA_AT - ("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n", - CELLIAX_P_LOG, p->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec); - if (call_incoming_timeout.tv_sec > p->call_incoming_time.tv_sec) { - - p->call_incoming_time.tv_sec = 0; - p->call_incoming_time.tv_usec = 0; - DEBUGA_AT - ("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n", - CELLIAX_P_LOG, p->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec); - res = celliax_serial_write_AT_ack(p, "AT+CPBS=RC"); - if (res) { - ERRORA - ("AT+CPBS=RC (select memory of received calls) was not answered by the phone\n", - CELLIAX_P_LOG); - } - p->phonebook_querying = 1; - res = celliax_serial_write_AT_ack(p, "AT+CPBR=?"); - if (res) { - ERRORA - ("AT+CPBS=RC (select memory of received calls) was not answered by the phone\n", - CELLIAX_P_LOG); - } - p->phonebook_querying = 0; - sprintf(list_command, "AT+CPBR=%d,%d", p->phonebook_first_entry, - p->phonebook_last_entry); - p->phonebook_listing_received_calls = 1; - res = celliax_serial_write_AT_expect_longtime(p, list_command, "OK"); - if (res) { - WARNINGA("AT+CPBR=%d,%d failed, continue\n", CELLIAX_P_LOG, - p->phonebook_first_entry, p->phonebook_last_entry); - } - p->phonebook_listing_received_calls = 0; - } - } - - if (p->phone_callflow == CALLFLOW_INCOMING_RING) { - struct timeval call_incoming_timeout; - gettimeofday(&call_incoming_timeout, NULL); - call_incoming_timeout.tv_sec -= 10; - DEBUGA_AT - ("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n", - CELLIAX_P_LOG, p->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec); - if (call_incoming_timeout.tv_sec > p->ringtime.tv_sec) { - ERRORA("Ringing stopped and I have not answered. Why?\n", CELLIAX_P_LOG); - DEBUGA_AT - ("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n", - CELLIAX_P_LOG, p->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec); - if (p->owner) { - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - p->owner->hangupcause = AST_CAUSE_FAILURE; - } - } - } - p->line_array.elemcount = la_counter; - //NOTICA (" OUTSIDE this celliax_serial_device %s \n", CELLIAX_P_LOG, p->controldevice_name); - if (look_for_ack) - return at_ack; - else - return 0; -} - -int celliax_serial_write_AT(struct celliax_pvt *p, const char *data) -{ - int howmany; - int i; - int res; - int count; - - howmany = strlen(data); - - for (i = 0; i < howmany; i++) { - res = write(p->controldevfd, &data[i], 1); - - if (res != 1) { - DEBUGA_AT("Error sending (%.1s): %d (%s)\n", CELLIAX_P_LOG, &data[i], res, - strerror(errno)); - usleep(100000); - for (count = 0; count < 10; count++) { - res = write(p->controldevfd, &data[i], 1); - if (res == 1) { - DEBUGA_AT("Successfully RE-sent (%.1s): %d %d (%s)\n", CELLIAX_P_LOG, &data[i], - count, res, strerror(errno)); - break; - } else - DEBUGA_AT("Error RE-sending (%.1s): %d %d (%s)\n", CELLIAX_P_LOG, &data[i], - count, res, strerror(errno)); - usleep(100000); - - } - if (res != 1) { - ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", CELLIAX_P_LOG, &data[i], count, - res, strerror(errno)); - return -1; - } - } - if (option_debug > 1) - DEBUGA_AT("sent data... (%.1s)\n", CELLIAX_P_LOG, &data[i]); - usleep(1000); /* release the cpu */ - } - - res = write(p->controldevfd, "\r", 1); - - if (res != 1) { - DEBUGA_AT("Error sending (carriage return): %d (%s)\n", CELLIAX_P_LOG, res, - strerror(errno)); - usleep(100000); - for (count = 0; count < 10; count++) { - res = write(p->controldevfd, "\r", 1); - - if (res == 1) { - DEBUGA_AT("Successfully RE-sent carriage return: %d %d (%s)\n", CELLIAX_P_LOG, - count, res, strerror(errno)); - break; - } else - DEBUGA_AT("Error RE-sending (carriage return): %d %d (%s)\n", CELLIAX_P_LOG, - count, res, strerror(errno)); - usleep(100000); - - } - if (res != 1) { - ERRORA("Error RE-sending (carriage return): %d %d (%s)\n", CELLIAX_P_LOG, count, - res, strerror(errno)); - return -1; - } - } - if (option_debug > 1) - DEBUGA_AT("sent (carriage return)\n", CELLIAX_P_LOG); - usleep(1000); /* release the cpu */ - - return howmany; -} - -int celliax_serial_write_AT_nocr(struct celliax_pvt *p, const char *data) -{ - int howmany; - int i; - int res; - int count; - - howmany = strlen(data); - - for (i = 0; i < howmany; i++) { - res = write(p->controldevfd, &data[i], 1); - - if (res != 1) { - DEBUGA_AT("Error sending (%.1s): %d (%s)\n", CELLIAX_P_LOG, &data[i], res, - strerror(errno)); - usleep(100000); - for (count = 0; count < 10; count++) { - res = write(p->controldevfd, &data[i], 1); - if (res == 1) - break; - else - DEBUGA_AT("Error RE-sending (%.1s): %d %d (%s)\n", CELLIAX_P_LOG, &data[i], - count, res, strerror(errno)); - usleep(100000); - - } - if (res != 1) { - ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", CELLIAX_P_LOG, &data[i], count, - res, strerror(errno)); - return -1; - } - } - if (option_debug > 1) - DEBUGA_AT("sent data... (%.1s)\n", CELLIAX_P_LOG, &data[i]); - usleep(1000); /* release the cpu */ - } - - usleep(1000); /* release the cpu */ - - return howmany; -} - -int celliax_serial_write_AT_noack(struct celliax_pvt *p, const char *data) -{ - - if (option_debug > 1) - DEBUGA_AT("celliax_serial_write_AT_noack: %s\n", CELLIAX_P_LOG, data); - - PUSHA_UNLOCKA(&p->controldev_lock); - LOKKA(&p->controldev_lock); - if (celliax_serial_write_AT(p, data) != strlen(data)) { - - ERRORA("Error sending data... (%s)\n", CELLIAX_P_LOG, strerror(errno)); - UNLOCKA(&p->controldev_lock); - return -1; - } - UNLOCKA(&p->controldev_lock); - POPPA_UNLOCKA(&p->controldev_lock); - - return 0; -} - -int celliax_serial_write_AT_ack(struct celliax_pvt *p, const char *data) -{ - int at_result = AT_ERROR; - - PUSHA_UNLOCKA(&p->controldev_lock); - LOKKA(&p->controldev_lock); - if (option_debug > 1) - DEBUGA_AT("sending: %s\n", CELLIAX_P_LOG, data); - if (celliax_serial_write_AT(p, data) != strlen(data)) { - ERRORA("Error sending data... (%s) \n", CELLIAX_P_LOG, strerror(errno)); - UNLOCKA(&p->controldev_lock); - return -1; - } - - at_result = celliax_serial_read_AT(p, 1, 500000, 2, NULL, 1); // 2.5 sec timeout - UNLOCKA(&p->controldev_lock); - POPPA_UNLOCKA(&p->controldev_lock); - - return at_result; - -} - -int celliax_serial_write_AT_ack_nocr_longtime(struct celliax_pvt *p, const char *data) -{ - int at_result = AT_ERROR; - - PUSHA_UNLOCKA(&p->controldev_lock); - LOKKA(&p->controldev_lock); - if (option_debug > 1) - DEBUGA_AT("sending: %s\n", CELLIAX_P_LOG, data); - if (celliax_serial_write_AT_nocr(p, data) != strlen(data)) { - ERRORA("Error sending data... (%s) \n", CELLIAX_P_LOG, strerror(errno)); - UNLOCKA(&p->controldev_lock); - return -1; - } - - at_result = celliax_serial_read_AT(p, 1, 500000, 20, NULL, 1); // 20.5 sec timeout - UNLOCKA(&p->controldev_lock); - POPPA_UNLOCKA(&p->controldev_lock); - - return at_result; - -} - -int celliax_serial_write_AT_expect1(struct celliax_pvt *p, const char *data, - const char *expected_string, int expect_crlf, - int seconds) -{ - int at_result = AT_ERROR; - - PUSHA_UNLOCKA(&p->controldev_lock); - LOKKA(&p->controldev_lock); - if (option_debug > 1) - DEBUGA_AT("sending: %s, expecting: %s\n", CELLIAX_P_LOG, data, expected_string); - if (celliax_serial_write_AT(p, data) != strlen(data)) { - ERRORA("Error sending data... (%s) \n", CELLIAX_P_LOG, strerror(errno)); - UNLOCKA(&p->controldev_lock); - return -1; - } - - at_result = celliax_serial_read_AT(p, 1, 500000, seconds, expected_string, expect_crlf); // 20.5 sec timeout, used for querying the SIM and sending SMSs - UNLOCKA(&p->controldev_lock); - POPPA_UNLOCKA(&p->controldev_lock); - - return at_result; - -} - -int celliax_serial_AT_expect(struct celliax_pvt *p, const char *expected_string, - int expect_crlf, int seconds) -{ - int at_result = AT_ERROR; - - PUSHA_UNLOCKA(&p->controldev_lock); - LOKKA(&p->controldev_lock); - if (option_debug > 1) - DEBUGA_AT("expecting: %s\n", CELLIAX_P_LOG, expected_string); - - at_result = celliax_serial_read_AT(p, 1, 500000, seconds, expected_string, expect_crlf); // 20.5 sec timeout, used for querying the SIM and sending SMSs - UNLOCKA(&p->controldev_lock); - POPPA_UNLOCKA(&p->controldev_lock); - - return at_result; - -} - -int celliax_serial_answer_AT(struct celliax_pvt *p) -{ - int res; - - res = celliax_serial_write_AT_expect(p, p->at_answer, p->at_answer_expect); - if (res) { - DEBUGA_AT - ("at_answer command failed, command used: %s, expecting: %s, trying with AT+CKPD=\"S\"\n", - CELLIAX_P_LOG, p->at_answer, p->at_answer_expect); - - res = celliax_serial_write_AT_ack(p, "AT+CKPD=\"S\""); - if (res) { - ERRORA("at_answer command failed, command used: 'AT+CKPD=\"S\"', giving up\n", - CELLIAX_P_LOG); - return -1; - } - } - //p->interface_state = AST_STATE_UP; - //p->phone_callflow = CALLFLOW_CALL_ACTIVE; - DEBUGA_AT("AT: call answered\n", CELLIAX_P_LOG); - return 0; -} - -int celliax_serial_hangup_AT(struct celliax_pvt *p) -{ - int res; - - if (p->interface_state != AST_STATE_DOWN) { - res = celliax_serial_write_AT_expect(p, p->at_hangup, p->at_hangup_expect); - if (res) { - DEBUGA_AT - ("at_hangup command failed, command used: %s, trying to use AT+CKPD=\"EEE\"\n", - CELLIAX_P_LOG, p->at_hangup); - res = celliax_serial_write_AT_ack(p, "AT+CKPD=\"EEE\""); - if (res) { - ERRORA("at_hangup command failed, command used: 'AT+CKPD=\"EEE\"'\n", - CELLIAX_P_LOG); - return -1; - } - } - } - p->interface_state = AST_STATE_DOWN; - p->phone_callflow = CALLFLOW_CALL_IDLE; - return 0; -} - -int celliax_serial_config_AT(struct celliax_pvt *p) -{ - int res; - -/* initial_pause? */ - if (p->at_initial_pause) { - DEBUGA_AT("sleeping for %d usec\n", CELLIAX_P_LOG, p->at_initial_pause); - usleep(p->at_initial_pause); - } - -/* go until first empty preinit string, or last preinit string */ - while (1) { - - if (strlen(p->at_preinit_1)) { - res = celliax_serial_write_AT_expect(p, p->at_preinit_1, p->at_preinit_1_expect); - if (res) { - DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, - p->at_preinit_1, p->at_preinit_1_expect); - } - } else { - break; - } - - if (strlen(p->at_preinit_2)) { - res = celliax_serial_write_AT_expect(p, p->at_preinit_2, p->at_preinit_2_expect); - if (res) { - DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, - p->at_preinit_2, p->at_preinit_2_expect); - } - } else { - break; - } - - if (strlen(p->at_preinit_3)) { - res = celliax_serial_write_AT_expect(p, p->at_preinit_3, p->at_preinit_3_expect); - if (res) { - DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, - p->at_preinit_3, p->at_preinit_3_expect); - } - } else { - break; - } - - if (strlen(p->at_preinit_4)) { - res = celliax_serial_write_AT_expect(p, p->at_preinit_4, p->at_preinit_4_expect); - if (res) { - DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, - p->at_preinit_4, p->at_preinit_4_expect); - } - } else { - break; - } - - if (strlen(p->at_preinit_5)) { - res = celliax_serial_write_AT_expect(p, p->at_preinit_5, p->at_preinit_5_expect); - if (res) { - DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, - p->at_preinit_5, p->at_preinit_5_expect); - } - } else { - break; - } - - break; - } - -/* after_preinit_pause? */ - if (p->at_after_preinit_pause) { - DEBUGA_AT("sleeping for %d usec\n", CELLIAX_P_LOG, p->at_after_preinit_pause); - usleep(p->at_after_preinit_pause); - } - - /* phone, brother, art you alive? */ - res = celliax_serial_write_AT_ack(p, "AT"); - if (res) { - ERRORA("no response to AT\n", CELLIAX_P_LOG); - return -1; - } - /* for motorola, bring it back to "normal" mode if it happens to be in another mode */ - res = celliax_serial_write_AT_ack(p, "AT+mode=0"); - if (res) { - DEBUGA_AT("AT+mode=0 does not get OK from the phone. If it is NOT Motorola," - " no problem.\n", CELLIAX_P_LOG); - } - usleep(50000); - /* for motorola end */ - - /* reset AT configuration to phone default */ - res = celliax_serial_write_AT_ack(p, "ATZ"); - if (res) { - DEBUGA_AT("ATZ failed\n", CELLIAX_P_LOG); - } - - /* disable AT command echo */ - res = celliax_serial_write_AT_ack(p, "ATE0"); - if (res) { - DEBUGA_AT("ATE0 failed\n", CELLIAX_P_LOG); - } - - /* disable extended error reporting */ - res = celliax_serial_write_AT_ack(p, "AT+CMEE=0"); - if (res) { - DEBUGA_AT("AT+CMEE failed\n", CELLIAX_P_LOG); - } - - /* various phone manufacturer identifier */ - char at_command[5]; - int i; - for (i = 0; i < 10; i++) { - memset(at_command, 0, sizeof(at_command)); - sprintf(at_command, "ATI%d", i); - res = celliax_serial_write_AT_ack(p, at_command); - if (res) { - DEBUGA_AT("ATI%d command failed, continue\n", CELLIAX_P_LOG, i); - } - } - - /* phone manufacturer */ - res = celliax_serial_write_AT_ack(p, "AT+CGMI"); - if (res) { - DEBUGA_AT("AT+CGMI failed\n", CELLIAX_P_LOG); - } - - /* phone model */ - res = celliax_serial_write_AT_ack(p, "AT+CGMM"); - if (res) { - DEBUGA_AT("AT+CGMM failed\n", CELLIAX_P_LOG); - } - - res = celliax_serial_write_AT_ack(p, "AT+CGSN"); - if (res) { - DEBUGA_AT("AT+CGSN failed\n", CELLIAX_P_LOG); - } - -/* this take a lot of time to complete on devices with slow serial link (eg.: 9600bps) */ -#if 0 - /* ask for the list of supported AT commands, useful to implement new models and debugging */ - res = celliax_serial_write_AT_ack(p, "AT+CLAC"); - if (res) { - DEBUGA_AT("AT+CLAC failed, continue\n", CELLIAX_P_LOG); - } -#endif - /* signal incoming SMS with a +CMTI unsolicited msg */ - res = celliax_serial_write_AT_ack(p, "AT+CNMI=3,1,0,0,0"); - if (res) { - DEBUGA_AT("AT+CNMI=3,1,0,0,0 failed, continue\n", CELLIAX_P_LOG); - p->sms_cnmi_not_supported = 1; - p->celliax_serial_sync_period = 30; - } - /* what is the Message Center address (number) to which the SMS has to be sent? */ - res = celliax_serial_write_AT_ack(p, "AT+CSCA?"); - if (res) { - DEBUGA_AT("AT+CSCA? failed, continue\n", CELLIAX_P_LOG); - } - /* what is the Message Format of SMSs? */ - res = celliax_serial_write_AT_ack(p, "AT+CMGF?"); - if (res) { - DEBUGA_AT("AT+CMGF? failed, continue\n", CELLIAX_P_LOG); - } - res = celliax_serial_write_AT_ack(p, "AT+CMGF=1"); //TODO: support phones that only accept pdu mode - if (res) { - ERRORA("Error setting SMS sending mode to TEXT on the cellphone\n", CELLIAX_P_LOG); - return RESULT_FAILURE; - } - /* what is the Charset of SMSs? */ - res = celliax_serial_write_AT_ack(p, "AT+CSCS?"); - if (res) { - DEBUGA_AT("AT+CSCS? failed, continue\n", CELLIAX_P_LOG); - } - - p->no_ucs2 = 0; - res = celliax_serial_write_AT_ack(p, "AT+CSCS=\"UCS2\""); - if (res) { - WARNINGA - ("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone, let's try with 'GSM'\n", - CELLIAX_P_LOG); - p->no_ucs2 = 1; - } - - if (p->no_ucs2) { - res = celliax_serial_write_AT_ack(p, "AT+CSCS=\"GSM\""); - if (res) { - WARNINGA("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n", - CELLIAX_P_LOG); - } - //res = celliax_serial_write_AT_ack(p, "AT+CSMP=17,167,0,16"); //"flash", class 0 sms 7 bit - res = celliax_serial_write_AT_ack(p, "AT+CSMP=17,167,0,0"); //normal, 7 bit message - if (res) { - WARNINGA("AT+CSMP do not got OK from the phone, continuing\n", CELLIAX_P_LOG); - } - } else { - //res = celliax_serial_write_AT_ack(p, "AT+CSMP=17,167,0,20"); //"flash", class 0 sms 16 bit unicode - res = celliax_serial_write_AT_ack(p, "AT+CSMP=17,167,0,8"); //unicode, 16 bit message - if (res) { - WARNINGA("AT+CSMP do not got OK from the phone, continuing\n", CELLIAX_P_LOG); - } - } - - /* is the unsolicited reporting of mobile equipment event supported? */ - res = celliax_serial_write_AT_ack(p, "AT+CMER=?"); - if (res) { - DEBUGA_AT("AT+CMER=? failed, continue\n", CELLIAX_P_LOG); - } - /* request unsolicited reporting of mobile equipment indicators' events, to be screened by categories reported by +CIND=? */ - res = celliax_serial_write_AT_ack(p, "AT+CMER=3,0,0,1"); - if (res) { - DEBUGA_AT("AT+CMER=? failed, continue\n", CELLIAX_P_LOG); - } - - /* is the solicited reporting of mobile equipment indications supported? */ - - res = celliax_serial_write_AT_ack(p, "AT+CIND=?"); - if (res) { - DEBUGA_AT("AT+CIND=? failed, continue\n", CELLIAX_P_LOG); - } - - /* is the unsolicited reporting of call monitoring supported? sony-ericsson specific */ - res = celliax_serial_write_AT_ack(p, "AT*ECAM=?"); - if (res) { - DEBUGA_AT("AT*ECAM=? failed, continue\n", CELLIAX_P_LOG); - } - /* enable the unsolicited reporting of call monitoring. sony-ericsson specific */ - res = celliax_serial_write_AT_ack(p, "AT*ECAM=1"); - if (res) { - DEBUGA_AT("AT*ECAM=1 failed, continue\n", CELLIAX_P_LOG); - p->at_has_ecam = 0; - } else { - p->at_has_ecam = 1; - } - - /* disable unsolicited signaling of call list */ - res = celliax_serial_write_AT_ack(p, "AT+CLCC=0"); - if (res) { - DEBUGA_AT("AT+CLCC=0 failed, continue\n", CELLIAX_P_LOG); - p->at_has_clcc = 0; - } else { - p->at_has_clcc = 1; - } - - /* give unsolicited caller id when incoming call */ - res = celliax_serial_write_AT_ack(p, "AT+CLIP=1"); - if (res) { - DEBUGA_AT("AT+CLIP failed, continue\n", CELLIAX_P_LOG); - } - /* for motorola */ - res = celliax_serial_write_AT_ack(p, "AT+MCST=1"); /* motorola call control codes - (to know when call is disconnected (they - don't give you "no carrier") */ - if (res) { - DEBUGA_AT("AT+MCST=1 does not get OK from the phone. If it is NOT Motorola," - " no problem.\n", CELLIAX_P_LOG); - } - /* for motorola end */ - -/* go until first empty postinit string, or last postinit string */ - while (1) { - - if (strlen(p->at_postinit_1)) { - res = celliax_serial_write_AT_expect(p, p->at_postinit_1, p->at_postinit_1_expect); - if (res) { - DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, - p->at_postinit_1, p->at_postinit_1_expect); - } - } else { - break; - } - - if (strlen(p->at_postinit_2)) { - res = celliax_serial_write_AT_expect(p, p->at_postinit_2, p->at_postinit_2_expect); - if (res) { - DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, - p->at_postinit_2, p->at_postinit_2_expect); - } - } else { - break; - } - - if (strlen(p->at_postinit_3)) { - res = celliax_serial_write_AT_expect(p, p->at_postinit_3, p->at_postinit_3_expect); - if (res) { - DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, - p->at_postinit_3, p->at_postinit_3_expect); - } - } else { - break; - } - - if (strlen(p->at_postinit_4)) { - res = celliax_serial_write_AT_expect(p, p->at_postinit_4, p->at_postinit_4_expect); - if (res) { - DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, - p->at_postinit_4, p->at_postinit_4_expect); - } - } else { - break; - } - - if (strlen(p->at_postinit_5)) { - res = celliax_serial_write_AT_expect(p, p->at_postinit_5, p->at_postinit_5_expect); - if (res) { - DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, - p->at_postinit_5, p->at_postinit_5_expect); - } - } else { - break; - } - - break; - } - - return 0; -} - -int celliax_serial_call_AT(struct celliax_pvt *p, char *dstr) -{ - int res; - char at_command[256]; - - if (option_debug) - DEBUGA_PBX("Dialing %s\n", CELLIAX_P_LOG, dstr); - memset(at_command, 0, sizeof(at_command)); - p->phone_callflow = CALLFLOW_CALL_DIALING; - p->interface_state = AST_STATE_DIALING; - ast_uri_decode(dstr); - size_t fixdstr = strspn(dstr, AST_DIGIT_ANYDIG); - if (fixdstr == 0) { - ERRORA("dial command failed because of invalid dial number. dial string was: %s\n", - CELLIAX_P_LOG, dstr); - return -1; - } - dstr[fixdstr] = '\0'; - sprintf(at_command, "%s%s%s", p->at_dial_pre_number, dstr, p->at_dial_post_number); - res = celliax_serial_write_AT_expect(p, at_command, p->at_dial_expect); - if (res) { - ERRORA("dial command failed, dial string was: %s\n", CELLIAX_P_LOG, at_command); - return -1; - } - // jet - early audio - if (p->at_early_audio) { - ast_queue_control(p->owner, AST_CONTROL_ANSWER); - } - - return 0; -} - -int celliax_console_at(int fd, int argc, char *argv[]) -{ - struct celliax_pvt *p = celliax_console_find_desc(celliax_console_active); - char at_cmd[1024]; - int i, a, c; - - if (argc == 1) - return RESULT_SHOWUSAGE; - if (!p) { - ast_cli(fd, - "No \"current\" console for celliax_at, please enter 'help celliax_console'\n"); - return RESULT_SUCCESS; - } - if (p->controldevprotocol != PROTOCOL_AT) { - ast_cli(fd, - "The \"current\" console is not connected to an 'AT modem' (cellphone)\n"); - return RESULT_SUCCESS; - } - - memset(at_cmd, 0, sizeof(at_cmd)); - c = 0; - for (i = 1; i < argc; i++) { - for (a = 0; a < strlen(argv[i]); a++) { - at_cmd[c] = argv[i][a]; - c++; - if (c == 1022) - break; - } - if (i != argc - 1) { - at_cmd[c] = ' '; - c++; - } - if (c == 1023) - break; - } - celliax_serial_write_AT_noack(p, at_cmd); - return RESULT_SUCCESS; -} - -#ifdef ASTERISK_VERSION_1_2 -int celliax_manager_sendsms(struct mansession *s, struct message *m) -#endif //ASTERISK_VERSION_1_2 -#ifdef ASTERISK_VERSION_1_4 -int celliax_manager_sendsms(struct mansession *s, const struct message *m) -#endif //ASTERISK_VERSION_1_4 -{ - int ret; - char command[512]; - const char *interfacename = astman_get_header(m, "Interface"); - const char *destinationnumber = astman_get_header(m, "Number"); - const char *text = astman_get_header(m, "Text"); - const char *action_id = astman_get_header(m, "ActionID"); - - if (ast_strlen_zero(interfacename)) { - astman_send_error(s, m, "Interface: missing.\n"); - return 0; - } - if (ast_strlen_zero(destinationnumber)) { - astman_send_error(s, m, "Number: missing.\n"); - return 0; - } - if (ast_strlen_zero(text)) { - astman_send_error(s, m, "Text: missing.\n"); - return 0; - } - if (ast_strlen_zero(action_id)) { - astman_send_error(s, m, "ActionID: missing.\n"); - return 0; - } - - memset(command, 0, sizeof(command)); - - sprintf(command, "%s/%s|%s|", interfacename, destinationnumber, text); - - ret = celliax_sendsms(NULL, (void *) &command); - -#ifndef ASTERISK_VERSION_1_4 - if (!ret) { - ast_cli(s->fd, "Response: Success\r\n"); - if (!ast_strlen_zero(action_id)) - ast_cli(s->fd, "ActionID: %s\r\n", action_id); - ast_cli(s->fd, "\r\n"); - return RESULT_SUCCESS; - } else { - ast_cli(s->fd, "Response: Error\r\n"); - if (!ast_strlen_zero(action_id)) - ast_cli(s->fd, "ActionID: %s\r\n", action_id); - ast_cli(s->fd, "Message: celliax_manager_sendsms failed\r\n"); - ast_cli(s->fd, "\r\n"); - return 0; - } -#else /* ASTERISK_VERSION_1_4 */ - if (!ret) { - astman_append(s, "Response: Success\r\n"); - if (!ast_strlen_zero(action_id)) - astman_append(s, "ActionID: %s\r\n", action_id); - astman_append(s, "\r\n"); - return RESULT_SUCCESS; - } else { - astman_append(s, "Response: Error\r\n"); - if (!ast_strlen_zero(action_id)) - astman_append(s, "ActionID: %s\r\n", action_id); - astman_append(s, "Message: celliax_manager_sendsms failed\r\n"); - astman_append(s, "\r\n"); - return 0; - } -#endif /* ASTERISK_VERSION_1_4 */ - - return RESULT_SUCCESS; //never reached -} - -int ucs2_to_utf8(struct celliax_pvt *p, char *ucs2_in, char *utf8_out, - size_t outbytesleft) -{ - char converted[16000]; - iconv_t iconv_format; - int iconv_res; - char *outbuf; - char *inbuf; - size_t inbytesleft; - int c; - char stringa[5]; - double hexnum; - int i = 0; - - memset(converted, '\0', sizeof(converted)); - - DEBUGA_AT("ucs2_in=%s\n", CELLIAX_P_LOG, ucs2_in); - /* cicopet */ - for (c = 0; c < strlen(ucs2_in); c++) { - sprintf(stringa, "0x%c%c", ucs2_in[c], ucs2_in[c + 1]); - c++; - hexnum = strtod(stringa, NULL); - converted[i] = hexnum; - i++; - } - - outbuf = utf8_out; - inbuf = converted; - - iconv_format = iconv_open("UTF8", "UCS-2BE"); - if (iconv_format == (iconv_t) - 1) { - ERRORA("error: %s\n", CELLIAX_P_LOG, strerror(errno)); - return -1; - } - - inbytesleft = i; - iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft); - if (iconv_res == (size_t) - 1) { - DEBUGA_AT("ciao in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n", - CELLIAX_P_LOG, inbuf, inbytesleft, outbuf, outbytesleft, converted, - utf8_out); - DEBUGA_AT("error: %s %d\n", CELLIAX_P_LOG, strerror(errno), errno); - return -1; - } - DEBUGA_AT - ("iconv_res=%d, in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n", - CELLIAX_P_LOG, iconv_res, inbuf, inbytesleft, outbuf, outbytesleft, converted, - utf8_out); - iconv_close(iconv_format); - - return 0; -} - -int utf_to_ucs2(struct celliax_pvt *p, char *utf_in, size_t inbytesleft, char *ucs2_out, - size_t outbytesleft) -{ - /* cicopet */ - iconv_t iconv_format; - int iconv_res; - char *outbuf; - char *inbuf; - char converted[16000]; - int i; - char stringa[16]; - char stringa2[16]; - - memset(converted, '\0', sizeof(converted)); - - outbuf = converted; - inbuf = utf_in; - - iconv_format = iconv_open("UCS-2BE", "UTF8"); - if (iconv_format == (iconv_t) - 1) { - ERRORA("error: %s\n", CELLIAX_P_LOG, strerror(errno)); - return -1; - } - outbytesleft = 16000; - - DEBUGA_AT("in=%s, inleft=%d, out=%s, outleft=%d, utf_in=%s, converted=%s\n", - CELLIAX_P_LOG, inbuf, inbytesleft, outbuf, outbytesleft, utf_in, converted); - iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft); - if (iconv_res == (size_t) - 1) { - ERRORA("error: %s %d\n", CELLIAX_P_LOG, strerror(errno), errno); - return -1; - } - DEBUGA_AT - ("iconv_res=%d, in=%s, inleft=%d, out=%s, outleft=%d, utf_in=%s, converted=%s\n", - CELLIAX_P_LOG, iconv_res, inbuf, inbytesleft, outbuf, outbytesleft, utf_in, - converted); - iconv_close(iconv_format); - - for (i = 0; i < 16000 - outbytesleft; i++) { - memset(stringa, '\0', sizeof(stringa)); - memset(stringa2, '\0', sizeof(stringa2)); - sprintf(stringa, "%02X", converted[i]); - DEBUGA_AT("character is |%02X|\n", CELLIAX_P_LOG, converted[i]); - stringa2[0] = stringa[strlen(stringa) - 2]; - stringa2[1] = stringa[strlen(stringa) - 1]; - strncat(ucs2_out, stringa2, ((outbytesleft - strlen(ucs2_out)) - 1)); //add the received line to the buffer - DEBUGA_AT("stringa=%s, stringa2=%s, ucs2_out=%s\n", CELLIAX_P_LOG, stringa, stringa2, - ucs2_out); - } - return 0; -} - -int celliax_sendsms(struct ast_channel *c, void *data) -{ - char *idest = data; - char rdest[256]; - struct celliax_pvt *p = NULL; - char *device; - char *dest; - char *text; - char *stringp = NULL; - int found = 0; - int failed = 0; - - strncpy(rdest, idest, sizeof(rdest) - 1); - ast_log(LOG_DEBUG, "CelliaxSendsms: %s\n", rdest); - ast_log(LOG_DEBUG, "START\n"); - /* we can use celliax_request to get the channel, but celliax_request would look for onowned channels, and probably we can send SMSs while a call is ongoing - * - */ - - stringp = rdest; - device = strsep(&stringp, "/"); - dest = strsep(&stringp, "|"); - text = strsep(&stringp, "|"); - - if (!device) { - ast_log(LOG_ERROR, - "CelliaxSendsms app do not recognize '%s'. Requires a destination with slashes (interfacename/destinationnumber, TEXT)\n", - idest); - return -1; - } - - if (!dest) { - ast_log(LOG_ERROR, - "CelliaxSendsms app do not recognize '%s'. Requires a destination with slashes (interfacename/destinationnumber, TEXT)\n", - idest); - return -1; - } - - if (!text) { - ast_log(LOG_ERROR, - "CelliaxSendsms app do not recognize '%s'. Requires a destination with slashes (interfacename/destinationnumber, TEXT)\n", - idest); - return -1; - } - - ast_log(LOG_DEBUG, "interfacename:%s, destinationnumber:%s, text:%s\n", device, dest, - text); - - /* lock the interfaces' list */ - LOKKA(&celliax_iflock); - /* make a pointer to the first interface in the interfaces list */ - p = celliax_iflist; - /* Search for the requested interface and verify if is unowned */ - //TODO implement groups a la chan_zap - while (p) { - size_t length = strlen(p->name); - /* is this the requested interface? */ - if (strncmp(device, p->name, length) == 0) { - /* this is the requested interface! */ - if (option_debug) - DEBUGA_AT("FOUND! interfacename:%s, destinationnumber:%s, text:%s, p->name=%s\n", - CELLIAX_P_LOG, device, dest, text, p->name); - found = 1; - break; - - } - /* not yet found, next please */ - p = p->next; - } - /* unlock the interfaces' list */ - UNLOCKA(&celliax_iflock); - - if (!found) { - ast_log(LOG_ERROR, "Interface '%s' requested by CelliaxSendsms NOT FOUND\n", device); - return RESULT_FAILURE; - } - - if (p->controldevprotocol != PROTOCOL_AT) { - ERRORA("CelliaxSendsms supports only AT command cellphones at the moment :-( !\n", - CELLIAX_P_LOG); - return RESULT_FAILURE; - } - - if (p->controldevprotocol == PROTOCOL_AT) { - int err = 0; - char smscommand[16000]; - memset(smscommand, '\0', sizeof(smscommand)); - - PUSHA_UNLOCKA(&p->controldev_lock); - LOKKA(&p->controldev_lock); - - if (p->no_ucs2) { - sprintf(smscommand, "AT+CMGS=\"%s\"", dest); //TODO: support phones that only accept pdu mode - } else { - char dest2[1048]; - - err = celliax_serial_write_AT_ack(p, "AT+CSCS=\"UCS2\""); - if (err) { - ERRORA - ("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone\n", - CELLIAX_P_LOG); - } - - memset(dest2, '\0', sizeof(dest2)); - utf_to_ucs2(p, dest, strlen(dest), dest2, sizeof(dest2)); - sprintf(smscommand, "AT+CMGS=\"%s\"", dest2); //TODO: support phones that only accept pdu mode - } - //TODO: support phones that only accept pdu mode - //TODO would be better to lock controldev here - err = celliax_serial_write_AT_noack(p, smscommand); - if (err) { - ERRORA("Error sending SMS\n", CELLIAX_P_LOG); - failed = 1; - goto uscita; - } - err = celliax_serial_AT_expect(p, "> ", 0, 1); // wait 1.5s for the prompt, no crlf -#if 1 - if (err) { - DEBUGA_AT - ("Error or timeout getting prompt '> ' for sending sms directly to the remote party. BTW, seems that we cannot do that with Motorola c350, so we'll write to cellphone memory, then send from memory\n", - CELLIAX_P_LOG); - - err = celliax_serial_write_AT_ack(p, "ATE1"); //motorola (at least c350) do not echo the '>' prompt when in ATE0... go figure!!!! - if (err) { - ERRORA("Error activating echo from modem\n", CELLIAX_P_LOG); - } - p->at_cmgw[0] = '\0'; - sprintf(smscommand, "AT+CMGW=\"%s\"", dest); //TODO: support phones that only accept pdu mode - err = celliax_serial_write_AT_noack(p, smscommand); - if (err) { - ERRORA("Error writing SMS destination to the cellphone memory\n", CELLIAX_P_LOG); - failed = 1; - goto uscita; - } - err = celliax_serial_AT_expect(p, "> ", 0, 1); // wait 1.5s for the prompt, no crlf - if (err) { - ERRORA - ("Error or timeout getting prompt '> ' for writing sms text in cellphone memory\n", - CELLIAX_P_LOG); - failed = 1; - goto uscita; - } - } -#endif - - //sprintf(text,"ciao 123 belè новости לק ראת ﺎﻠﺠﻤﻋﺓ 人大"); //let's test the beauty of utf - memset(smscommand, '\0', sizeof(smscommand)); - if (p->no_ucs2) { - sprintf(smscommand, "%s", text); - } else { - utf_to_ucs2(p, text, strlen(text), smscommand, sizeof(smscommand)); - } - - smscommand[strlen(smscommand)] = 0x1A; - DEBUGA_AT("smscommand len is: %d, text is:|||%s|||\n", CELLIAX_P_LOG, - strlen(smscommand), smscommand); - - err = celliax_serial_write_AT_ack_nocr_longtime(p, smscommand); - //TODO would be better to unlock controldev here - if (err) { - ERRORA("Error writing SMS text to the cellphone memory\n", CELLIAX_P_LOG); - //return RESULT_FAILURE; - failed = 1; - goto uscita; - } - if (p->at_cmgw[0]) { - sprintf(smscommand, "AT+CMSS=%s", p->at_cmgw); - err = celliax_serial_write_AT_expect_longtime(p, smscommand, "OK"); - if (err) { - ERRORA("Error sending SMS from the cellphone memory\n", CELLIAX_P_LOG); - //return RESULT_FAILURE; - failed = 1; - goto uscita; - } - - err = celliax_serial_write_AT_ack(p, "ATE0"); //motorola (at least c350) do not echo the '>' prompt when in ATE0... go figure!!!! - if (err) { - ERRORA("Error de-activating echo from modem\n", CELLIAX_P_LOG); - } - } - uscita: - usleep(1000); - - if (p->at_cmgw[0]) { - - /* let's see what we've sent, just for check TODO: Motorola it's not reliable! Motorola c350 tells that all was sent, but is not true! It just sends how much it fits into one SMS FIXME: need an algorithm to calculate how many ucs2 chars fits into an SMS. It make difference based, probably, on the GSM alphabet translation, or so */ - sprintf(smscommand, "AT+CMGR=%s", p->at_cmgw); - err = celliax_serial_write_AT_ack(p, smscommand); - if (err) { - ERRORA("Error reading SMS back from the cellphone memory\n", CELLIAX_P_LOG); - } - - /* let's delete from cellphone memory what we've sent */ - sprintf(smscommand, "AT+CMGD=%s", p->at_cmgw); - err = celliax_serial_write_AT_ack(p, smscommand); - if (err) { - ERRORA("Error deleting SMS from the cellphone memory\n", CELLIAX_P_LOG); - } - - p->at_cmgw[0] = '\0'; - } - //usleep(500000); //.5 secs - UNLOCKA(&p->controldev_lock); - POPPA_UNLOCKA(&p->controldev_lock); - } - - ast_log(LOG_DEBUG, "FINISH\n"); - if (failed) - return -1; - else - return RESULT_SUCCESS; -} - -#ifdef CELLIAX_DIR -/* For simplicity, I'm keeping the format compatible with the voicemail config, - but i'm open to suggestions for isolating it */ -#define CELLIAX_DIR_CONFIG "directoriax.conf" - -/* How many digits to read in */ -#define CELLIAX_DIR_NUMDIGITS 3 - -struct ast_config *celliax_dir_realtime(char *context) -{ - //TODO: all the realtime stuff has to be re-made - struct ast_config *cfg; - struct celliax_pvt *p = NULL; -#ifdef ASTERISK_VERSION_1_6_0 - struct ast_flags config_flags = { 0 }; -#endif /* ASTERISK_VERSION_1_6_0 */ - - /* Load flat file config. */ -#ifdef ASTERISK_VERSION_1_6_0 - cfg = ast_config_load(CELLIAX_DIR_CONFIG, config_flags); -#else - cfg = ast_config_load(CELLIAX_DIR_CONFIG); -#endif /* ASTERISK_VERSION_1_6_0 */ - - if (!cfg) { - /* Loading config failed. */ - WARNINGA - ("Loading directoriax.conf config file failed. It's not necessary, continuing.\n", - CELLIAX_P_LOG); - return NULL; - } - return cfg; -} - -static char *celliax_dir_convert(char *lastname) -{ - char *tmp; - int lcount = 0; - tmp = malloc(CELLIAX_DIR_NUMDIGITS + 1); - if (tmp) { - while ((*lastname > 32) && lcount < CELLIAX_DIR_NUMDIGITS) { - switch (toupper(*lastname)) { - case '1': - tmp[lcount++] = '1'; - break; - case '2': - case 'A': - case 'B': - case 'C': - tmp[lcount++] = '2'; - break; - case '3': - case 'D': - case 'E': - case 'F': - tmp[lcount++] = '3'; - break; - case '4': - case 'G': - case 'H': - case 'I': - tmp[lcount++] = '4'; - break; - case '5': - case 'J': - case 'K': - case 'L': - tmp[lcount++] = '5'; - break; - case '6': - case 'M': - case 'N': - case 'O': - tmp[lcount++] = '6'; - break; - case '7': - case 'P': - case 'Q': - case 'R': - case 'S': - tmp[lcount++] = '7'; - break; - case '8': - case 'T': - case 'U': - case 'V': - tmp[lcount++] = '8'; - break; - case '9': - case 'W': - case 'X': - case 'Y': - case 'Z': - tmp[lcount++] = '9'; - break; - } - lastname++; - } - tmp[lcount] = '\0'; - } - return tmp; -} - -int celliax_console_celliax_dir_export(int fd, int argc, char *argv[]) -{ - struct ast_config *cfg; - - struct ast_variable *v; - char *start, *pos, *stringp, *space, *options = NULL, *conv = NULL; - struct celliax_pvt *p = celliax_console_find_desc(celliax_console_active); - char *context = "default"; - char *s; - char *var, *value; - int fromcell = 0; - int fromskype = 0; - char name[256] = ""; - char phonebook_direct_calling_ext[7] = ""; - char write_entry_command[256] = ""; - char entry_number[256] = ""; - char entry_text[256] = ""; - char final_entry_text[256] = ""; - int res; - int tocell = 0; -#ifdef CELLIAX_LIBCSV - int tocsv = 0; - int tovcf = 0; -#endif /* CELLIAX_LIBCSV */ - - if (argc < 3 || argc > 4) - return RESULT_SHOWUSAGE; - if (!p) { - ast_cli(fd, "No \"current\" console ???, please enter 'help celliax_console'\n"); - return RESULT_SUCCESS; - } - - if (!strcasecmp(argv[1], "tocell")) - tocell = 1; -#ifdef CELLIAX_LIBCSV - else if (!strcasecmp(argv[1], "tocsv")) - tocsv = 1; - else if (!strcasecmp(argv[1], "tovcf")) - tovcf = 1; -#endif /* CELLIAX_LIBCSV */ - else { - ast_cli(fd, -#ifdef CELLIAX_LIBCSV - "\n\nYou have neither specified 'tocell' nor 'tocsv'\n\n"); -#else /* CELLIAX_LIBCSV */ - "\n\nYou have not specified 'tocell'\n\n"); -#endif /* CELLIAX_LIBCSV */ - return RESULT_SHOWUSAGE; - } - if (tocell) - if (p->controldevprotocol != PROTOCOL_AT) { - ast_cli(fd, - "Exporting to the cellphone phonebook is currently supported only on \"AT\" cellphones :( !\n"); - return RESULT_SUCCESS; - } -#ifdef CELLIAX_LIBCSV - if (tocsv || tovcf) - if (argc != 4) { - ast_cli(fd, "\n\nYou have to specify a filename with 'tocsv'\n\n"); - return RESULT_SHOWUSAGE; - } -#endif /* CELLIAX_LIBCSV */ - - if (option_debug) - NOTICA("celliax_cellphonenumber is: %s\n", CELLIAX_P_LOG, argv[2]); - -#ifdef CELLIAX_LIBCSV - if (tocsv) { - if (option_debug) - NOTICA("filename is: %s\n", CELLIAX_P_LOG, argv[3]); - //ast_cli(fd, "\n\nnot yet implemented :P \n"); - //return RESULT_SUCCESS; - } - if (tovcf) { - if (option_debug) - NOTICA("filename is: %s\n", CELLIAX_P_LOG, argv[3]); - ast_cli(fd, "\n\nnot yet implemented :P \n"); - return RESULT_SUCCESS; - } -#endif /* CELLIAX_LIBCSV */ - - cfg = celliax_dir_realtime(context); - if (!cfg) { - return -1; - } - - if (tocell) { - /* which phonebook to use, use the SIM */ - res = celliax_serial_write_AT_ack(p, "AT+CPBS=SM"); - if (res) { - WARNINGA("AT+CPBS=SM failed, continue\n", CELLIAX_P_LOG); - } - /* which phonebook to use, trying to use phone, not SIM */ - res = celliax_serial_write_AT_ack(p, "AT+CPBS=ME"); - if (res) { - WARNINGA("AT+CPBS=ME failed, continue\n", CELLIAX_P_LOG); - } - /* retrieve the fields lenght in the selected phonebook */ - p->phonebook_querying = 1; - res = celliax_serial_write_AT_ack(p, "AT+CPBR=?"); - if (res) { - WARNINGA("AT+CPBR=? failed, continue\n", CELLIAX_P_LOG); - } - p->phonebook_querying = 0; - - v = ast_variable_browse(cfg, context); - /* Find all candidate extensions */ - while (v) { - /* Find a candidate extension */ - start = strdup(v->value); - if (strcasestr(start, "fromcell=yes")) { - fromcell = 1; - fromskype = 0; - - } - if (strcasestr(start, "fromskype=yes")) { - fromcell = 0; - fromskype = 1; - - } - - if (start && !strcasestr(start, "hidefromdir=yes")) { - memset(name, 0, sizeof(name)); - memset(phonebook_direct_calling_ext, 0, sizeof(phonebook_direct_calling_ext)); - memset(write_entry_command, 0, sizeof(write_entry_command)); - memset(entry_number, 0, sizeof(entry_number)); - memset(entry_text, 0, sizeof(entry_text)); - memset(final_entry_text, 0, sizeof(final_entry_text)); - - DEBUGA_AT("v->name=%s\n", CELLIAX_P_LOG, v->name); - DEBUGA_AT("v->value=%s\n", CELLIAX_P_LOG, v->value); - - stringp = start; - strsep(&stringp, ","); - pos = strsep(&stringp, ","); - if (pos) { - ast_copy_string(name, pos, sizeof(name)); - if (strchr(pos, ' ')) { - space = strchr(pos, ' '); - *space = '\0'; - } - if (pos) { - conv = celliax_dir_convert(pos); - DEBUGA_AT("%s%s<\n", CELLIAX_P_LOG, pos, conv); - - options = strdup(v->value); - strsep(&options, ","); - strsep(&options, ","); - strsep(&options, ","); - strsep(&options, ","); - DEBUGA_AT("options=%s\n", CELLIAX_P_LOG, options); - - while ((s = strsep(&options, "|"))) { - value = s; - if ((var = strsep(&value, "=")) && value) { - DEBUGA_AT("var=%s value=%s\n", CELLIAX_P_LOG, var, value); - if (!strcmp(var, "phonebook_direct_calling_ext")) - strncpy(phonebook_direct_calling_ext, value, 6); - } - } - - res = - snprintf(entry_number, p->phonebook_number_lenght + 1, "%s%s%d%s%s", - argv[2], "p", p->celliax_dir_prefix, "p", - phonebook_direct_calling_ext); - if (res == (p->phonebook_number_lenght + 1) - || res > (p->phonebook_number_lenght + 1)) { - ERRORA("entry_number truncated, was: '%s%s%d%s%s', now is: '%s'\n", - CELLIAX_P_LOG, argv[2], "p", p->celliax_dir_prefix, "p", - phonebook_direct_calling_ext, entry_number); - //FIXME: abort ??? - - } - - res = snprintf(final_entry_text, p->phonebook_text_lenght + 1, "%s", name); //FIXME result not checked - - res = - snprintf(write_entry_command, sizeof(write_entry_command) - 1, - "AT+CPBW=,\"%s\",,\"%s\"", entry_number, final_entry_text); - if (res == (sizeof(write_entry_command) - 1) - || res > (sizeof(write_entry_command) - 1)) { - WARNINGA - ("write_entry_command truncated, was supposed: 'AT+CPBW=,\"%s\",,\"%s\"', now is: '%s'\n", - CELLIAX_P_LOG, entry_number, final_entry_text, write_entry_command); - } - //if (option_debug) - NOTICA("%s\n", CELLIAX_P_LOG, write_entry_command); - } - } - if (conv) - free(conv); - if (start) - free(start); - if (options) - free(options); - } - v = v->next; - } - } -#ifdef CELLIAX_LIBCSV - if (tocsv) { - - v = ast_variable_browse(cfg, context); - /* Find all candidate extensions */ - while (v) { - /* Find a candidate extension */ - start = strdup(v->value); - if (strcasestr(start, "fromcell=yes")) { - fromcell = 1; - fromskype = 0; - - } - if (strcasestr(start, "fromskype=yes")) { - fromcell = 0; - fromskype = 1; - - } - - if (start && !strcasestr(start, "hidefromdir=yes")) { - memset(name, 0, sizeof(name)); - memset(phonebook_direct_calling_ext, 0, sizeof(phonebook_direct_calling_ext)); - memset(write_entry_command, 0, sizeof(write_entry_command)); - memset(entry_number, 0, sizeof(entry_number)); - memset(entry_text, 0, sizeof(entry_text)); - memset(final_entry_text, 0, sizeof(final_entry_text)); - - DEBUGA_AT("v->name=%s\n", CELLIAX_P_LOG, v->name); - DEBUGA_AT("v->value=%s\n", CELLIAX_P_LOG, v->value); - - stringp = start; - strsep(&stringp, ","); - pos = strsep(&stringp, ","); - if (pos) { - ast_copy_string(name, pos, sizeof(name)); - if (strchr(pos, ' ')) { - space = strchr(pos, ' '); - *space = '\0'; - } - if (pos) { - conv = celliax_dir_convert(pos); - DEBUGA_AT("%s%s<\n", CELLIAX_P_LOG, pos, conv); - - options = strdup(v->value); - strsep(&options, ","); - strsep(&options, ","); - strsep(&options, ","); - strsep(&options, ","); - DEBUGA_AT("options=%s\n", CELLIAX_P_LOG, options); - - while ((s = strsep(&options, "|"))) { - value = s; - if ((var = strsep(&value, "=")) && value) { - DEBUGA_AT("var=%s value=%s\n", CELLIAX_P_LOG, var, value); - if (!strcmp(var, "phonebook_direct_calling_ext")) - strncpy(phonebook_direct_calling_ext, value, 6); - } - } - - //FIXME choose a logic for fields maximum lenght - res = - snprintf(entry_number, sizeof(entry_number) - 1, "%s%s%d%s%s", argv[2], "p", - p->celliax_dir_prefix, "p", phonebook_direct_calling_ext); - if (res == (sizeof(entry_number) - 1) - || res > (sizeof(entry_number) - 1)) { - ERRORA("entry_number truncated, was: '%s%s%d%s%s', now is: '%s'\n", - CELLIAX_P_LOG, argv[2], "p", p->celliax_dir_prefix, "p", - phonebook_direct_calling_ext, entry_number); - //FIXME: abort ??? - - } - - res = snprintf(final_entry_text, sizeof(final_entry_text) - 1, "%s", name); //FIXME result not checked - - int i, a; - - a = 0; - for (i = 0; i < p->csv_complete_name_pos - 1; i++) { - if (p->csv_separator_is_semicolon) - write_entry_command[a] = ';'; - else - write_entry_command[a] = ','; - a++; - } - //NOTICA("i=%d a=%d\n", CELLIAX_P_LOG, i, a); - - write_entry_command[a] = '"'; - a++; - //NOTICA("i=%d a=%d\n", CELLIAX_P_LOG, i, a); - for (i = 0; i < strlen(final_entry_text); i++) { - write_entry_command[a] = final_entry_text[i]; - a++; - } - //NOTICA("i=%d a=%d\n", CELLIAX_P_LOG, i, a); - write_entry_command[a] = '"'; - a++; - //NOTICA("i=%d a=%d\n", CELLIAX_P_LOG, i, a); - for (i = 0; i < (p->csv_business_phone_pos - p->csv_complete_name_pos); i++) { - if (p->csv_separator_is_semicolon) - write_entry_command[a] = ';'; - else - write_entry_command[a] = ','; - a++; - } - - //NOTICA("i=%d a=%d\n", CELLIAX_P_LOG, i, a); - - write_entry_command[a] = '"'; - a++; - //NOTICA("i=%d a=%d\n", CELLIAX_P_LOG, i, a); - for (i = 0; i < strlen(entry_number); i++) { - write_entry_command[a] = entry_number[i]; - a++; - } - //NOTICA("i=%d a=%d\n", CELLIAX_P_LOG, i, a); - write_entry_command[a] = '"'; - a++; - //NOTICA("i=%d a=%d\n", CELLIAX_P_LOG, i, a); - - if (option_debug) - NOTICA("%s\n", CELLIAX_P_LOG, write_entry_command); - } - } - if (conv) - free(conv); - if (start) - free(start); - if (options) - free(options); - } - v = v->next; - } - - } - if (tovcf) { -//TODO implementation here - } -#endif /* CELLIAX_LIBCSV */ - ast_config_destroy(cfg); - return 0; -} - -#ifdef CELLIAX_LIBCSV - -void celliax_cb1(char *s, size_t len, void *data) -{ - struct celliax_pvt *p = data; - char field_content[256]; - - p->csv_fields++; - memset(field_content, 0, sizeof(field_content)); - strncpy(field_content, s, - sizeof(field_content) > (len + 1) ? len : (sizeof(field_content) - 1)); - if (p->csv_fields == p->csv_complete_name_pos) { - strncpy(p->csv_complete_name, field_content, sizeof(p->csv_complete_name) - 1); - } - if (p->csv_fields == p->csv_email_pos) { - strncpy(p->csv_email, field_content, sizeof(p->csv_email) - 1); - } - if (p->csv_fields == p->csv_home_phone_pos) { - strncpy(p->csv_home_phone, field_content, sizeof(p->csv_home_phone) - 1); - } - if (p->csv_fields == p->csv_mobile_phone_pos) { - strncpy(p->csv_mobile_phone, field_content, sizeof(p->csv_mobile_phone) - 1); - } - if (p->csv_fields == p->csv_business_phone_pos) { - strncpy(p->csv_business_phone, field_content, sizeof(p->csv_business_phone) - 1); - } -} - -void celliax_cb2(char c, void *data) -{ - struct celliax_pvt *p = data; - - p->csv_rows++; - p->csv_fields = 0; - - if (p->csv_first_row_is_title && p->csv_rows == 1) { - //do nothing - } else { - if (strlen(p->csv_complete_name)) { - if (option_debug) - NOTICA - ("ROW %d ENDED, complete_name=%s, email=%s, home_phone=%s, mobile_phone=%s, business_phone=%s\n", - CELLIAX_P_LOG, p->csv_rows, - strlen(p->csv_complete_name) ? p->csv_complete_name : "N/A", - strlen(p->csv_email) ? p->csv_email : "N/A", - strlen(p->csv_home_phone) ? p->csv_home_phone : "N/A", - strlen(p->csv_mobile_phone) ? p->csv_mobile_phone : "N/A", - strlen(p->csv_business_phone) ? p->csv_business_phone : "N/A"); - } - - /* write entries in phonebook file */ - if (p->phonebook_writing_fp) { - celliax_dir_entry_extension++; - - if (strlen(p->csv_complete_name)) { - /* let's start with home_phone */ - if (strlen(p->csv_home_phone)) { - fprintf(p->phonebook_writing_fp, - "%s => ,%s %sSKO,,,hidefromdir=%s|phonebook_direct_calling_ext=%d%s%.4d|phonebook_entry_fromcsv=%s|phonebook_entry_owner=%s\n", - p->csv_home_phone, p->csv_complete_name, "HOME", "no", - p->celliax_dir_entry_extension_prefix, "2", celliax_dir_entry_extension, - "yes", "not_specified"); - fprintf(p->phonebook_writing_fp, - "%s => ,%s %sDO,,,hidefromdir=%s|phonebook_direct_calling_ext=%d%s%.4d|phonebook_entry_fromcsv=%s|phonebook_entry_owner=%s\n", - p->csv_home_phone, p->csv_complete_name, "HOME", "no", - p->celliax_dir_entry_extension_prefix, "3", celliax_dir_entry_extension, - "yes", "not_specified"); - } - - /* now business_phone */ - if (strlen(p->csv_business_phone)) { - fprintf(p->phonebook_writing_fp, - "%s => ,%s %sSKO,,,hidefromdir=%s|phonebook_direct_calling_ext=%d%s%.4d|phonebook_entry_fromcsv=%s|phonebook_entry_owner=%s\n", - p->csv_business_phone, p->csv_complete_name, "BIZ", "no", - p->celliax_dir_entry_extension_prefix, "2", celliax_dir_entry_extension, - "yes", "not_specified"); - fprintf(p->phonebook_writing_fp, - "%s => ,%s %sDO,,,hidefromdir=%s|phonebook_direct_calling_ext=%d%s%.4d|phonebook_entry_fromcsv=%s|phonebook_entry_owner=%s\n", - p->csv_business_phone, p->csv_complete_name, "BIZ", "no", - p->celliax_dir_entry_extension_prefix, "3", celliax_dir_entry_extension, - "yes", "not_specified"); - } - - /* let's end with mobile_phone */ - if (strlen(p->csv_mobile_phone)) { - fprintf(p->phonebook_writing_fp, - "%s => ,%s %sSKO,,,hidefromdir=%s|phonebook_direct_calling_ext=%d%s%.4d|phonebook_entry_fromcsv=%s|phonebook_entry_owner=%s\n", - p->csv_mobile_phone, p->csv_complete_name, "CELL", "no", - p->celliax_dir_entry_extension_prefix, "2", celliax_dir_entry_extension, - "yes", "not_specified"); - fprintf(p->phonebook_writing_fp, - "%s => ,%s %sDO,,,hidefromdir=%s|phonebook_direct_calling_ext=%d%s%.4d|phonebook_entry_fromcsv=%s|phonebook_entry_owner=%s\n", - p->csv_mobile_phone, p->csv_complete_name, "CELL", "no", - p->celliax_dir_entry_extension_prefix, "3", celliax_dir_entry_extension, - "yes", "not_specified"); - } - } - - } - - } -} - -#endif /* CELLIAX_LIBCSV */ - -int celliax_console_celliax_dir_import(int fd, int argc, char *argv[]) -{ - int res; - struct celliax_pvt *p = celliax_console_find_desc(celliax_console_active); - char list_command[64]; - char fn[256]; - char date[256] = ""; - time_t t; - char *configfile = CELLIAX_DIR_CONFIG; - int add_to_celliax_dir_conf = 1; - //int fromskype = 0; - int fromcell = 0; -#ifdef CELLIAX_LIBCSV - int fromcsv = 0; - int fromvcf = 0; -#endif /* CELLIAX_LIBCSV */ - - if (argc < 3 || argc > 4) - return RESULT_SHOWUSAGE; - if (!p) { - ast_cli(fd, "No \"current\" console ???, please enter 'help celliax_console'\n"); - return RESULT_SUCCESS; - } - - if (!strcasecmp(argv[1], "add")) - add_to_celliax_dir_conf = 1; - else if (!strcasecmp(argv[1], "replace")) - add_to_celliax_dir_conf = 0; - else { - ast_cli(fd, "\n\nYou have neither specified 'add' nor 'replace'\n\n"); - return RESULT_SHOWUSAGE; - } - - //if (!strcasecmp(argv[2], "fromskype")) - //fromskype = 1; - //else - - if (!strcasecmp(argv[2], "fromcell")) - fromcell = 1; -#ifdef CELLIAX_LIBCSV - else if (!strcasecmp(argv[2], "fromcsv")) - fromcsv = 1; - else if (!strcasecmp(argv[2], "fromvcf")) - fromvcf = 1; -#endif /* CELLIAX_LIBCSV */ - else { - ast_cli(fd, "\n\nYou have neither specified 'fromcell' neither 'fromcsv'\n\n"); - return RESULT_SHOWUSAGE; - } - -#ifdef CELLIAX_LIBCSV - if (fromcsv || fromvcf) - if (argc != 4) { - ast_cli(fd, - "\n\nYou have to specify a filename with 'fromcsv' or with 'fromvcf'\n\n"); - return RESULT_SHOWUSAGE; - } -#endif /* CELLIAX_LIBCSV */ - if (fromcell) - if (p->controldevprotocol != PROTOCOL_AT) { - ast_cli(fd, - "Importing from cellphone is currently supported only on \"AT\" cellphones :( !\n"); - //fclose(p->phonebook_writing_fp); - //celliax_dir_create_extensions(); - return RESULT_SUCCESS; - } - - if (fromcell) - if (argc != 3) { - ast_cli(fd, "\n\nYou don't have to specify a filename with 'fromcell'\n\n"); - return RESULT_SHOWUSAGE; - } -#ifdef CELLIAX_LIBCSV - if (fromvcf) { - if (option_debug) - NOTICA("filename is: %s\n", CELLIAX_P_LOG, argv[3]); - ast_cli(fd, "\n\nnot yet implemented :P \n"); - return RESULT_SUCCESS; - } -#endif /* CELLIAX_LIBCSV */ - - /*******************************************************************************************/ - - if (configfile[0] == '/') { - ast_copy_string(fn, configfile, sizeof(fn)); - } else { - snprintf(fn, sizeof(fn), "%s/%s", ast_config_AST_CONFIG_DIR, configfile); - } - if (option_debug) - NOTICA("Opening '%s'\n", CELLIAX_P_LOG, fn); - time(&t); - ast_copy_string(date, ctime(&t), sizeof(date)); - - if (add_to_celliax_dir_conf) - p->phonebook_writing_fp = fopen(fn, "a+"); - else - p->phonebook_writing_fp = fopen(fn, "w+"); - - if (p->phonebook_writing_fp) { - if (add_to_celliax_dir_conf) { - if (option_debug) - NOTICA("Opened '%s' for appending \n", CELLIAX_P_LOG, fn); - fprintf(p->phonebook_writing_fp, ";!\n"); - fprintf(p->phonebook_writing_fp, ";! Update Date: %s", date); - fprintf(p->phonebook_writing_fp, ";! Updated by: %s, %d\n", __FILE__, __LINE__); - fprintf(p->phonebook_writing_fp, ";!\n"); - } else { - if (option_debug) - NOTICA("Opened '%s' for writing \n", CELLIAX_P_LOG, fn); - fprintf(p->phonebook_writing_fp, ";!\n"); - fprintf(p->phonebook_writing_fp, ";! Automatically generated configuration file\n"); - fprintf(p->phonebook_writing_fp, ";! Filename: %s (%s)\n", configfile, fn); - fprintf(p->phonebook_writing_fp, ";! Creation Date: %s", date); - fprintf(p->phonebook_writing_fp, ";! Generated by: %s, %d\n", __FILE__, __LINE__); - fprintf(p->phonebook_writing_fp, ";!\n"); - fprintf(p->phonebook_writing_fp, "[general]\n\n"); - fprintf(p->phonebook_writing_fp, "[default]\n"); - } - -#ifdef CELLIAX_LIBCSV - //FIXME: if add_to_celliax_dir_conf parse the "old" config file, so to have the correct next entry id-exten - if (fromcsv) { - if (option_debug) - NOTICA("filename is: %s\n", CELLIAX_P_LOG, argv[3]); - -/************************/ - FILE *fp; - struct csv_parser *csvp; - char buf[1024]; - size_t bytes_read; - unsigned char options = 0; - - p->csv_rows = 0; - p->csv_fields = 0; - - if (p->csv_separator_is_semicolon) { - if (csv_init(&csvp, options | CSV_USE_SEMICOLON_SEPARATOR) != 0) { - ERRORA("Failed to initialize csv parser\n", CELLIAX_P_LOG); - return RESULT_SUCCESS; - } - } else { - if (csv_init(&csvp, options) != 0) { - ERRORA("Failed to initialize csv parser\n", CELLIAX_P_LOG); - return RESULT_SUCCESS; - } - - } - - fp = fopen(argv[3], "rb"); - if (!fp) { - ERRORA("Failed to open %s: %s\n", CELLIAX_P_LOG, argv[3], strerror(errno)); - return RESULT_SUCCESS; - } - while ((bytes_read = fread(buf, 1, 1024, fp)) > 0) { - if (csv_parse(csvp, buf, bytes_read, celliax_cb1, celliax_cb2, p) != bytes_read) { - ERRORA("Error while parsing file: %s\n", CELLIAX_P_LOG, - csv_strerror(csv_error(csvp))); - } - } - - csv_fini(csvp, celliax_cb1, celliax_cb2, p); - - if (ferror(fp)) { - ERRORA("Error while reading file %s\n", CELLIAX_P_LOG, argv[3]); - fclose(fp); - return RESULT_SUCCESS; - } - - fclose(fp); - if (option_debug) - NOTICA("%s: %d fields, %d rows\n", CELLIAX_P_LOG, argv[3], p->csv_fields, - p->csv_rows); - - csv_free(csvp); - - /**************************/ - } -#endif /* CELLIAX_LIBCSV */ - - /*******************************************************************************************/ - //if (fromskype) { - //ast_cli(fd, - //"Skype not supported in celliax_dir. Load chan_skypiax and use skypiax_dir!\n"); - //} - - /*******************************************************************************************/ - if (fromcell) { - /* which phonebook to use, use the SIM */ - res = celliax_serial_write_AT_ack(p, "AT+CPBS=SM"); - if (res) { - WARNINGA("AT+CPBS=SM failed, continue\n", CELLIAX_P_LOG); - } - /* which phonebook to use, trying to use combined phone+SIM */ - res = celliax_serial_write_AT_ack(p, "AT+CPBS=MT"); - if (res) { - WARNINGA("AT+CPBS=MT failed, continue\n", CELLIAX_P_LOG); - } - /* How many entries in phonebook */ - p->phonebook_querying = 1; - res = celliax_serial_write_AT_ack(p, "AT+CPBR=?"); - if (res) { - WARNINGA("AT+CPBR=? failed, continue\n", CELLIAX_P_LOG); - } - p->phonebook_querying = 0; - /* list entries in phonebook, give the SIM the time to answer */ - WARNINGA - ("About to querying the cellphone phonebook, if the SIM do not answer may stuck here for 20 seconds... Don't worry.\n", - CELLIAX_P_LOG); - sprintf(list_command, "AT+CPBR=%d,%d", p->phonebook_first_entry, - p->phonebook_last_entry); - p->phonebook_listing = 1; - res = celliax_serial_write_AT_expect_longtime(p, list_command, "OK"); - if (res) { - WARNINGA("AT+CPBR=%d,%d failed, continue\n", CELLIAX_P_LOG, - p->phonebook_first_entry, p->phonebook_last_entry); - } - p->phonebook_listing = 0; - } - /*******************************************************************************************/ -#ifdef CELLIAX_LIBCSV - if (fromvcf) { - //TODO implementation here - } -#endif /* CELLIAX_LIBCSV */ - - } else { - ast_cli(fd, "\n\nfailed to open the directoriax.conf configuration file: %s\n", fn); - ERRORA("failed to open the directoriax.conf configuration file: %s\n", CELLIAX_P_LOG, - fn); - return RESULT_FAILURE; - } - - fclose(p->phonebook_writing_fp); - //celliax_dir_create_extensions(); - - return RESULT_SUCCESS; -} - -#endif /* CELLIAX_DIR */ - -#ifdef CELLIAX_FBUS2 - -int celliax_serial_getstatus_FBUS2(struct celliax_pvt *p) -{ - unsigned char MsgBuffer[7]; - int res; - int how_many_reads = 0; - - PUSHA_UNLOCKA(&p->controldev_lock); - LOKKA(&p->controldev_lock); - - MsgBuffer[0] = FBUS2_COMMAND_BYTE_1; - MsgBuffer[1] = FBUS2_COMMAND_BYTE_2; - MsgBuffer[2] = 0x00; - MsgBuffer[3] = 0x03; - MsgBuffer[4] = 0x00; - MsgBuffer[5] = FBUS2_IS_LAST_FRAME; - MsgBuffer[6] = celliax_serial_get_seqnum_FBUS2(p); - - if (option_debug > 1) - DEBUGA_FBUS2("asking model, outseqnum %.2X \n", CELLIAX_P_LOG, MsgBuffer[6]); - celliax_serial_write_FBUS2(p, MsgBuffer, 7, FBUS2_TYPE_MODEL_ASK); - usleep(1000); - res = celliax_serial_read_FBUS2(p); //we don't have no monitor neither do_controldev_thread - if (res == -1) { - ERRORA("failed celliax_serial_read_FBUS2\n", CELLIAX_P_LOG); - UNLOCKA(&p->controldev_lock); - return -1; - } - while (res != MsgBuffer[6] && res != FBUS2_TYPE_MODEL_ANSWER) { - usleep(1000); - res = celliax_serial_read_FBUS2(p); - how_many_reads++; - if (res == -1) { - ERRORA("failed celliax_serial_read_FBUS2\n", CELLIAX_P_LOG); - UNLOCKA(&p->controldev_lock); - return -1; - } - if (how_many_reads > 10) { - ERRORA("no expected results in %d celliax_serial_read_FBUS2\n", CELLIAX_P_LOG, - how_many_reads); - UNLOCKA(&p->controldev_lock); - return -1; - } - } - - UNLOCKA(&p->controldev_lock); - POPPA_UNLOCKA(&p->controldev_lock); - return 0; -} - -int celliax_serial_sync_FBUS2(struct celliax_pvt *p) -{ - unsigned char initc = 0x55; /* FBUS2 initialization char */ - int c, rt; - PUSHA_UNLOCKA(&p->controldev_lock); - LOKKA(&p->controldev_lock); - /* init the link (sync receive uart) */ - for (c = 0; c < 55; c++) { /* 55 times */ - usleep(10000); - rt = write(p->controldevfd, &initc, 1); - if (rt != 1) { - ERRORA("serial error: %s", CELLIAX_P_LOG, strerror(errno)); - UNLOCKA(&p->controldev_lock); - return -1; - } - } - time(&p->celliax_serial_synced_timestamp); - UNLOCKA(&p->controldev_lock); - POPPA_UNLOCKA(&p->controldev_lock); - return 0; -} - -int celliax_serial_answer_FBUS2(struct celliax_pvt *p) -{ - unsigned char MsgBuffer[6]; - - celliax_serial_security_command_FBUS2(p); - - MsgBuffer[0] = FBUS2_COMMAND_BYTE_1; - MsgBuffer[1] = FBUS2_COMMAND_BYTE_2; - MsgBuffer[2] = FBUS2_SECURIY_CALL_COMMANDS; - MsgBuffer[3] = FBUS2_SECURIY_CALL_COMMAND_ANSWER; - MsgBuffer[4] = FBUS2_IS_LAST_FRAME; - MsgBuffer[5] = celliax_serial_get_seqnum_FBUS2(p); - if (option_debug > 1) - DEBUGA_FBUS2("celliax_serial_answer_FBUS2, outseqnum %.2X \n", CELLIAX_P_LOG, - MsgBuffer[5]); - celliax_serial_write_FBUS2(p, MsgBuffer, 6, FBUS2_TYPE_SECURITY); - DEBUGA_FBUS2("FBUS2: sent commands to answer the call\n", CELLIAX_P_LOG); - p->interface_state = AST_STATE_UP; //FIXME - - return 0; -} - -int celliax_serial_call_FBUS2(struct celliax_pvt *p, char *dstr) -{ - unsigned char MsgBufferNum[255]; - int i; - - celliax_serial_security_command_FBUS2(p); - - MsgBufferNum[0] = FBUS2_COMMAND_BYTE_1; - MsgBufferNum[1] = FBUS2_COMMAND_BYTE_2; - MsgBufferNum[2] = FBUS2_SECURIY_CALL_COMMANDS; - MsgBufferNum[3] = FBUS2_SECURIY_CALL_COMMAND_CALL; - for (i = 0; i < strlen(dstr); i++) { - MsgBufferNum[4 + i] = dstr[i]; - } - MsgBufferNum[4 + strlen(dstr)] = 0x00; /* required by FBUS2 prot */ - MsgBufferNum[4 + strlen(dstr) + 1] = FBUS2_IS_LAST_FRAME; - MsgBufferNum[4 + strlen(dstr) + 2] = celliax_serial_get_seqnum_FBUS2(p); - if (option_debug > 1) - DEBUGA_FBUS2("celliax_serial_call_FBUS2, outseqnum %.2X \n", CELLIAX_P_LOG, - MsgBufferNum[4 + strlen(dstr) + 2]); - celliax_serial_write_FBUS2(p, MsgBufferNum, 5 + strlen(dstr) + 2, FBUS2_TYPE_SECURITY); - - p->phone_callflow = CALLFLOW_CALL_DIALING; - p->interface_state = AST_STATE_DIALING; - if (option_debug) - DEBUGA_FBUS2("FBUS2: sent commands to call\n", CELLIAX_P_LOG); - return 0; -} - -int celliax_serial_hangup_FBUS2(struct celliax_pvt *p) -{ - unsigned char MsgBuffer[6]; - - if (p->interface_state != AST_STATE_DOWN) { - celliax_serial_security_command_FBUS2(p); - - MsgBuffer[0] = FBUS2_COMMAND_BYTE_1; - MsgBuffer[1] = FBUS2_COMMAND_BYTE_2; - MsgBuffer[2] = FBUS2_SECURIY_CALL_COMMANDS; - MsgBuffer[3] = FBUS2_SECURIY_CALL_COMMAND_RELEASE; - MsgBuffer[4] = FBUS2_IS_LAST_FRAME; - MsgBuffer[5] = celliax_serial_get_seqnum_FBUS2(p); - - if (option_debug > 1) - DEBUGA_FBUS2("celliax_serial_hangup_FBUS2, outseqnum %.2X \n", CELLIAX_P_LOG, - MsgBuffer[5]); - celliax_serial_write_FBUS2(p, MsgBuffer, 6, FBUS2_TYPE_SECURITY); - - DEBUGA_FBUS2("FBUS2: sent commands to hangup the call\n", CELLIAX_P_LOG); - - } - p->interface_state = AST_STATE_DOWN; //FIXME - p->phone_callflow = CALLFLOW_CALL_IDLE; //FIXME - return 0; -} - -int celliax_serial_config_FBUS2(struct celliax_pvt *p) -{ - unsigned char MsgBuffer[6]; - int res; - int how_many_reads = 0; - - MsgBuffer[0] = FBUS2_COMMAND_BYTE_1; - MsgBuffer[1] = FBUS2_COMMAND_BYTE_2; - MsgBuffer[2] = FBUS2_SECURIY_EXTENDED_COMMANDS; - MsgBuffer[3] = FBUS2_SECURIY_EXTENDED_COMMAND_ON; - MsgBuffer[4] = FBUS2_IS_LAST_FRAME; - MsgBuffer[5] = celliax_serial_get_seqnum_FBUS2(p); - - if (option_debug > 1) - DEBUGA_FBUS2("activating security commands for getting IMEI, outseqnum %.2X \n", - CELLIAX_P_LOG, MsgBuffer[5]); - celliax_serial_write_FBUS2(p, MsgBuffer, 6, FBUS2_TYPE_SECURITY); - res = celliax_serial_read_FBUS2(p); //we don't have no monitor neither do_controldev_thread - if (res == -1) { - ERRORA("failed celliax_serial_read_FBUS2\n", CELLIAX_P_LOG); - return -1; - } - while (res != MsgBuffer[5] && res != FBUS2_SECURIY_EXTENDED_COMMAND_ON) { - usleep(1000); - res = celliax_serial_read_FBUS2(p); - how_many_reads++; - if (res == -1) { - ERRORA("failed celliax_serial_read_FBUS2\n", CELLIAX_P_LOG); - return -1; - } - if (how_many_reads > 10) { - ERRORA("no expected results in %d celliax_serial_read_FBUS2\n", CELLIAX_P_LOG, - how_many_reads); - return -1; - } - } - - MsgBuffer[0] = FBUS2_COMMAND_BYTE_1; - MsgBuffer[1] = FBUS2_COMMAND_BYTE_2; - MsgBuffer[2] = FBUS2_SECURIY_IMEI_COMMANDS; - MsgBuffer[3] = FBUS2_SECURIY_IMEI_COMMAND_GET; - MsgBuffer[4] = FBUS2_IS_LAST_FRAME; - MsgBuffer[5] = celliax_serial_get_seqnum_FBUS2(p); - if (option_debug > 1) - DEBUGA_FBUS2("celliax_serial_get_IMEI_init_FBUS2, outseqnum %.2X \n", CELLIAX_P_LOG, - MsgBuffer[5]); - celliax_serial_write_FBUS2(p, MsgBuffer, 6, FBUS2_TYPE_SECURITY); - res = celliax_serial_read_FBUS2(p); //we don't have no monitor neither do_controldev_thread - if (res == -1) { - ERRORA("failed celliax_serial_read_FBUS2\n", CELLIAX_P_LOG); - return -1; - } - how_many_reads = 0; - while (res != MsgBuffer[5] && res != CALLFLOW_GOT_IMEI) { - usleep(1000); - res = celliax_serial_read_FBUS2(p); - how_many_reads++; - if (res == -1) { - ERRORA("failed celliax_serial_read_FBUS2\n", CELLIAX_P_LOG); - return -1; - } - if (how_many_reads > 10) { - ERRORA("no expected results in %d celliax_serial_read_FBUS2\n", CELLIAX_P_LOG, - how_many_reads); - //FIXME return -1; - return 0; - } - } - - if (option_debug > 1) - DEBUGA_FBUS2("xxxxx GOT IMEI xxxxx res=%d %.2X \n", CELLIAX_P_LOG, res, res); - - return 0; -} - -int celliax_serial_get_seqnum_FBUS2(struct celliax_pvt *p) -{ - if (p->seqnumfbus > FBUS2_SEQNUM_MAX || p->seqnumfbus < FBUS2_SEQNUM_MIN) { - ERRORA("p->seqnumfbus: %2.X\n", CELLIAX_P_LOG, p->seqnumfbus); - p->seqnumfbus = FBUS2_SEQNUM_MIN; - } - - if (p->seqnumfbus == FBUS2_SEQNUM_MAX) { - p->seqnumfbus = FBUS2_SEQNUM_MIN; - } else { - p->seqnumfbus++; - } - if (option_debug > 10) - DEBUGA_FBUS2("sqnum: %2.X\n", CELLIAX_P_LOG, p->seqnumfbus); - return p->seqnumfbus; -} - -int celliax_serial_security_command_FBUS2(struct celliax_pvt *p) -{ - unsigned char MsgBuffer[6]; - - MsgBuffer[0] = FBUS2_COMMAND_BYTE_1; - MsgBuffer[1] = FBUS2_COMMAND_BYTE_2; - MsgBuffer[2] = FBUS2_SECURIY_EXTENDED_COMMANDS; - MsgBuffer[3] = FBUS2_SECURIY_EXTENDED_COMMAND_ON; - MsgBuffer[4] = FBUS2_IS_LAST_FRAME; - MsgBuffer[5] = celliax_serial_get_seqnum_FBUS2(p); - - if (option_debug > 1) - DEBUGA_FBUS2("activating security commands, outseqnum %.2X \n", CELLIAX_P_LOG, - MsgBuffer[5]); - celliax_serial_write_FBUS2(p, MsgBuffer, 6, FBUS2_TYPE_SECURITY); - return 0; -} - -/*! - * \brief Write on the serial port for all the FBUS2 (old Nokia) functions - * \param p celliax_pvt - * \param len lenght of buffer2 - * \param buffer2 chars to be written - * - * Write on the serial port for all the FBUS2 (old Nokia) functions - * - * \return the number of chars written on the serial, - * that can be different from len (or negative) in case of errors. - */ -int celliax_serial_send_FBUS2(struct celliax_pvt *p, int len, unsigned char *mesg_ptr) -{ - int ret; - size_t actual = 0; - unsigned char *mesg_ptr2 = mesg_ptr; - PUSHA_UNLOCKA(&p->controldev_lock); - LOKKA(&p->controldev_lock); - do { - ret = write(p->controldevfd, mesg_ptr, len - actual); - if (ret < 0 && errno == EAGAIN) - continue; - if (ret < 0) { - if (actual != len) - ERRORA("celliax_serial_write error: %s", CELLIAX_P_LOG, strerror(errno)); - UNLOCKA(&p->controldev_lock); - return -1; - } - actual += ret; - mesg_ptr += ret; - usleep(10000); - } while (actual < len); - - UNLOCKA(&p->controldev_lock); - POPPA_UNLOCKA(&p->controldev_lock); - if (option_debug > 10) { - int i; - char debug_buf[1024]; - char *debug_buf_pos; - - memset(debug_buf, 0, 1024); - debug_buf_pos = debug_buf; - - for (i = 0; i < len; i++) { - debug_buf_pos += sprintf(debug_buf_pos, "[%.2X] ", mesg_ptr2[i]); - if (debug_buf_pos > ((char *) &debug_buf + 1000)) - break; - } - DEBUGA_FBUS2("%s was sent down the wire\n", CELLIAX_P_LOG, debug_buf); - } - - return 0; -} - -/*! - * \brief Flags as acknowledged an FBUS2 message previously sent - * \param p celliax_pvt - * \param seqnum identifier of the message to be acknowledged - * - * Called upon receiving an FBUS2 acknoledgement message, browse the fbus2_outgoing_list - * looking for the seqnum sent FBUS2 message, and flags it as acknowledged. - * (if an outgoing FBUS2 message is not aknowledged by the cellphone in a while, - * it will be retransmitted) - * - * \return 0 on error, 1 otherwise - */ -int celliax_serial_list_acknowledge_FBUS2(struct celliax_pvt *p, int seqnum) -{ - struct fbus2_msg *ptr; - - ptr = p->fbus2_outgoing_list; - if (ptr == NULL) { - ERRORA("fbus2_outgoing_list is NULL ?\n", CELLIAX_P_LOG); - return -1; - } - PUSHA_UNLOCKA(&p->fbus2_outgoing_list_lock); - LOKKA(&p->fbus2_outgoing_list_lock); - while (ptr->next != NULL) - ptr = ptr->next; - while (ptr->acknowledged == 0) { - if (ptr->seqnum == seqnum) { - ptr->acknowledged = 1; - if (option_debug > 1) - DEBUGA_FBUS2("Acknowledgment to %.2X\n", CELLIAX_P_LOG, seqnum); - - DEBUGA_FBUS2("PREFREE OUTGOING list:\n", CELLIAX_P_LOG); - celliax_serial_list_print_FBUS2(p, p->fbus2_outgoing_list); - if (ptr->previous) { - if (ptr->next) { - ptr->previous->next = ptr->next; - } else { - ptr->previous->next = NULL; - } - } - if (ptr->next) { - if (ptr->previous) { - ptr->next->previous = ptr->previous; - } else { - ptr->next->previous = NULL; - } - } - - if ((NULL == ptr->next) && (NULL == ptr->previous)) { /* bug catched by Wojciech Andralojc */ - if (option_debug > 1) - DEBUGA_FBUS2("FREEING LAST\n", CELLIAX_P_LOG); - p->fbus2_outgoing_list = NULL; - p->fbus2_outgoing_list = celliax_serial_list_init_FBUS2(p); - } - - free(ptr); - DEBUGA_FBUS2("POSTFREE OUTGOING list:\n", CELLIAX_P_LOG); - celliax_serial_list_print_FBUS2(p, p->fbus2_outgoing_list); - - break; - } - if (ptr->previous != NULL) { - ptr = ptr->previous; - } else { - ERRORA - ("The phone sent us an acknowledgement referring to a msg with a seqnum that is not in our sent list: %.2X\n", - CELLIAX_P_LOG, seqnum); - break; - } - } - UNLOCKA(&p->fbus2_outgoing_list_lock); - POPPA_UNLOCKA(&p->fbus2_outgoing_list_lock); - return 0; -} - -/*! - * \brief Sends an FBUS2 message or resends it if it was not acknowledged - * \param p celliax_pvt - * - * Called by celliax_serial_read_FBUS2, browse the fbus2_outgoing_list looking for FBUS2 messages to be sent, - * or for FBUS2 messages previously sent but not yet acknoledged. - * (if an outgoing FBUS2 message is not aknowledged by the cellphone in a while, - * it will be retransmitted) - * - * \return 0 on error, 1 otherwise - */ -int celliax_serial_send_if_time_FBUS2(struct celliax_pvt *p) -{ - struct fbus2_msg *ptr; - struct timeval tv; - struct timezone tz; - - gettimeofday(&tv, &tz); - ptr = p->fbus2_outgoing_list; - if (ptr == NULL) { - ERRORA("fbus2_outgoing_list is NULL ?\n", CELLIAX_P_LOG); - return -1; - } - while (ptr->next != NULL) { - WARNINGA("fbus2_outgoing_list->next is not null ?\n", CELLIAX_P_LOG); - ptr = ptr->next; //FIXME what to do? - } - while (ptr->sent == 0 && ptr->acknowledged == 0) { - if (ptr->previous != NULL) { - ptr = ptr->previous; - } else - break; - } - while (ptr->sent == 1 && ptr->acknowledged == 0) { - if (ptr->previous != NULL) { - ptr = ptr->previous; - } else - break; - } - if (ptr->sent == 1 && ptr->acknowledged == 1) { - if (ptr->next != NULL) { - ptr = ptr->next; - } - } - if (ptr->sent == 1 && ptr->acknowledged == 0 && ptr->msg > 0) { - if ((tv.tv_sec * 1000 + tv.tv_usec / 1000) > - ((ptr->tv_sec * 1000 + ptr->tv_usec / 1000) + 1000)) { - - PUSHA_UNLOCKA(&p->fbus2_outgoing_list_lock); - LOKKA(&p->fbus2_outgoing_list_lock); - - if (ptr->sent == 1 && ptr->acknowledged == 0 && ptr->msg > 0) { //retest, maybe has been changed? - if ((tv.tv_sec * 1000 + tv.tv_usec / 1000) > ((ptr->tv_sec * 1000 + ptr->tv_usec / 1000) + 1000)) { //retest, maybe has been changed? - - if (option_debug > 1) - DEBUGA_FBUS2("RESEND %.2X, passed %ld ms, sent %d times\n", CELLIAX_P_LOG, - ptr->seqnum, - ((tv.tv_sec * 1000 + tv.tv_usec / 1000) - - (ptr->tv_sec * 1000 + ptr->tv_usec / 1000)), - ptr->how_many_sent); - if (ptr->how_many_sent > 9) { - ERRORA("RESEND %.2X, passed %ld ms, sent %d times\n", CELLIAX_P_LOG, - ptr->seqnum, - ((tv.tv_sec * 1000 + tv.tv_usec / 1000) - - (ptr->tv_sec * 1000 + ptr->tv_usec / 1000)), ptr->how_many_sent); - - UNLOCKA(&p->fbus2_outgoing_list_lock); - return -1; - } - - celliax_serial_send_FBUS2(p, ptr->len, ptr->buffer); - if (ptr->buffer[3] == FBUS2_ACK_BYTE) { - if (option_debug > 1) - DEBUGA_FBUS2("RESEND ACK, passed %ld ms, sent %d times\n", CELLIAX_P_LOG, - ((tv.tv_sec * 1000 + tv.tv_usec / 1000) - - (ptr->tv_sec * 1000 + ptr->tv_usec / 1000)), - ptr->how_many_sent); - ptr->acknowledged = 1; - ptr->msg = FBUS2_OUTGOING_ACK; - } - ptr->tv_sec = tv.tv_sec; - ptr->tv_usec = tv.tv_usec; - ptr->sent = 1; - ptr->how_many_sent++; - if (option_debug > 1) { - DEBUGA_FBUS2("OUTGOING list:\n", CELLIAX_P_LOG); - celliax_serial_list_print_FBUS2(p, p->fbus2_outgoing_list); - DEBUGA_FBUS2("OUTGOING list END\n", CELLIAX_P_LOG); - } - - } - } - - UNLOCKA(&p->fbus2_outgoing_list_lock); - POPPA_UNLOCKA(&p->fbus2_outgoing_list_lock); - } - } - if (ptr->sent == 0 && ptr->acknowledged == 0 && ptr->msg > 0) { - - PUSHA_UNLOCKA(&p->fbus2_outgoing_list_lock); - LOKKA(&p->fbus2_outgoing_list_lock); - - if (ptr->sent == 0 && ptr->acknowledged == 0 && ptr->msg > 0) { //retest, maybe has been changed? - - if (option_debug > 1) - DEBUGA_FBUS2("SENDING 1st TIME %.2X\n", CELLIAX_P_LOG, ptr->seqnum); - celliax_serial_send_FBUS2(p, ptr->len, ptr->buffer); - if (ptr->buffer[3] == FBUS2_ACK_BYTE) { - if (option_debug > 1) - DEBUGA_FBUS2("SENDING 1st TIME ACK\n", CELLIAX_P_LOG); - ptr->acknowledged = 1; - ptr->msg = FBUS2_OUTGOING_ACK; - } - ptr->tv_sec = tv.tv_sec; - ptr->tv_usec = tv.tv_usec; - ptr->sent = 1; - ptr->how_many_sent++; - if (option_debug > 1) { - DEBUGA_FBUS2("OUTGOING list:\n", CELLIAX_P_LOG); - celliax_serial_list_print_FBUS2(p, p->fbus2_outgoing_list); - DEBUGA_FBUS2("OUTGOING list END\n", CELLIAX_P_LOG); - } - - } - - UNLOCKA(&p->fbus2_outgoing_list_lock); - POPPA_UNLOCKA(&p->fbus2_outgoing_list_lock); - - } - return 0; -} - -int celliax_serial_write_FBUS2(struct celliax_pvt *p, unsigned char *MsgBuffer, - int MsgLength, unsigned char MsgType) -{ - unsigned char buffer2[FBUS2_MAX_TRANSMIT_LENGTH + 10]; - unsigned char checksum = 0; - int i, len; - struct timeval tv; - struct timezone tz; - - buffer2[0] = FBUS2_SERIAL_FRAME_ID; - buffer2[1] = FBUS2_DEVICE_PHONE; /* destination */ - buffer2[2] = FBUS2_DEVICE_PC; /* source */ - buffer2[3] = MsgType; - buffer2[4] = 0x00; /* required by protocol */ - buffer2[5] = MsgLength; - - memcpy(buffer2 + 6, MsgBuffer, MsgLength); - len = MsgLength + 6; - - /* Odd messages require additional padding 0x00 byte */ - if (MsgLength % 2) - buffer2[len++] = 0x00; /* optional PaddingByte */ - - checksum = 0; - for (i = 0; i < len; i += 2) - checksum ^= buffer2[i]; - buffer2[len++] = checksum; /* ChkSum1 */ - - checksum = 0; - for (i = 1; i < len; i += 2) - checksum ^= buffer2[i]; - buffer2[len++] = checksum; /* ChkSum2 */ - - if (option_debug > 10) { - int i; - char debug_buf[1024]; - char *debug_buf_pos; - - memset(debug_buf, 0, 1024); - debug_buf_pos = debug_buf; - - for (i = 0; i < len; i++) { - debug_buf_pos += sprintf(debug_buf_pos, "[%.2X] ", buffer2[i]); - if (debug_buf_pos > (char *) (&debug_buf + 1000)) - break; - } - if (buffer2[3] == FBUS2_ACK_BYTE) { - DEBUGA_FBUS2("%s to be written, ACK\n", CELLIAX_P_LOG, debug_buf); - } else { - DEBUGA_FBUS2("%s to be written\n", CELLIAX_P_LOG, debug_buf); - } - } - - gettimeofday(&tv, &tz); - - if (buffer2[3] != FBUS2_ACK_BYTE) { - p->fbus2_outgoing_list = celliax_serial_list_init_FBUS2(p); - p->fbus2_outgoing_list->msg = 11; - - p->fbus2_outgoing_list->len = len; - for (i = 0; i < len; i++) { - p->fbus2_outgoing_list->buffer[i] = buffer2[i]; - } - p->fbus2_outgoing_list->seqnum = MsgBuffer[MsgLength - 1]; - if (option_debug > 1) { - DEBUGA_FBUS2("OUTGOING LIST seqnum is %2.X\n", CELLIAX_P_LOG, - MsgBuffer[MsgLength - 1]); - - DEBUGA_FBUS2("OUTGOING list:\n", CELLIAX_P_LOG); - celliax_serial_list_print_FBUS2(p, p->fbus2_outgoing_list); - DEBUGA_FBUS2("OUTGOING list END\n", CELLIAX_P_LOG); - } - } else { - usleep(100); - celliax_serial_send_FBUS2(p, len, buffer2); - } - - return 0; -} - -int celliax_serial_send_ack_FBUS2(struct celliax_pvt *p, unsigned char MsgType, - unsigned char MsgSequence) -{ - unsigned char buffer2[2]; - - buffer2[0] = MsgType; - buffer2[1] = (MsgSequence - FBUS2_SEQNUM_MIN); - - if (option_debug > 1) - DEBUGA_FBUS2("SENDING ACK to %2.X, seqack %2.X \n", CELLIAX_P_LOG, MsgSequence, - (MsgSequence - FBUS2_SEQNUM_MIN)); - /* Sending to phone */ - return celliax_serial_write_FBUS2(p, buffer2, 2, FBUS2_ACK_BYTE); -} - -struct fbus2_msg *celliax_serial_list_init_FBUS2(struct celliax_pvt *p) -{ - struct fbus2_msg *list; - list = p->fbus2_outgoing_list; - - PUSHA_UNLOCKA(&p->fbus2_outgoing_list_lock); - LOKKA(&p->fbus2_outgoing_list_lock); - if (list == NULL) { - list = malloc(sizeof(*(list))); - list->msg = 0; - list->seqnum = 0; - list->len = 0; - list->acknowledged = 0; - list->how_many_sent = 0; - list->sent = 0; - list->tv_sec = 0; - list->tv_usec = 0; - list->next = NULL; - list->previous = NULL; - } - if (list->msg != 0) { - struct fbus2_msg *new; - new = malloc(sizeof(*new)); - new->msg = 0; - new->seqnum = 0; - new->len = 0; - new->acknowledged = 0; - new->how_many_sent = 0; - new->sent = 0; - new->tv_sec = 0; - new->tv_usec = 0; - new->next = NULL; - new->previous = list; - list->next = new; - list = new; - } - UNLOCKA(&p->fbus2_outgoing_list_lock); - POPPA_UNLOCKA(&p->fbus2_outgoing_list_lock); - return list; -} - -int celliax_serial_list_print_FBUS2(struct celliax_pvt *p, struct fbus2_msg *list) -{ - struct fbus2_msg *ptr; - ptr = list; - while (ptr) { - if (option_debug > 3) - DEBUGA_FBUS2 - ("PTR msg is: %d, seqnum is %.2X, tv_sec is %d, tv_usec is %d, acknowledged is: %d," - " sent is:%d, how_many_sent is: %d\n", CELLIAX_P_LOG, ptr->msg, ptr->seqnum, - ptr->tv_sec, ptr->tv_usec, ptr->acknowledged, ptr->sent, ptr->how_many_sent); - ptr = ptr->previous; - } - return 0; -} - -int celliax_serial_read_FBUS2(struct celliax_pvt *p) -{ - int read_count; - int select_err; - fd_set read_fds; - struct timeval timeout; - int fbus_mesg = 0; - int i; - - FD_ZERO(&read_fds); - FD_SET(p->controldevfd, &read_fds); - timeout.tv_sec = 0; - timeout.tv_usec = 50000; - - if ((select_err = select(p->controldevfd + 1, &read_fds, NULL, NULL, &timeout)) > 0) { - timeout.tv_sec = 0; //reset the timeout, linux modify it - timeout.tv_usec = 50000; //reset the timeout, linux modify it - PUSHA_UNLOCKA(&p->controldev_lock); - LOKKA(&p->controldev_lock); - while ((select_err = - select(p->controldevfd + 1, &read_fds, NULL, NULL, &timeout)) > 0) { - gettimeofday(&p->fbus2_list_tv, &p->fbus2_list_tz); - read_count = read(p->controldevfd, p->rxm, 255); - - if (read_count == 0) { - ERRORA - ("read 0 bytes!!! Nenormalno! Marking this celliax_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n", - CELLIAX_P_LOG, p->controldevice_name); - p->controldev_dead = 1; - close(p->controldevfd); - UNLOCKA(&p->controldev_lock); - if (p->owner) { - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - p->owner->hangupcause = AST_CAUSE_FAILURE; - } - return -1; - } - if (option_debug > 10) { - int c; - char debug_buf[1024]; - char *debug_buf_pos; - - memset(debug_buf, 0, 1024); - debug_buf_pos = debug_buf; - for (c = 0; c < read_count; c++) { - debug_buf_pos += sprintf(debug_buf_pos, "[%.2X] ", p->rxm[c]); - if (debug_buf_pos > (char *) (&debug_buf + 1000)) - break; - } - DEBUGA_FBUS2("%s READ AT seconds=%ld usec=%6ld read_count=%d\n", CELLIAX_P_LOG, - debug_buf, p->fbus2_list_tv.tv_sec, p->fbus2_list_tv.tv_usec, - read_count); - } - - for (i = 0; i < read_count; i++) { - if (p->rxm[i] == FBUS2_DEVICE_PHONE && p->rxm[i - 1] == FBUS2_DEVICE_PC - && p->rxm[i - 2] == FBUS2_SERIAL_FRAME_ID) { - /* if we have identified the start of an fbus2 frame sent to us by the phone */ - /* clean the array, copy into it the beginning of the frame, move the counter in the array after the last byte copied */ - memset(p->array, 0, 255); - p->array[0] = FBUS2_SERIAL_FRAME_ID; - p->array[1] = FBUS2_DEVICE_PC; - p->arraycounter = 2; - } - if (p->rxm[i] == FBUS2_SERIAL_FRAME_ID && read_count == 1) { /* quick hack to try to identify the lone char - at the beginning a frame, often returned by - ark3116 based datacables */ - /* if we have identified the start of an fbus2 frame sent to us by the phone */ - /* clean the array, copy into it the beginning of the frame, move the counter in the array after the last byte copied */ - memset(p->array, 0, 255); - p->arraycounter = 0; - } - - /* continue copying into the array, until... */ - p->array[p->arraycounter] = p->rxm[i]; - /* we reach the end of the incoming frame, its lenght is in the p->array[5] byte, plus overhead */ - if (p->arraycounter == p->array[5] + 7) { - /* start categorizing frames */ - int seqnum; - int known = 0; - - /* ACK frames are always of lenght 10, without padding */ - seqnum = p->array[p->arraycounter - 2]; - /* first step in categorizing frames, look at the general kind of frame, in p->array[3] */ - switch (p->array[3]) { -/****************************************************************/ - case FBUS2_ACK_BYTE: - /* this is an ACKnowledgement frame sent to us in reply to an item we sent, take note we were ACKnowledged, no need to resend the item */ - if (option_debug > 1) - DEBUGA_FBUS2("INCOMING ACK, seqack %.2X \n", CELLIAX_P_LOG, seqnum); - if (seqnum == 0x80) { /* reset */ - seqnum = 0x00; - DEBUGA_FBUS2 - ("seqack was 0x80, interpreting as 0x00, first acknowledgement (session begin?) of our first sent item 0x40\n", - CELLIAX_P_LOG); - } - /* an ACK frame has the same seqnum as the item it acknowledge, minus 0x40, so here we obtain the seqnum of the item that has been ACKnowledged */ - fbus_mesg = seqnum + FBUS2_SEQNUM_MIN; - /* take note that the item sent was ACKnowledged, so no need to resend it */ - celliax_serial_list_acknowledge_FBUS2(p, fbus_mesg); - /* this frame has been categorized, bail out from the loop */ - known = 1; - break; -/****************************************************************/ - case FBUS2_TYPE_CALL_DIVERT: - if (option_debug > 1) - DEBUGA_FBUS2("CALL DIVERT SIGNALING seqnum %.2X \n", CELLIAX_P_LOG, seqnum); - fbus_mesg = FBUS2_TYPE_CALL_DIVERT; - /* this signal us that we have some settings in line divert, let's use it as activation of the line when we call */ - if (p->interface_state == AST_STATE_DIALING) { - p->interface_state = AST_STATE_UP; - p->phone_callflow = CALLFLOW_CALL_ACTIVE; - ast_setstate(p->owner, AST_STATE_RINGING); - celliax_queue_control(p->owner, AST_CONTROL_ANSWER); - if (option_debug) - DEBUGA_FBUS2 - ("call is active, I know it's not yet true, but 3310 do not give us remote answer signaling\n", - CELLIAX_P_LOG); - } - /* this frame has been categorized, bail out from the loop */ - known = 1; - break; - -/****************************************************************/ - /* this kind of frames is an answer to "ask model" actions */ - case FBUS2_TYPE_MODEL_ANSWER: - if (1) { - int newline = 0; - int c = i = 0; - unsigned char model[10]; - for (i = 10; i < p->arraycounter; i++) { - if (p->array[i] == '\n') - newline++; - if (newline == 2) { - if (p->array[i] != '\n') { - model[c] = p->array[i]; - c++; - } - } - if (newline == 3) { - break; - } - if (c == 9) - break; - } - model[c] = '\0'; - DEBUGA_FBUS2("FBUS2 PHONE MODEL is: %s, inseqnum %.2X \n", CELLIAX_P_LOG, - model, seqnum); - } - known = 1; - fbus_mesg = FBUS2_TYPE_MODEL_ANSWER; - break; -/****************************************************************/ - /* this kind of frames is an answer to "security enabled" actions */ - case FBUS2_TYPE_SECURITY: - switch (p->array[8]) { - /* this subkind of frames is an answer to "security enabled" CALL actions */ - case FBUS2_SECURIY_CALL_COMMANDS: - switch (p->array[9]) { - /* this sub-subkind of frames tell us that we answered the call */ - case FBUS2_SECURIY_CALL_COMMAND_ANSWER: - p->interface_state = AST_STATE_UP; - p->phone_callflow = CALLFLOW_CALL_ACTIVE; - - /* set the channel state to UP, we've answered */ - if (ast_setstate(p->owner, AST_STATE_UP)) { - ERRORA("ast_setstate failed, BAD\n", CELLIAX_P_LOG); - } - - if (option_debug > 1) - DEBUGA_FBUS2("ANSWERED CALL, inseqnum %.2X \n", CELLIAX_P_LOG, seqnum); - known = 1; - break; - /* this sub-subkind of frames tell us that we released the call */ - case FBUS2_SECURIY_CALL_COMMAND_RELEASE: - p->interface_state = AST_STATE_DOWN; - p->phone_callflow = CALLFLOW_CALL_IDLE; - if (option_debug > 1) - DEBUGA_FBUS2("RELEASED CALL, inseqnum %.2X \n", CELLIAX_P_LOG, seqnum); - fbus_mesg = CALLFLOW_CALL_RELEASED; - known = 1; - break; - } - break; - /* this subkind of frames is an answer to "enable security commands" action */ - case FBUS2_SECURIY_EXTENDED_COMMANDS: - if (option_debug > 1) - DEBUGA_FBUS2("SECURITY EXTENDED COMMANDS ON, inseqnum %.2X \n", - CELLIAX_P_LOG, seqnum); - fbus_mesg = FBUS2_SECURIY_EXTENDED_COMMAND_ON; - known = 1; - break; - /* this subkind of frames is an answer to "get IMEI" action */ - case FBUS2_SECURIY_IMEI_COMMANDS: - if (option_debug > 1) - DEBUGA_FBUS2("CALLFLOW_GOT_IMEI, inseqnum %.2X \n", CELLIAX_P_LOG, - seqnum); - fbus_mesg = CALLFLOW_GOT_IMEI; - known = 1; - break; - } - break; -/****************************************************************/ - /* this kind of frames is about SMSs */ - case FBUS2_TYPE_SMS: - switch (p->array[9]) { - /* this subkind of frames is about an INCOMING SMS */ - case FBUS2_SMS_INCOMING: - if (option_debug > 1) - DEBUGA_FBUS2("SMS, inseqnum %.2X \n", CELLIAX_P_LOG, seqnum); - known = 1; - break; - } - break; -/****************************************************************/ - /* this kind of frames is about PHONE CALLs */ - case FBUS2_TYPE_CALL: - switch (p->array[9]) { - int a; - /* this subkind of frame is about the CALL has been HUNGUP */ - case FBUS2_CALL_HANGUP: - p->interface_state = AST_STATE_DOWN; - p->phone_callflow = CALLFLOW_CALL_IDLE; - if (option_debug > 1) - DEBUGA_FBUS2("REMOTE PARTY HANG UP, inseqnum %.2X \n", CELLIAX_P_LOG, - seqnum); - fbus_mesg = CALLFLOW_INCOMING_HANGUP; - known = 1; - break; - /* this subkind of frame is about the remote CALLID (not signaled by 3310) */ - case FBUS2_CALL_CALLID: - if (option_debug > 1) - DEBUGA_FBUS2("CALLID, inseqnum %.2X \n", CELLIAX_P_LOG, seqnum); - memset(p->callid_name, 0, sizeof(p->callid_name)); - memset(p->callid_number, 0, sizeof(p->callid_number)); - for (a = 0; a < p->array[12]; a++) { - p->callid_number[a] = p->array[12 + a + 1]; - } - for (a = 0; a < p->array[12 + 1 + p->array[12]] + 1; a++) { - p->callid_name[a] = p->array[12 + 1 + a + p->array[12] + 1]; - } - if (option_debug > 1) - DEBUGA_FBUS2("CALLFLOW_INCOMING_CALLID: name is %s, number is %s\n", - CELLIAX_P_LOG, - p->callid_name[0] != 1 ? p->callid_name : "not available", - p->callid_number[0] ? p->callid_number : "not available"); - fbus_mesg = CALLFLOW_INCOMING_CALLID; - p->phone_callflow = CALLFLOW_INCOMING_RING; - p->interface_state = AST_STATE_RING; - known = 1; - break; - } - break; -/****************************************************************/ - /* this kind of frames is about NETWORK STATUS */ - case FBUS2_TYPE_NETWORK_STATUS: - switch (p->array[9]) { - /* this subkind of frames is NETWORK STATUS REGISTERED */ - case FBUS2_NETWORK_STATUS_REGISTERED: - if (option_debug > 1) - DEBUGA_FBUS2("NETWORK STATUS REGISTERED, inseqnum %.2X \n", CELLIAX_P_LOG, - seqnum); - if (p->callid_name[0] == 0 && p->owner - && p->interface_state != AST_STATE_DOWN) { - p->interface_state = AST_STATE_DOWN; - p->phone_callflow = CALLFLOW_CALL_IDLE; - if (option_debug) - NOTICA("We think we are using a nokia3310, so NETWORK STATUS REGISTERED" - " is interpreted as REMOTE PARTY HANG UP during a call, because" - " Nokia 3310 give no hint about remote hangup. Nokia 3310" - " does not signal the CALLID, while other nokias at least put" - " callid_name[0]=1 (also if no callid was transmitted by remote" - " party), we use this lack of CALLID as a sign of 3310nness." - " Outside a call, or when CALLID has been signaled, NETWORK STATUS" - " REGISTERED is ignored.\n", CELLIAX_P_LOG); - fbus_mesg = CALLFLOW_INCOMING_HANGUP; - } - known = 1; - break; - } - break; -/****************************************************************/ - /* this kind of frames is about CALL STATUS */ - case FBUS2_TYPE_CALL_STATUS: - switch (p->array[12]) { - /* this subkind of frames is about CALL STATUS OFF */ - case FBUS2_CALL_STATUS_OFF: - p->interface_state = AST_STATE_DOWN; - p->phone_callflow = CALLFLOW_CALL_IDLE; - if (option_debug > 1) - DEBUGA_FBUS2("STATUS call in progress OFF, inseqnum %.2X \n", - CELLIAX_P_LOG, seqnum); - fbus_mesg = CALLFLOW_INCOMING_HANGUP; - known = 1; - break; - /* this subkind of frames is about CALL STATUS ON */ - case FBUS2_CALL_STATUS_ON: - if (option_debug > 1) - DEBUGA_FBUS2("STATUS call in progress ON, inseqnum %.2X \n", - CELLIAX_P_LOG, seqnum); - known = 1; - break; - } -/****************************************************************/ - break; - } - - /* categorization of frame is ended, if it has not been recognized, whine */ - if (!known) { - WARNINGA("FBUS2 MSG UNKNOWN, inseqnum %.2X\n", CELLIAX_P_LOG, seqnum); - } - - /* let's print our frame */ - if (option_debug > 1) { - int i; - char debug_buf[1024]; - char *debug_buf_pos; - - memset(debug_buf, 0, 1024); - debug_buf_pos = debug_buf; - for (i = 0; i < p->arraycounter + 1; i++) { - debug_buf_pos += sprintf(debug_buf_pos, "[%.2X] ", p->array[i]); - if (debug_buf_pos > (char *) (&debug_buf + 1000)) - break; - } - DEBUGA_FBUS2("%s is the RECEIVED FRAME inseqnum %.2X\n", CELLIAX_P_LOG, - debug_buf, seqnum); - } - - /* if the frame we received is not an ACK frame, let's ACKnowledge it */ - if (p->array[0] == FBUS2_SERIAL_FRAME_ID && p->array[3] != FBUS2_ACK_BYTE) { - celliax_serial_send_ack_FBUS2(p, p->array[3], seqnum); - } - } - p->arraycounter++; - } - } - UNLOCKA(&p->controldev_lock); - POPPA_UNLOCKA(&p->controldev_lock); - } - /* oooops, select returned error, got a kill/cancel or problems with the serial file descriptor */ - if (select_err == -1) { - if (errno != EINTR) { - ERRORA - ("select returned -1 on %s, marking controldev as dead, errno was: %d, error was: %s\n", - CELLIAX_P_LOG, p->controldevice_name, errno, strerror(errno)); - p->controldev_dead = 1; - close(p->controldevfd); - if (p->owner) - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - return -1; - } else { - WARNINGA("select returned -1 on %s, errno was: %d, EINTR, error was: %s\n", - CELLIAX_P_LOG, p->controldevice_name, errno, strerror(errno)); - return 0; - } - } - /* OK, reading done, let's browse the list of pending frames to be sent, and act on it */ - if (celliax_serial_send_if_time_FBUS2(p)) { - ERRORA("celliax_serial_send_if_time_FBUS2 failed!\n", CELLIAX_P_LOG); - return -1; - } - - if (fbus_mesg == CALLFLOW_INCOMING_HANGUP) { - if (p->owner) { - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - DEBUGA_FBUS2("phone call ended\n", CELLIAX_P_LOG); - } - } - - return fbus_mesg; //FIXME breaks the convention of returning 0 on success -} - -#endif /* CELLIAX_FBUS2 */ - -#ifdef CELLIAX_CVM - -int celliax_serial_sync_CVM_BUSMAIL(struct celliax_pvt *p) -{ - usleep(1000); /* 1msec */ - time(&p->celliax_serial_synced_timestamp); - return 0; -} - -int celliax_serial_answer_CVM_BUSMAIL(struct celliax_pvt *p) -{ - if (AST_STATE_RING == p->interface_state) { - DEBUGA_CVM("Sending commands to answer an incomming call...\n", CELLIAX_P_LOG); - celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_CONNECT_REQ, 0, NULL); - - } else { - DEBUGA_CVM - ("SKIPPING Sending commands to answer an incomming call, because: !AST_STATE_RING\n", - CELLIAX_P_LOG); - } - - return 0; -} - -int celliax_serial_call_CVM_BUSMAIL(struct celliax_pvt *p, char *dstr) -{ - unsigned char bCallType = 0x01; /* INTERNAL */ - - unsigned char DialReqBuff[2]; - - celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_SETUP_REQ, sizeof(bCallType), - &bCallType); - - while (AST_STATE_DOWN == p->interface_state) { - usleep(10000); //10msec - } - - if (AST_STATE_DIALING == p->interface_state) { - /* as for now, we only support internal calls */ - /* "0" - call speaker phone */ - /* "1" - call handset #1 */ - /* "2" - call handset #2 */ - /* ... */ - - DialReqBuff[0] = 1; /* number of digits to send */ - DialReqBuff[1] = dstr[0]; /* digit to send */ - - celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_KEYPAD_REQ, 2, DialReqBuff); - } - - if (option_debug) - NOTICA("CVM_BUSMAIL: sent commands to call\n", CELLIAX_P_LOG); - return 0; -} - -int celliax_serial_hangup_CVM_BUSMAIL(struct celliax_pvt *p) -{ - unsigned char bReason = 0x0; /* Normal hang-up */ - - if (p->interface_state != AST_STATE_DOWN) { - celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_RELEASE_REQ, sizeof(bReason), - &bReason); - - DEBUGA_CVM("CVM_BUSMAIL: sent commands to hangup the call\n", CELLIAX_P_LOG); - - } else { - DEBUGA_CVM("CVM_BUSMAIL: sent commands to hangup skipped because: AST_STATE_DOWN\n", - CELLIAX_P_LOG); - } - - return 0; -} - -int celliax_serial_config_CVM_BUSMAIL(struct celliax_pvt *p) -{ - int res; - int how_many_reads = 0; - unsigned char SubcriptionNo = p->cvm_subsc_no; - unsigned char RegistartionData[5]; - - p->cvm_lock_state = CVM_UNKNOWN_LOCK_STATE; - p->cvm_register_state = CVM_UNKNOWN_REGISTER_STATE; - - PUSHA_UNLOCKA(&p->controldev_lock); - CVM_LOKKA(&p->controldev_lock); - - if (option_debug > 1) - DEBUGA_CVM("Try to init communication with CVM...\n", CELLIAX_P_LOG); - - /* CVM after reset sends SABM CTRL frame, let's assume that CVM already sent it, that's the reply... */ - celliax_serial_send_ctrl_frame_CVM_BUSMAIL(p, - BUSMAIL_HEADER_CTRL_FRAME | - BUSMAIL_HEADER_CTRL_UN_FRAME | - BUSMAIL_HEADER_UNID_SABM); - /* usleep(10000); *//* 10ms */ - - /* Now we are sending SABM CTRL frame, if CVM is out there, it should reply... */ - celliax_serial_send_ctrl_frame_CVM_BUSMAIL(p, - BUSMAIL_HEADER_CTRL_FRAME | - BUSMAIL_HEADER_CTRL_UN_FRAME | - BUSMAIL_HEADER_UNID_SABM | - (BUSMAIL_HEADER_PF_BIT_MASK & 0xFF)); -// usleep(1000); - - res = celliax_serial_read_CVM_BUSMAIL(p); //we don't have no monitor neither do_controldev_thread - - DEBUGA_CVM("celliax_serial_read_CVM_BUSMAIL res= %X, expected %X\n", CELLIAX_P_LOG, res, - (BUSMAIL_HEADER_CTRL_FRAME | BUSMAIL_HEADER_CTRL_UN_FRAME | - BUSMAIL_HEADER_SABM)); - - if (res == -1) { - ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG); - CVM_UNLOCKA(&p->controldev_lock); - return -1; - } - - how_many_reads = 0; - - while ((res & 0xF0) != - (BUSMAIL_HEADER_CTRL_FRAME | BUSMAIL_HEADER_CTRL_UN_FRAME | BUSMAIL_HEADER_SABM)) - { - - usleep(1000); - res = celliax_serial_read_CVM_BUSMAIL(p); - how_many_reads++; - - if (res == -1) { - ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG); - CVM_UNLOCKA(&p->controldev_lock); - return -1; - } - - if (how_many_reads > 10) { - ERRORA("no expected results in %d celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG, - how_many_reads); - - ERRORA("Unable to initialize cmmunication with CVM...\n", CELLIAX_P_LOG); - - CVM_UNLOCKA(&p->controldev_lock); - return -1; - } - } - - DEBUGA_CVM("Communication with CVM initialized successfully...\n", CELLIAX_P_LOG); - - DEBUGA_CVM("Attempt to lock to FP...\n", CELLIAX_P_LOG); - - /* Try to connect to FP, try to lock to FP, maybe we registered with it in the past... */ - /* CVM can hold up to 2 subscriptions in its EEPROM, celliax.conf contains number we should try */ - /* eg. cvm_subscription_no = 1 */ - - celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_LOCK_REQ, sizeof(SubcriptionNo), - &SubcriptionNo); - - usleep(10000); - - res = celliax_serial_read_CVM_BUSMAIL(p); //we don't have no monitor neither do_controldev_thread - - if (res == -1) { - ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG); - CVM_UNLOCKA(&p->controldev_lock); - return -1; - } - - how_many_reads = 0; - - while (CVM_UNKNOWN_LOCK_STATE == p->cvm_lock_state) { - -/* - if (0 == (how_many_reads % 10)) - { - DEBUGA_CVM("Attempt to lock to FP... %d\n", CELLIAX_P_LOG, how_many_reads/10 ); - celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_LOCK_REQ, sizeof(SubcriptionNo) ,&SubcriptionNo); - } -*/ - - usleep(100000); - - res = celliax_serial_read_CVM_BUSMAIL(p); - how_many_reads++; - - if (res == -1) { - ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG); - CVM_UNLOCKA(&p->controldev_lock); - return -1; - } - - if (how_many_reads > 50) { - ERRORA("no expected results in %d celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG, - how_many_reads); - - ERRORA("Unable to lock to FP...\n", CELLIAX_P_LOG); - break; - } - } - - if (CVM_LOCKED_TO_FP == p->cvm_lock_state) { - DEBUGA_CVM("CVM locked to FP successfully...\n", CELLIAX_P_LOG); - } else { - DEBUGA_CVM("Lock to FP failed, Attempt to register to FP...\n", CELLIAX_P_LOG); - - RegistartionData[0] = SubcriptionNo; - RegistartionData[1] = 0xFF; - RegistartionData[2] = 0xFF; - - if (1 == SubcriptionNo) { - RegistartionData[3] = - (((p->cvm_subsc_1_pin[3] - 0x30) & 0x0F) << 4) | ((p->cvm_subsc_1_pin[2] - - 0x30) & 0x0F); - RegistartionData[4] = - (((p->cvm_subsc_1_pin[1] - 0x30) & 0x0F) << 4) | ((p->cvm_subsc_1_pin[0] - - 0x30) & 0x0F); - } else { - RegistartionData[3] = - (((p->cvm_subsc_2_pin[3] - 0x30) & 0x0F) << 4) | ((p->cvm_subsc_2_pin[2] - - 0x30) & 0x0F); - RegistartionData[4] = - (((p->cvm_subsc_2_pin[1] - 0x30) & 0x0F) << 4) | ((p->cvm_subsc_2_pin[0] - - 0x30) & 0x0F); - } - - celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_ACCESS_RIGHTS_REQ, - sizeof(RegistartionData), - RegistartionData); - - usleep(100000); - - res = celliax_serial_read_CVM_BUSMAIL(p); //we don't have no monitor neither do_controldev_thread - - if (res == -1) { - ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG); - CVM_UNLOCKA(&p->controldev_lock); - return -1; - } - - how_many_reads = 0; - - while (CVM_UNKNOWN_REGISTER_STATE == p->cvm_register_state) { - - if (0 == (how_many_reads % 50)) { - DEBUGA_CVM("Attempt to register to FP... %d\n", CELLIAX_P_LOG, - how_many_reads / 10); - celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_ACCESS_RIGHTS_REQ, - sizeof(RegistartionData), - RegistartionData); - } - - /* up to 5 minutes for registration.... */ - usleep(1000000); - res = celliax_serial_read_CVM_BUSMAIL(p); - how_many_reads++; - - if (res == -1) { - ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG); - CVM_UNLOCKA(&p->controldev_lock); - return -1; - } - - if (how_many_reads > 300) { - ERRORA("no expected results in %d celliax_serial_read_CVM_BUSMAIL\n", - CELLIAX_P_LOG, how_many_reads); - - ERRORA("Unable to communication with CVM...\n", CELLIAX_P_LOG); - - CVM_UNLOCKA(&p->controldev_lock); - return -1; - } - } - - if (CVM_REGISTERED_TO_FP != p->cvm_register_state) { - ERRORA("Unable to register to FP...\n", CELLIAX_P_LOG); - - CVM_UNLOCKA(&p->controldev_lock); - return -1; - - } else { - DEBUGA_CVM("CVM registered to FP successfully...\n", CELLIAX_P_LOG); - DEBUGA_CVM("Attempt to lock to FP...\n", CELLIAX_P_LOG); - - /* Try to connect to FP, try to lock to FP, maybe we registered with it in the past... */ - /* CVM can hold up to 2 subscriptions in its EEPROM, celliax.conf contains number we should try */ - /* eg. cvm_subscription_no = 1 */ - - celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_LOCK_REQ, - sizeof(SubcriptionNo), &SubcriptionNo); - - usleep(10000); - - res = celliax_serial_read_CVM_BUSMAIL(p); //we don't have no monitor neither do_controldev_thread - - if (res == -1) { - ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG); - CVM_UNLOCKA(&p->controldev_lock); - return -1; - } - - how_many_reads = 0; - - while (CVM_UNKNOWN_LOCK_STATE == p->cvm_lock_state) { - - if (0 == (how_many_reads % 10)) { - DEBUGA_CVM("Attempt to lock to FP... %d\n", CELLIAX_P_LOG, how_many_reads / 10); - celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_ACCESS_RIGHTS_REQ, - sizeof(RegistartionData), - RegistartionData); - } - - usleep(10000); - res = celliax_serial_read_CVM_BUSMAIL(p); - how_many_reads++; - - if (res == -1) { - ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG); - CVM_UNLOCKA(&p->controldev_lock); - return -1; - } - - if (how_many_reads > 100) { - ERRORA("no expected results in %d celliax_serial_read_CVM_BUSMAIL\n", - CELLIAX_P_LOG, how_many_reads); - - ERRORA("Unable to communication with CVM...\n", CELLIAX_P_LOG); - - CVM_UNLOCKA(&p->controldev_lock); - return -1; - } - } - - if (CVM_LOCKED_TO_FP != p->cvm_lock_state) { - ERRORA("Unable to lock to FP...\n", CELLIAX_P_LOG); - - CVM_UNLOCKA(&p->controldev_lock); - return -1; - } else { - DEBUGA_CVM("CVM locked to FP successfully...\n", CELLIAX_P_LOG); - } - } - } - - usleep(100000); - - CVM_UNLOCKA(&p->controldev_lock); - POPPA_UNLOCKA(&p->controldev_lock); - return 0; - -} - -int celliax_serial_read_CVM_BUSMAIL(struct celliax_pvt *p) -{ - int read_count; - int select_err; - fd_set read_fds; - struct timeval timeout; - int cvm_busmail_mesg = 0; - unsigned char busmail_crc = 0; - unsigned char MsgCrc = 0; - unsigned char MsgHeader = 0; - unsigned char MsgTxSeqNo = 0; - unsigned char MsgRxSeqNo = 0; - unsigned char MsgTaskId = 0; - unsigned char MsgProgId = 0; - unsigned char MsgPrimitiveLSB = 0; - unsigned char MsgPrimitiveMSB = 0; - unsigned int MsgPrimitive = 0; - - int i = 0; - - FD_ZERO(&read_fds); - FD_SET(p->controldevfd, &read_fds); - timeout.tv_sec = 0; - timeout.tv_usec = 10000; - - if ((select_err = select(p->controldevfd + 1, &read_fds, NULL, NULL, &timeout)) > 0) { - timeout.tv_sec = 0; //reset the timeout, linux modify it - timeout.tv_usec = 10000; //reset the timeout, linux modify it - PUSHA_UNLOCKA(&p->controldev_lock); - CVM_LOKKA(&p->controldev_lock); - - while ((select_err = - select(p->controldevfd + 1, &read_fds, NULL, NULL, &timeout)) > 0) { - gettimeofday(&p->cvm_busmail_list_tv, &p->cvm_busmail_list_tz); - read_count = read(p->controldevfd, p->rxm, 255); - - if (read_count == 0) { - ERRORA - ("read 0 bytes!!! Nenormalno! Marking this celliax_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the CVM is stuck, switched off or power down.\n", - CELLIAX_P_LOG, p->controldevice_name); - - p->controldev_dead = 1; - close(p->controldevfd); - CVM_UNLOCKA(&p->controldev_lock); - - if (p->owner) - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - return -1; - } - - if (option_debug > 10) { - char debug_buf[1024]; - char *debug_buf_pos; - - memset(debug_buf, 0, 1024); - debug_buf_pos = debug_buf; - for (i = 0; i < read_count; i++) { - debug_buf_pos += sprintf(debug_buf_pos, "[%.2X] ", p->rxm[i]); - if (debug_buf_pos > (char *) (&debug_buf + 1000)) - break; - } - - DEBUGA_CVM("%s READ AT seconds=%ld usec=%6ld read_count=%d\n", CELLIAX_P_LOG, - debug_buf, p->cvm_busmail_list_tv.tv_sec, - p->cvm_busmail_list_tv.tv_usec, read_count); - } - - for (i = 0; i < read_count; i++) { - if (p->rxm[i] == BUSMAIL_SOF) { - /* if we have identified the start of an busmail frame sent to us by the CVM */ - /* clean the array, copy into it the beginning of the frame, move the counter in the array after the last byte copied */ - memset(p->array, 0, 255); - p->array[0] = p->rxm[i]; - p->arraycounter = 1; - } - - /* buffer overload protection */ - if (255 == p->arraycounter) { - p->arraycounter = 1; - } - - /* continue copying into the array, until... */ - p->array[p->arraycounter - 1] = p->rxm[i]; - - /* we reach the end of the incoming frame, its lenght is in the p->array[BUSMAIL_OFFSET_LEN_LSB] byte, plus overhead */ - if (p->arraycounter == p->array[BUSMAIL_OFFSET_LEN_LSB] + 4) { - - tcflush(p->controldevfd, TCIFLUSH); /* PL2303HX bug? */ - /* start categorizing frames */ - - if (option_debug > 10) { - char debug_buf[1024]; - char *debug_buf_pos; - - memset(debug_buf, 0, 1024); - debug_buf_pos = debug_buf; - - for (i = 0; i < p->arraycounter; i++) { - debug_buf_pos += sprintf(debug_buf_pos, "[%.2X] ", p->array[i]); - if (debug_buf_pos > (char *) (&debug_buf + 1000)) - break; - } - - DEBUGA_CVM("%s was received, Starting to categorize this frame\n", - CELLIAX_P_LOG, debug_buf); - } - - int known = 0; - int j = 0; - - busmail_crc = 0; - MsgCrc = p->array[p->arraycounter - 1]; - - busmail_crc = (unsigned char) (p->array[BUSMAIL_OFFSET_HEADER] + busmail_crc); - - for (j = BUSMAIL_OFFSET_MAIL; j < (p->arraycounter - 1); j++) { - busmail_crc = (unsigned char) (p->array[j] + busmail_crc); - } - - if (busmail_crc != MsgCrc) { - WARNINGA("BUSMAIL MSG CRC FAILED!, MsgCrc %.2X, calcd %.2X, dropping frame\n", - CELLIAX_P_LOG, MsgCrc, busmail_crc); - } else { - /* first step in categorizing frames, look at the general kind of frame, in p->array[BUSMAIL_OFFSET_HEADER] */ - if (option_debug > 1) - DEBUGA_CVM("BUSMAIL MSG CRC, MsgCrc %.2X, calcd %.2X...\n", CELLIAX_P_LOG, - MsgCrc, busmail_crc); - - MsgHeader = p->array[BUSMAIL_OFFSET_HEADER]; - cvm_busmail_mesg = MsgHeader; - - switch (MsgHeader & BUSMAIL_HEADER_IC_BIT_MASK) { - case BUSMAIL_HEADER_INFO_FRAME: - /* analyzis of frame header */ - MsgTxSeqNo = ((MsgHeader & BUSMAIL_HEADER_TXSEQ_MASK) >> 4); - MsgRxSeqNo = ((MsgHeader & BUSMAIL_HEADER_RXSEQ_MASK)); - - if (option_debug > 1) - DEBUGA_CVM("BUSMAIL_HEADER_INFO_FRAME TxSeq %X, RxSeq %X\n", - CELLIAX_P_LOG, MsgTxSeqNo, MsgRxSeqNo); - - if (((p->busmail_rxseq_cvm_last + 1) & 0x7) != MsgTxSeqNo) { - /* some CVM frames are missing, TxSeq of this frame is higher then expected */ - /* reject, I expected p->busmail_rxseq_cvm_last + 1, resend it to me, please */ - - WARNINGA("CVM TxSeq %X, does not match expected value %X\n", - CELLIAX_P_LOG, MsgTxSeqNo, - (p->busmail_rxseq_cvm_last + 1) & 0x7); - -// celliax_serial_send_ctrl_frame_CVM_BUSMAIL(p, BUSMAIL_HEADER_CTRL_FRAME | BUSMAIL_HEADER_CTRL_SU_FRAME | BUSMAIL_HEADER_SUID_REJ); - - if (((p->busmail_rxseq_cvm_last) & 0x7) == MsgTxSeqNo) { - - WARNINGA - ("It looks like our ACK to this frame was MIA :), lets ACK the frame one more time...\n", - CELLIAX_P_LOG); - - /* if the frame we received informs us that other side is waiting for ACK, let's ACK it */ - /* even if it is unknown to us */ - if (p->array[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_PF_BIT_MASK) { - if (BUSMAIL_HEADER_SABM == - (p->array[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_SABM_MASK)) { - celliax_serial_send_ctrl_frame_CVM_BUSMAIL(p, (unsigned char) - (BUSMAIL_HEADER_CTRL_FRAME | BUSMAIL_HEADER_CTRL_UN_FRAME | BUSMAIL_HEADER_UNID_SABM)); - } else { - celliax_serial_send_ctrl_frame_CVM_BUSMAIL(p, (unsigned char) - (BUSMAIL_HEADER_CTRL_FRAME | BUSMAIL_HEADER_CTRL_SU_FRAME | BUSMAIL_HEADER_SUID_RR)); - } - } - } - - break; - } else { - /* we expected packet with this seq no. */ - /* CVM ACKed our frames with info frame */ - celliax_serial_list_acknowledge_CVM_BUSMAIL(p, MsgRxSeqNo); - - /* save it but limit it to 3 bits only (valid values: 0-7) */ - p->busmail_rxseq_cvm_last = MsgTxSeqNo; - p->busmail_rxseq_cvm_last &= 0x7; - - /* if the frame we received informs us that other side is waiting for ACK, let's ACK it */ - /* even if it is unknown to us */ - if (p->array[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_PF_BIT_MASK) { - if (BUSMAIL_HEADER_SABM == - (p->array[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_SABM_MASK)) { - celliax_serial_send_ctrl_frame_CVM_BUSMAIL(p, (unsigned char) - (BUSMAIL_HEADER_CTRL_FRAME - | - BUSMAIL_HEADER_CTRL_UN_FRAME - | - BUSMAIL_HEADER_UNID_SABM)); - } else { - celliax_serial_send_ctrl_frame_CVM_BUSMAIL(p, (unsigned char) - (BUSMAIL_HEADER_CTRL_FRAME - | - BUSMAIL_HEADER_CTRL_SU_FRAME - | - BUSMAIL_HEADER_SUID_RR)); - } - } - - } - - /* frame header OK, let's see what's inside mail field */ - MsgTaskId = p->array[BUSMAIL_OFFSET_MAIL_TASK_ID]; - MsgProgId = p->array[BUSMAIL_OFFSET_MAIL_PROGRAM_ID]; - MsgPrimitiveLSB = p->array[BUSMAIL_OFFSET_MAIL_PRIMITIVE_LSB]; - MsgPrimitiveMSB = p->array[BUSMAIL_OFFSET_MAIL_PRIMITIVE_MSB]; - MsgPrimitive = MsgPrimitiveMSB << 8 | MsgPrimitiveLSB; - - if (option_debug > 1) - DEBUGA_CVM - ("BUSMAIL_HEADER_INFO_FRAME ProgId %X, TaskId %X, Primitive %X %X\n", - CELLIAX_P_LOG, MsgProgId, MsgTaskId, MsgPrimitiveMSB, MsgPrimitiveLSB); - - switch (MsgPrimitive) { - - case API_PP_ACCESS_RIGHTS_REJ: - /* FP rejected our registration... */ - WARNINGA("API_PP_ACCESS_RIGHTS_REJ, FP rejected our registration...\n", - CELLIAX_P_LOG); - - p->cvm_register_state = CVM_UNREGISTERED_TO_FP; - p->cvm_lock_state = CVM_UNKNOWN_LOCK_STATE; - known = 1; - break; - - case API_PP_ACCESS_RIGHTS_CFM: - /* FP accepted our registration... */ - if (option_debug > 1) - DEBUGA_CVM - ("API_PP_ACCESS_RIGHTS_CFM, FP accepted our registration...\n", - CELLIAX_P_LOG); - - p->cvm_register_state = CVM_REGISTERED_TO_FP; - p->cvm_lock_state = CVM_UNKNOWN_LOCK_STATE; - p->cvm_handset_no = p->array[BUSMAIL_OFFSET_MAIL_PARAMS + 0]; - p->cvm_fp_is_cvm = p->array[BUSMAIL_OFFSET_MAIL_PARAMS + 1]; - - if (option_debug > 1) - DEBUGA_CVM - ("API_PP_ACCESS_RIGHTS_CFM, FP accepted our registration, Our handset no. is %d, CVM? %X\n", - CELLIAX_P_LOG, p->cvm_handset_no, p->cvm_fp_is_cvm); - - known = 1; - break; - - case API_PP_LOCKED_IND: - /* CVM is connected to FP */ - if (option_debug > 1) - DEBUGA_CVM("API_PP_LOCKED_IND, Connection to FP completed...\n", - CELLIAX_P_LOG); - - p->cvm_register_state = CVM_REGISTERED_TO_FP; - p->cvm_lock_state = CVM_LOCKED_TO_FP; - known = 1; - break; - - case API_PP_UNLOCKED_IND: - /* CVM is unlocked with FP, Out of service */ - WARNINGA - ("API_PP_UNLOCKED_IND, CVM is unlocked with FP, Out of service !!!\n", - CELLIAX_P_LOG); - - p->cvm_lock_state = CVM_UNLOCKED_TO_FP; - known = 1; - break; - - case API_PP_SETUP_ACK_IND: - /* Outgoing call, connection to FP established, FP is waiting for a number to dial */ - if (option_debug > 1) - DEBUGA_CVM - ("API_PP_SETUP_ACK_IND, connection to FP established, FP is waiting for a numer to dial...\n", - CELLIAX_P_LOG); - - if (AST_STATE_DOWN == p->interface_state) { - p->interface_state = AST_STATE_DIALING; - } - - known = 1; - break; - - case API_PP_ALERT_IND: - /* Outgoing call, Remote end is ringing */ - if (option_debug > 1) - DEBUGA_CVM("API_PP_ALERT_IND, remote end is ringing...\n", - CELLIAX_P_LOG); - - if (AST_STATE_DIALING == p->interface_state) { - p->interface_state = AST_STATE_RINGING; - } - - known = 1; - break; - - case API_PP_CONNECT_IND: - /* Outgoing call, the remote end answered our call */ - if (option_debug > 1) - DEBUGA_CVM("API_PP_CONNECT_IND, our call was answered...\n", - CELLIAX_P_LOG); - - if (AST_STATE_RINGING == p->interface_state) { - - /* let's open audio and have a chat */ - celliax_serial_send_info_frame_CVM_BUSMAIL(p, CVM_PP_AUDIO_OPEN_REQ, 0, - NULL); - - unsigned char volume = (unsigned char) p->cvm_volume_level; - celliax_serial_send_info_frame_CVM_BUSMAIL(p, - CVM_PP_AUDIO_SET_VOLUME_REQ, - sizeof(volume), &volume); - - /* let's unmute mic and have a chat */ - celliax_serial_send_info_frame_CVM_BUSMAIL(p, - CVM_PP_AUDIO_UNMUTE_MIC_REQ, - 0, NULL); - - /* let's switch to headset, because we fried normal output.... */ -/* unsigned char headset_on = (unsigned char) 1; - celliax_serial_send_info_frame_CVM_BUSMAIL(p, CVM_PP_AUDIO_HS_PLUG_IND, sizeof(headset_on), &headset_on); -*/ - p->interface_state = AST_STATE_UP; - ast_setstate(p->owner, AST_STATE_RINGING); - celliax_queue_control(p->owner, AST_CONTROL_ANSWER); - } - - known = 1; - break; - - case API_PP_REJECT_IND: - /* Outgoing/Incoming call, FP rejected our connection... */ - if (option_debug > 1) - DEBUGA_CVM - ("API_PP_REJECT_IND, FP or ther PP rejected our connection...\n", - CELLIAX_P_LOG); - - if (AST_STATE_RING == p->interface_state && p->owner) { - /* Attempt to answer incoming call rejected by FP or PP */ - if (option_debug > 1) - DEBUGA_CVM("Was it PAGE_ALL CALL, that we should not answered?\n", - CELLIAX_P_LOG); - - p->interface_state = AST_STATE_DOWN; - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - - } else if (AST_STATE_DOWN != p->interface_state && p->owner) { - /* Outgoing call rejected by other PP or FP */ - p->interface_state = AST_STATE_BUSY; - ast_setstate(p->owner, AST_STATE_BUSY); - celliax_queue_control(p->owner, AST_CONTROL_BUSY); - } - - known = 1; - break; - - case API_PP_SIGNAL_ON_IND: - /* Ringback, ignore it... */ - if (option_debug > 1) - DEBUGA_CVM("API_PP_SIGNAL_ON_IND, Ringback, ignore it...\n", - CELLIAX_P_LOG); - - known = 1; - break; - - case API_PP_SIGNAL_OFF_IND: - /* Ringback, ignore it... */ - if (option_debug > 1) - DEBUGA_CVM("API_PP_SIGNAL_OFF_IND, Ringback, ignore it...\n", - CELLIAX_P_LOG); - - known = 1; - break; - - case API_PP_SETUP_IND: - /* Incoming call, Somebody is calling us */ - - if (option_debug > 1) - DEBUGA_CVM("API_PP_SETUP_IND, somebody is calling us...\n", - CELLIAX_P_LOG); - - if (AST_STATE_DOWN == p->interface_state) { - - if (API_PP_SETUP_IND_CALL_INT == - p->array[BUSMAIL_OFFSET_MAIL_PARAMS + - API_PP_SETUP_IND_CALL_TYPE_OFFSET]) { - DEBUGA_CVM("INTERNAL CALL, receive it...\n", CELLIAX_P_LOG); - - p->interface_state = AST_STATE_RING; - - /* inform calling end, that we know about his call, and that we are alerting */ - celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_ALERT_REQ, 0, - NULL); - - /* let's open audio before valid mac, to remove noise... */ - celliax_serial_send_info_frame_CVM_BUSMAIL(p, - CVM_PP_AUDIO_OPEN_ADPCM_OFF_REQ, - 0, NULL); - - } else { - DEBUGA_CVM("NOT an INTERNAL CALL, CALL TYPE %X, just ignore it...\n", - CELLIAX_P_LOG, - p->array[BUSMAIL_OFFSET_MAIL_PARAMS + - API_PP_SETUP_IND_CALL_TYPE_OFFSET]); - - /* inform calling end, that we know about his call, and that we are alerting OR not :) */ - /* probably it is needed so FP does not remove us from PP list :) */ - celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_ALERT_REQ, 0, - NULL); - } - - } else { - WARNINGA - ("Ignore incoming call, Wrong interface state, current state %X\n", - CELLIAX_P_LOG, p->interface_state); - } - - known = 1; - break; - - case API_PP_ALERT_OFF_IND: - /* Incoming call, We should stop alerting about incoming call... */ - if (option_debug > 1) - DEBUGA_CVM - ("API_PP_ALERT_OFF_IND, Ringback, stop alerting about incoming call...\n", - CELLIAX_P_LOG); - - known = 1; - break; - - case API_PP_ALERT_ON_IND: - /* Incoming call, We should stop alerting about incoming call... */ - if (option_debug > 1) - DEBUGA_CVM - ("API_PP_ALERT_ON_IND, Ringback, start alerting about incoming call...\n", - CELLIAX_P_LOG); -/* - if (AST_STATE_DOWN == p->interface_state) { - DEBUGA_CVM("Somebody is calling us, we see a PP_ALERT_ON_IND, receive it...\n", CELLIAX_P_LOG); - p->interface_state = AST_STATE_RING; - } -*/ - known = 1; - break; - - case API_PP_CONNECT_CFM: - /* Incoming call, Confirmation for request to answer incoming call... */ - if (option_debug > 1) - DEBUGA_CVM - ("API_PP_CONNECT_CFM, Confirmation for request to answer incoming call...\n", - CELLIAX_P_LOG); - - if (AST_STATE_RING == p->interface_state && p->owner) { - - p->interface_state = AST_STATE_UP; - ast_setstate(p->owner, AST_STATE_UP); - - /* let's open audio and have a chat */ -// celliax_serial_send_info_frame_CVM_BUSMAIL(p, CVM_PP_AUDIO_OPEN_ADPCM_OFF_REQ, 0, NULL); - - /* let's open audio and have a chat */ - celliax_serial_send_info_frame_CVM_BUSMAIL(p, CVM_PP_AUDIO_OPEN_REQ, 0, - NULL); - - unsigned char volume = (unsigned char) p->cvm_volume_level; - celliax_serial_send_info_frame_CVM_BUSMAIL(p, - CVM_PP_AUDIO_SET_VOLUME_REQ, - sizeof(volume), &volume); - - /* let's unmute mic and have a chat */ - celliax_serial_send_info_frame_CVM_BUSMAIL(p, - CVM_PP_AUDIO_UNMUTE_MIC_REQ, - 0, NULL); - - /* let's switch to headset, because we fried normal output.... */ -/* unsigned char headset_on = (unsigned char) 1; - celliax_serial_send_info_frame_CVM_BUSMAIL(p, CVM_PP_AUDIO_HS_PLUG_IND, sizeof(headset_on), &headset_on); -*/ - } else { - WARNINGA - ("Ignore connection cfm, Wrong interface state, current state %X\n", - CELLIAX_P_LOG, p->interface_state); - } - - known = 1; - break; - - case API_PP_RELEASE_CFM: - /* Confirmation for request to hangup a call... */ - if (option_debug > 1) - DEBUGA_CVM - ("API_PP_RELEASE_CFM, Confirmation for request to hangup a call..\n", - CELLIAX_P_LOG); - - if (AST_STATE_UP == p->interface_state) { - /* let's close audio */ - celliax_serial_send_info_frame_CVM_BUSMAIL(p, CVM_PP_AUDIO_CLOSE_REQ, 0, - NULL); - - /* let's unmute mic and have a chat */ - celliax_serial_send_info_frame_CVM_BUSMAIL(p, CVM_PP_AUDIO_MUTE_MIC_REQ, - 0, NULL); - } - - p->interface_state = AST_STATE_DOWN; - - known = 1; - break; - - case API_PP_RELEASE_IND: - /* FP releases connection to CVM... */ - if (option_debug > 1) - DEBUGA_CVM("API_PP_RELEASE_IND, FP releases connection to CVM...\n", - CELLIAX_P_LOG); - - if (AST_STATE_UP == p->interface_state && p->owner) { - /* let's close audio */ - celliax_serial_send_info_frame_CVM_BUSMAIL(p, CVM_PP_AUDIO_CLOSE_REQ, 0, - NULL); - p->interface_state = AST_STATE_DOWN; - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - - } else if (AST_STATE_RING == p->interface_state && p->owner) { - /* workaround for PAGE ALL CALL, FIXME!!!! */ - if (option_debug > 1) - DEBUGA_CVM("WAS IT A PAGE ALL ???...\n", CELLIAX_P_LOG); - - p->interface_state = AST_STATE_UP; - usleep(100000); - - p->interface_state = AST_STATE_DOWN; - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - } - - /* we need to ACK release */ - celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_RELEASE_RES, 0, - NULL); - - known = 1; - break; - - case API_PP_READ_RSSI_CFM: - if (option_debug > 1) - DEBUGA_CVM("API_PP_READ_RSSI_CFM, RSSI readout...\n", CELLIAX_P_LOG); - - p->cvm_rssi = p->array[BUSMAIL_OFFSET_MAIL_PARAMS + 0]; - int rssi_percent = p->cvm_rssi * 100 / 0x3F; - if (option_debug > 1) - DEBUGA_CVM("RSSI is %X, %d%%...\n", CELLIAX_P_LOG, p->cvm_rssi, - rssi_percent); - - known = 1; - break; - default: - WARNINGA("UNKNOWN MsgPrimitive!!! %X\n", CELLIAX_P_LOG, MsgPrimitive); - break; - } - - break; - - case BUSMAIL_HEADER_CTRL_FRAME: - if (option_debug > 1) - DEBUGA_CVM("BUSMAIL_HEADER_CTRL_FRAME\n", CELLIAX_P_LOG); - - switch (p->array[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_SU_BIT_MASK) { - case BUSMAIL_HEADER_CTRL_SU_FRAME: - if (option_debug > 1) - DEBUGA_CVM("BUSMAIL_HEADER_CTRL_SU_FRAME\n", CELLIAX_P_LOG); - - switch (p->array[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_SUID_MASK) { - case BUSMAIL_HEADER_SUID_REJ: - /* CVM Reject, CVM missed one of our packets, it will be resend, do nothing */ - MsgRxSeqNo = - ((p->array[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_RXSEQ_MASK)); - - if (option_debug > 1) - DEBUGA_CVM("BUSMAIL_HEADER_SUID_REJ, RxSeq %X\n", CELLIAX_P_LOG, - MsgRxSeqNo); - - /* Even that it is CVM Reject packet, it still ACKs some packets */ - celliax_serial_list_acknowledge_CVM_BUSMAIL(p, MsgRxSeqNo); - - known = 1; - break; - case BUSMAIL_HEADER_SUID_RNR: - /* CVM Receiver Not Ready, answer to packet that we sent, do nothing, it will be resend later */ - MsgRxSeqNo = - ((p->array[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_RXSEQ_MASK)); - - if (option_debug > 1) - DEBUGA_CVM("BUSMAIL_HEADER_SUID_RNR, RxSeq %X\n", CELLIAX_P_LOG, - MsgRxSeqNo); - - known = 1; - break; - case BUSMAIL_HEADER_SUID_RR: - /* CVM ACKs our packets */ - MsgRxSeqNo = - ((p->array[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_RXSEQ_MASK)); - - if (option_debug > 1) - DEBUGA_CVM("BUSMAIL_HEADER_SUID_RR, RxSeq %X\n", CELLIAX_P_LOG, - MsgRxSeqNo); - - /* CVM ACKed our frames with RR frame */ - celliax_serial_list_acknowledge_CVM_BUSMAIL(p, MsgRxSeqNo); - - known = 1; - break; - - default: - WARNINGA("BUSMAIL_HEADER_SUID_UNKNOWN!!!\n", CELLIAX_P_LOG); - break; - } - break; - - case BUSMAIL_HEADER_CTRL_UN_FRAME: - if (option_debug > 1) - DEBUGA_CVM("BUSMAIL_HEADER_CTRL_UN_FRAME\n", CELLIAX_P_LOG); - - switch (p->array[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_UNID_MASK) { - - case BUSMAIL_HEADER_UNID_SABM: - if (option_debug > 1) - DEBUGA_CVM("BUSMAIL_HEADER_UNID_SABM\n", CELLIAX_P_LOG); - /* reset seq counters */ - p->busmail_txseq_celliax_last = 0xFF; - p->busmail_rxseq_cvm_last = 0xFF; - - celliax_serial_lists_free_CVM_BUSMAIL(p); - /* if needed, reply will be send by code at the end of switch statements */ - known = 1; - break; - - default: - WARNINGA("BUSMAIL_HEADER_UNID_UNKNOWN!!!\n", CELLIAX_P_LOG); - break; - } - break; - - default: - WARNINGA("BUSMAIL_HEADER_CTRL_UNKNOWN!!!\n", CELLIAX_P_LOG); - break; - } - break; - - default: - WARNINGA("BUSMAIL_HEADER_UNKNOWN!!!\n", CELLIAX_P_LOG); - break; - } - - } - - /* categorization of frame is ended, if it has not been recognized, whine */ - if (!known) { - WARNINGA("BUSMAIL MSG UNKNOWN or REJECTED!\n", CELLIAX_P_LOG); - } - } - p->arraycounter++; - } - } - CVM_UNLOCKA(&p->controldev_lock); - POPPA_UNLOCKA(&p->controldev_lock); - } - - /* oooops, select returned error, got a kill/cancel or problems with the serial file descriptor */ - if (select_err == -1) { - if (errno != EINTR) { - ERRORA - ("select returned -1 on %s, marking controldev as dead, errno was: %d, error was: %s\n", - CELLIAX_P_LOG, p->controldevice_name, errno, strerror(errno)); - - p->controldev_dead = 1; - close(p->controldevfd); - - if (p->owner) - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - return -1; - - } else { - WARNINGA("select returned -1 on %s, errno was: %d, EINTR, error was: %s\n", - CELLIAX_P_LOG, p->controldevice_name, errno, strerror(errno)); - return 0; - } - } - /* OK, reading done, let's browse the list of pending frames to be sent, and act on it */ - if (celliax_serial_send_if_time_CVM_BUSMAIL(p)) { - ERRORA("celliax_serial_send_if_time_CVM_BUSMAIL failed!\n", CELLIAX_P_LOG); - return -1; - } - - return cvm_busmail_mesg; //FIXME breaks the convention of returning 0 on success -} - -int celliax_serial_getstatus_CVM_BUSMAIL(struct celliax_pvt *p) -{ - int res; - int how_many_reads = 0; - - PUSHA_UNLOCKA(&p->controldev_lock); - CVM_LOKKA(&p->controldev_lock); - - if (option_debug > 1) - DEBUGA_CVM("Sending RR CTRL frame wit PF bit set\n", CELLIAX_P_LOG); - - /* this ctrl frame can be used as low level keep alive */ - celliax_serial_send_ctrl_frame_CVM_BUSMAIL(p, - BUSMAIL_HEADER_CTRL_FRAME | - BUSMAIL_HEADER_CTRL_SU_FRAME | - BUSMAIL_HEADER_SUID_RR | - (BUSMAIL_HEADER_PF_BIT_MASK & 0xFF)); - - //usleep(1000); - - res = celliax_serial_read_CVM_BUSMAIL(p); //we don't have no monitor neither do_controldev_thread - - if (res == -1) { - ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG); - CVM_UNLOCKA(&p->controldev_lock); - return -1; - } - - while ((res & 0xF0) != - (BUSMAIL_HEADER_CTRL_FRAME | BUSMAIL_HEADER_CTRL_SU_FRAME | - BUSMAIL_HEADER_SUID_RR)) { - - usleep(1000); - res = celliax_serial_read_CVM_BUSMAIL(p); - how_many_reads++; - - if (res == -1) { - ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG); - CVM_UNLOCKA(&p->controldev_lock); - return -1; - } - - if (how_many_reads > 10) { - ERRORA("no expected results in %d celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG, - how_many_reads); - CVM_UNLOCKA(&p->controldev_lock); - return -1; - } - } - - //celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_READ_RSSI_REQ, 0, NULL); - - CVM_UNLOCKA(&p->controldev_lock); - POPPA_UNLOCKA(&p->controldev_lock); - - return 0; - -} - -/*! - * \brief Write on the serial port for all the CVM_BUSMAIL functions - * \param p celliax_pvt - * \param len lenght of buffer2 - * \param buffer2 chars to be written - * - * Write on the serial port for all the CVM_BUSMAIL functions - * - * \return the number of chars written on the serial, - * that can be different from len (or negative) in case of errors. - */ -int celliax_serial_send_CVM_BUSMAIL(struct celliax_pvt *p, int len, - unsigned char *mesg_ptr) -{ - int ret; - size_t actual = 0; - unsigned char *mesg_ptr2 = mesg_ptr; - PUSHA_UNLOCKA(&p->controldev_lock); - CVM_LOKKA(&p->controldev_lock); - do { - ret = write(p->controldevfd, mesg_ptr, len - actual); - if (ret < 0 && errno == EAGAIN) - continue; - if (ret < 0) { - if (actual != len) - ERRORA("celliax_serial_write error: %s", CELLIAX_P_LOG, strerror(errno)); - CVM_UNLOCKA(&p->controldev_lock); - return -1; - } - actual += ret; - mesg_ptr += ret; - usleep(10000); -// usleep(p->cvm_celliax_serial_delay*1000); - } while (actual < len); - - usleep(p->cvm_celliax_serial_delay * 1000); - -// tcdrain(p->controldevfd); - - CVM_UNLOCKA(&p->controldev_lock); - POPPA_UNLOCKA(&p->controldev_lock); - - if (option_debug > 10) { - int i; - char debug_buf[1024]; - char *debug_buf_pos; - - memset(debug_buf, 0, 1024); - debug_buf_pos = debug_buf; - - for (i = 0; i < len; i++) { - debug_buf_pos += sprintf(debug_buf_pos, "[%.2X] ", mesg_ptr2[i]); - if (debug_buf_pos > ((char *) &debug_buf + 1000)) - break; - } - DEBUGA_CVM("%s was sent down the wire\n", CELLIAX_P_LOG, debug_buf); - } - - return 0; -} - -/*! - * \brief Flags as acknowledged an BUSMAIL message previously sent - * \param p celliax_pvt - * \param seqnum identifier of the message to be acknowledged - * - * Called upon receiving an BUSMAIL acknoledgement message, browse the cvm_busmail_outgoing_list - * looking for the seqnum sent BUSMAIL message, and flags it as acknowledged. - * (if an outgoing BUSMAIL message is not aknowledged by the cellphone in a while, - * it will be retransmitted) - * - * \return 0 on error, 1 otherwise - */ -int celliax_serial_list_acknowledge_CVM_BUSMAIL(struct celliax_pvt *p, - unsigned char AckTxSeqNo) -{ - struct cvm_busmail_msg *ptr = NULL; - struct cvm_busmail_msg *old = NULL; - - unsigned char MsgTxSeqNo; - unsigned char MsgRxSeqNo; - - ptr = p->cvm_busmail_outgoing_list; - - if (ptr == NULL) { - ERRORA("cvm_busmail_outgoing_list is NULL ?\n", CELLIAX_P_LOG); - return -1; - } - - PUSHA_UNLOCKA(&p->cvm_busmail_outgoing_list_lock); - CVM_LOKKA(&p->cvm_busmail_outgoing_list_lock); -/* - DEBUGA_CVM("PREFREE OUTGOING list:\n", CELLIAX_P_LOG); - celliax_serial_list_print_CVM_BUSMAIL(p, p->cvm_busmail_outgoing_list); -*/ - while (ptr->next != NULL) - ptr = ptr->next; - - while (ptr) { - - if ((1 == ptr->valid) && (0 == ptr->acknowledged) && (0 != ptr->sent)) { - MsgTxSeqNo = - ((ptr->busmail_msg_buffer[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_TXSEQ_MASK) >> - 4); - MsgRxSeqNo = - ((ptr->busmail_msg_buffer[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_RXSEQ_MASK)); - -/* - if (option_debug > 1) - DEBUGA_CVM("OUTGOING LIST TxSeq is %X, RxSeq is %X\n", CELLIAX_P_LOG, MsgTxSeqNo, MsgRxSeqNo); -*/ - unsigned char TxToAck = 0; - - if (0 == AckTxSeqNo) { - TxToAck = 7; - } else { - TxToAck = AckTxSeqNo - 1; - } - - if (MsgTxSeqNo <= TxToAck) { - - if (option_debug > 1) - DEBUGA_CVM("Msg with TxSeq=%X ACKed with CvmRxSeq=%X\n", CELLIAX_P_LOG, - MsgTxSeqNo, AckTxSeqNo); - - old = ptr; - old->acknowledged = 1; - old->valid = 0; - ptr = old->previous; - - if (old->previous) { - if (old->next) { - old->previous->next = old->next; - } else { - old->previous->next = NULL; - } - } - - if (old->next) { - if (old->previous) { - old->next->previous = old->previous; - } else { - old->next->previous = NULL; - } - } - - if ((NULL == old->next) && (NULL == old->previous)) { - if (option_debug > 1) { - DEBUGA_CVM("FREEING LAST\n", CELLIAX_P_LOG); - } - - p->cvm_busmail_outgoing_list = NULL; - p->cvm_busmail_outgoing_list = celliax_serial_list_init_CVM_BUSMAIL(p); - } - -/* - if (option_debug > 1) - DEBUGA_CVM("FREEING TxSeq is %X, RxSeq is %X\n", CELLIAX_P_LOG, MsgTxSeqNo, MsgRxSeqNo); -*/ - - free(old); - - } else { - ptr = ptr->previous; - } - - } else { - ptr = ptr->previous; - } - } - -/* - DEBUGA_CVM("POSTFREE OUTGOING list:\n", CELLIAX_P_LOG); - celliax_serial_list_print_CVM_BUSMAIL(p, p->cvm_busmail_outgoing_list); -*/ - - CVM_UNLOCKA(&p->cvm_busmail_outgoing_list_lock); - POPPA_UNLOCKA(&p->cvm_busmail_outgoing_list_lock); - return 0; -} - -/*! - * \brief Sends an FBUS2 message or resends it if it was not acknowledged - * \param p celliax_pvt - * - * Called by celliax_serial_read_CVM_BUSMAIL, browse the fbus2_outgoing_list looking for FBUS2 messages to be sent, - * or for FBUS2 messages previously sent but not yet acknoledged. - * (if an outgoing FBUS2 message is not aknowledged by the cellphone in a while, - * it will be retransmitted) - * - * \return 0 on error, 1 otherwise - */ -int celliax_serial_send_if_time_CVM_BUSMAIL(struct celliax_pvt *p) -{ - struct cvm_busmail_msg *ptr; - struct timeval tv; - struct timezone tz; - - gettimeofday(&tv, &tz); - ptr = p->cvm_busmail_outgoing_list; - - if (ptr == NULL) { -/* ERRORA("cvm_busmail_outgoing_list is NULL ?\n", CELLIAX_P_LOG); */ - WARNINGA("cvm_busmail_outgoing_list is NULL, nothing to send...\n", CELLIAX_P_LOG); - -/* return -1; */ - return 0; - - } - - while (ptr->next != NULL) { - WARNINGA("cvm_busmail_outgoing_list->next is not null ?\n", CELLIAX_P_LOG); - ptr = ptr->next; //FIXME what to do? - } - - while (ptr->sent == 0 && ptr->acknowledged == 0) { - if (ptr->previous != NULL) { - ptr = ptr->previous; - } else - break; - } - - while (ptr->sent == 1 && ptr->acknowledged == 0) { - if (ptr->previous != NULL) { - ptr = ptr->previous; - } else - break; - } - - if (ptr->sent == 1 && ptr->acknowledged == 1) { - if (ptr->next != NULL) { - ptr = ptr->next; - } - } - - if (ptr->sent == 1 && ptr->acknowledged == 0 && ptr->valid == 1) { - if ((tv.tv_sec * 1000 + tv.tv_usec / 1000) > - ((ptr->tv_sec * 1000 + ptr->tv_usec / 1000) + 1000)) { - - PUSHA_UNLOCKA(&p->cvm_busmail_outgoing_list_lock); - CVM_LOKKA(&p->cvm_busmail_outgoing_list_lock); - - if (ptr->sent == 1 && ptr->acknowledged == 0 && ptr->valid == 1) { //retest, maybe has been changed? - if ((tv.tv_sec * 1000 + tv.tv_usec / 1000) > ((ptr->tv_sec * 1000 + ptr->tv_usec / 1000) + 1000)) { //retest, maybe has been changed? - - if (option_debug > 1) - DEBUGA_CVM("RESEND TxSeq=%X, passed %ld ms, sent %d times\n", CELLIAX_P_LOG, - ptr->txseqno, - ((tv.tv_sec * 1000 + tv.tv_usec / 1000) - - (ptr->tv_sec * 1000 + ptr->tv_usec / 1000)), ptr->how_many_sent); - - if (ptr->how_many_sent > 9) { - ERRORA("RESEND TxSeq=%X, passed %ld ms, sent %d times\n", CELLIAX_P_LOG, - ptr->txseqno, - ((tv.tv_sec * 1000 + tv.tv_usec / 1000) - - (ptr->tv_sec * 1000 + ptr->tv_usec / 1000)), ptr->how_many_sent); - - CVM_UNLOCKA(&p->cvm_busmail_outgoing_list_lock); - return -1; - } - - celliax_serial_send_CVM_BUSMAIL(p, ptr->busmail_msg_len, - ptr->busmail_msg_buffer); - - ptr->tv_sec = tv.tv_sec; - ptr->tv_usec = tv.tv_usec; - ptr->sent = 1; - ptr->how_many_sent++; -/* - if (option_debug > 1) { - DEBUGA_CVM("OUTGOING list:\n", CELLIAX_P_LOG); - celliax_serial_list_print_CVM_BUSMAIL(p, p->cvm_busmail_outgoing_list); - DEBUGA_CVM("OUTGOING list END\n", CELLIAX_P_LOG); - } -*/ - } - } - - CVM_UNLOCKA(&p->cvm_busmail_outgoing_list_lock); - POPPA_UNLOCKA(&p->cvm_busmail_outgoing_list_lock); - } - } - - if (ptr->sent == 0 && ptr->acknowledged == 0 && ptr->valid == 1) { - - PUSHA_UNLOCKA(&p->cvm_busmail_outgoing_list_lock); - CVM_LOKKA(&p->cvm_busmail_outgoing_list_lock); - - if (ptr->sent == 0 && ptr->acknowledged == 0 && ptr->valid == 1) { //retest, maybe has been changed? - - if (option_debug > 1) - DEBUGA_CVM("SENDING 1st TIME TxSeq=%X\n", CELLIAX_P_LOG, ptr->txseqno); - - celliax_serial_send_CVM_BUSMAIL(p, ptr->busmail_msg_len, ptr->busmail_msg_buffer); - - ptr->tv_sec = tv.tv_sec; - ptr->tv_usec = tv.tv_usec; - ptr->sent = 1; - ptr->how_many_sent++; -/* - if (option_debug > 1) { - DEBUGA_CVM("OUTGOING list:\n", CELLIAX_P_LOG); - celliax_serial_list_print_CVM_BUSMAIL(p, p->cvm_busmail_outgoing_list); - DEBUGA_CVM("OUTGOING list END\n", CELLIAX_P_LOG); - } -*/ - } - - CVM_UNLOCKA(&p->cvm_busmail_outgoing_list_lock); - POPPA_UNLOCKA(&p->cvm_busmail_outgoing_list_lock); - - } - return 0; -} - -int celliax_serial_write_CVM_BUSMAIL(struct celliax_pvt *p, - struct cvm_busmail_frame *busmail_frame) -{ - unsigned char buffer2[BUSMAIL_MAX_FRAME_LENGTH]; - int i = 0; - int len = 0; - unsigned int busmail_len_total = 0; - - busmail_frame->busmail_sof = BUSMAIL_SOF; - busmail_frame->busmail_crc = 0; - -/* because of Rx Tx SEQ HEADER fields problem, update when these fields are filled with correct data - busmail_frame->busmail_crc = (unsigned char)(busmail_frame->busmail_header + busmail_frame->busmail_crc); -*/ - - buffer2[BUSMAIL_OFFSET_SOF] = busmail_frame->busmail_sof; - buffer2[BUSMAIL_OFFSET_HEADER] = busmail_frame->busmail_header; - - if ((buffer2[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_IC_BIT_MASK) == - BUSMAIL_HEADER_INFO_FRAME) { - len = - BUSMAIL_OFFSET_MAIL_PARAMS + busmail_frame->busmail_mail_params_buffer_len + - sizeof(busmail_frame->busmail_crc); - busmail_len_total = - busmail_frame->busmail_mail_params_buffer_len + - sizeof(busmail_frame->busmail_header) - + sizeof(busmail_frame->busmail_mail_program_id) + - sizeof(busmail_frame->busmail_mail_task_id) + 2; - - if (option_debug > 1) - DEBUGA_CVM("INFO frame to send\n", CELLIAX_P_LOG); - - buffer2[BUSMAIL_OFFSET_MAIL_PROGRAM_ID] = busmail_frame->busmail_mail_program_id; - buffer2[BUSMAIL_OFFSET_MAIL_TASK_ID] = busmail_frame->busmail_mail_task_id; - buffer2[BUSMAIL_OFFSET_MAIL_PRIMITIVE_LSB] = - busmail_frame->busmail_mail_primitive[BUSMAIL_MAIL_PRIMITIVE_LSB]; - buffer2[BUSMAIL_OFFSET_MAIL_PRIMITIVE_MSB] = - busmail_frame->busmail_mail_primitive[BUSMAIL_MAIL_PRIMITIVE_MSB]; - - if (busmail_frame->busmail_mail_params_buffer_len) { - memcpy(buffer2 + BUSMAIL_OFFSET_MAIL_PARAMS, - busmail_frame->busmail_mail_params_buffer, - busmail_frame->busmail_mail_params_buffer_len); - } - - for (i = 0; i < busmail_frame->busmail_mail_params_buffer_len; i++) { - busmail_frame->busmail_crc = - (unsigned char) (busmail_frame->busmail_mail_params_buffer[i] + - busmail_frame->busmail_crc); - } - - busmail_frame->busmail_crc += busmail_frame->busmail_mail_program_id; - busmail_frame->busmail_crc += busmail_frame->busmail_mail_task_id; - busmail_frame->busmail_crc += - busmail_frame->busmail_mail_primitive[BUSMAIL_MAIL_PRIMITIVE_LSB]; - busmail_frame->busmail_crc += - busmail_frame->busmail_mail_primitive[BUSMAIL_MAIL_PRIMITIVE_MSB]; - } else { - busmail_len_total = sizeof(busmail_frame->busmail_header); - len = BUSMAIL_OFFSET_MAIL + sizeof(busmail_frame->busmail_crc); - - if (option_debug > 1) - DEBUGA_CVM("CTRL frame to send\n", CELLIAX_P_LOG); - } - -/* - DEBUGA_CVM("Its len=%d\n", CELLIAX_P_LOG, len); -*/ - - busmail_frame->busmail_len[BUSMAIL_LEN_LSB] = - (unsigned char) (busmail_len_total & 0xFF); - busmail_frame->busmail_len[BUSMAIL_LEN_MSB] = (unsigned char) (busmail_len_total >> 8); - buffer2[BUSMAIL_OFFSET_LEN_MSB] = busmail_frame->busmail_len[BUSMAIL_LEN_MSB]; - buffer2[BUSMAIL_OFFSET_LEN_LSB] = busmail_frame->busmail_len[BUSMAIL_LEN_LSB]; - -/* - buffer2[len-1] = busmail_frame->busmail_crc; -*/ - buffer2[len - 1] = 0xFF; - - if ((buffer2[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_IC_BIT_MASK) == - BUSMAIL_HEADER_INFO_FRAME) { - /* if it is INFO frame, queue it */ - - /* update TxSeq and RxSeq bits */ - /* clear TxSeq and RxSeq bits */ - buffer2[BUSMAIL_OFFSET_HEADER] &= - ~(BUSMAIL_HEADER_RXSEQ_MASK | BUSMAIL_HEADER_TXSEQ_MASK); - - buffer2[BUSMAIL_OFFSET_HEADER] |= - (p->busmail_rxseq_cvm_last + 1) & BUSMAIL_HEADER_RXSEQ_MASK; - - p->busmail_txseq_celliax_last++; - p->busmail_txseq_celliax_last &= 0x07; - - buffer2[BUSMAIL_OFFSET_HEADER] |= - ((p->busmail_txseq_celliax_last) << 4) & BUSMAIL_HEADER_TXSEQ_MASK; - - /* update CRC */ - busmail_frame->busmail_crc += buffer2[BUSMAIL_OFFSET_HEADER]; - buffer2[len - 1] = busmail_frame->busmail_crc; - - p->cvm_busmail_outgoing_list = celliax_serial_list_init_CVM_BUSMAIL(p); - p->cvm_busmail_outgoing_list->busmail_msg_len = len; - - for (i = 0; i < len; i++) { - p->cvm_busmail_outgoing_list->busmail_msg_buffer[i] = buffer2[i]; - } - - if (option_debug > 10) { - char debug_buf[1024]; - char *debug_buf_pos; - - memset(debug_buf, 0, 1024); - debug_buf_pos = debug_buf; - - for (i = 0; i < len; i++) { - debug_buf_pos += sprintf(debug_buf_pos, "[%.2X] ", buffer2[i]); - if (debug_buf_pos > (char *) (&debug_buf + 1000)) - break; - } - - if (option_debug > 1) - DEBUGA_CVM("INFO: %s was prepared to send\n", CELLIAX_P_LOG, debug_buf); - } - - if (option_debug > 1) { - DEBUGA_CVM("OUTGOING INFO Frame TxSeq is %X, RxSeq is %X\n", CELLIAX_P_LOG, - (buffer2[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_TXSEQ_MASK) >> 4, - buffer2[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_RXSEQ_MASK); -/* - DEBUGA_CVM("OUTGOING list:\n", CELLIAX_P_LOG); - celliax_serial_list_print_CVM_BUSMAIL(p, p->cvm_busmail_outgoing_list); - DEBUGA_CVM("OUTGOING list END\n", CELLIAX_P_LOG); */ - } - p->cvm_busmail_outgoing_list->txseqno = - (unsigned char) (buffer2[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_TXSEQ_MASK) >> 4; - p->cvm_busmail_outgoing_list->valid = 1; /* ready to send (?) */ - - } else { - /* if it is CTRL frame, send it straight to the wire */ - if (BUSMAIL_HEADER_SABM != - (buffer2[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_SABM_MASK)) { - /*SABM ctrl frames have no RxSeq bits */ - - buffer2[BUSMAIL_OFFSET_HEADER] &= ~BUSMAIL_HEADER_RXSEQ_MASK; - - if (BUSMAIL_HEADER_REJ == - (buffer2[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_REJ_MASK)) { - - if (option_debug > 1) - DEBUGA_CVM("CTRL REJ frame...\n", CELLIAX_P_LOG); - - if (0xFF != p->busmail_rxseq_cvm_last) { - buffer2[BUSMAIL_OFFSET_HEADER] |= - (p->busmail_rxseq_cvm_last + 1) & BUSMAIL_HEADER_RXSEQ_MASK; - } else { - if (option_debug > 1) - DEBUGA_CVM - ("Skipping sending REJ, because we just cleared RxSeq counter, and probably it was a packet that is invalid now...\n", - CELLIAX_P_LOG); - return 0; - } - - } else { - buffer2[BUSMAIL_OFFSET_HEADER] |= - (p->busmail_rxseq_cvm_last + 1) & BUSMAIL_HEADER_RXSEQ_MASK; - } - } - - /* update CRC */ - busmail_frame->busmail_crc += buffer2[BUSMAIL_OFFSET_HEADER]; - buffer2[len - 1] = busmail_frame->busmail_crc; - - if (option_debug > 10) { - char debug_buf[1024]; - char *debug_buf_pos; - - memset(debug_buf, 0, 1024); - debug_buf_pos = debug_buf; - - for (i = 0; i < len; i++) { - debug_buf_pos += sprintf(debug_buf_pos, "[%.2X] ", buffer2[i]); - if (debug_buf_pos > (char *) (&debug_buf + 1000)) - break; - } - - if (option_debug > 1) - DEBUGA_CVM("CTRL: %s was prepared to send\n", CELLIAX_P_LOG, debug_buf); - } -// usleep(100); - celliax_serial_send_CVM_BUSMAIL(p, len, buffer2); - } - - return 0; -} - -int celliax_serial_send_ctrl_frame_CVM_BUSMAIL(struct celliax_pvt *p, - unsigned char FrameType) -{ - /*FrameType parameter is really a busmail header with info neeeded to tell the frame type to send */ - struct cvm_busmail_frame busmail_frame; - - switch (FrameType & 0xF0) { - /* only higher nibble is important for us, do not take PF bit into considration */ - - case BUSMAIL_HEADER_CTRL_FRAME | BUSMAIL_HEADER_CTRL_SU_FRAME | BUSMAIL_HEADER_SUID_RR: - case BUSMAIL_HEADER_CTRL_FRAME | BUSMAIL_HEADER_CTRL_SU_FRAME | BUSMAIL_HEADER_SUID_REJ: - case BUSMAIL_HEADER_CTRL_FRAME | BUSMAIL_HEADER_CTRL_SU_FRAME | BUSMAIL_HEADER_SUID_RNR: - case BUSMAIL_HEADER_CTRL_FRAME | BUSMAIL_HEADER_CTRL_UN_FRAME | BUSMAIL_HEADER_UNID_SABM: - - busmail_frame.busmail_header = - (FrameType & 0xF8); - - break; - - default: - WARNINGA("UNKNOWN CTRL TYPE specified, sending nothing!!!\n", CELLIAX_P_LOG); - return -1; - break; - } - - busmail_frame.busmail_mail_params_buffer_len = 0; - - /* Sending to CVM */ - return celliax_serial_write_CVM_BUSMAIL(p, &busmail_frame); -} - -int celliax_serial_send_info_frame_CVM_BUSMAIL(struct celliax_pvt *p, int FrameType, - unsigned char ParamsLen, - unsigned char *Params) -{ - /*FrameType parameter is really a Primitive ID */ - struct cvm_busmail_frame busmail_frame; - int i = 0; - busmail_frame.busmail_header = - (BUSMAIL_HEADER_PF_BIT_MASK & 0xFF) | BUSMAIL_HEADER_INFO_FRAME; - - busmail_frame.busmail_mail_primitive[BUSMAIL_MAIL_PRIMITIVE_LSB] = FrameType & 0xFF; - busmail_frame.busmail_mail_primitive[BUSMAIL_MAIL_PRIMITIVE_MSB] = - (FrameType >> 8) & 0xFF; - - busmail_frame.busmail_mail_program_id = BUSMAIL_MAIL_PROGRAM_ID; - busmail_frame.busmail_mail_task_id = BUSMAIL_MAIL_TASK_ID; - - for (i = 0; i < ParamsLen; i++) { - busmail_frame.busmail_mail_params_buffer[i] = Params[i]; - } - - busmail_frame.busmail_mail_params_buffer_len = ParamsLen; - - /* Sending to CVM */ - return celliax_serial_write_CVM_BUSMAIL(p, &busmail_frame); -} - -int celliax_serial_lists_free_CVM_BUSMAIL(struct celliax_pvt *p) -{ - struct cvm_busmail_msg *ptr, *prev; -/* - if (option_debug > 1) { - DEBUGA_CVM("START FREEING OUTGOING\n", CELLIAX_P_LOG); - DEBUGA_CVM("OUTGOING list:\n", CELLIAX_P_LOG); - celliax_serial_list_print_CVM_BUSMAIL(p, p->cvm_busmail_outgoing_list); - DEBUGA_CVM("OUTGOING list END\n", CELLIAX_P_LOG); - } -*/ - ptr = p->cvm_busmail_outgoing_list; - - if (ptr) { - while (ptr->next != NULL) - ptr = ptr->next; - - while (ptr->previous != NULL) { - - if (option_debug > 1) - DEBUGA_CVM("FREED \n", CELLIAX_P_LOG); - - prev = ptr->previous; - free(ptr); - ptr = prev; - } - - free(ptr); - } - - if (option_debug > 1) - DEBUGA_CVM("LAST FREED \n", CELLIAX_P_LOG); - - p->cvm_busmail_outgoing_list = NULL; - p->cvm_busmail_outgoing_list = celliax_serial_list_init_CVM_BUSMAIL(p); - - if (option_debug > 1) { - DEBUGA_CVM("OUTGOING list:\n", CELLIAX_P_LOG); - celliax_serial_list_print_CVM_BUSMAIL(p, p->cvm_busmail_outgoing_list); - DEBUGA_CVM("OUTGOING list END\n", CELLIAX_P_LOG); - DEBUGA_CVM("STARTING FREE INGOING\n", CELLIAX_P_LOG); - } - - return 0; -} - -struct cvm_busmail_msg *celliax_serial_list_init_CVM_BUSMAIL(struct celliax_pvt *p) -{ - struct cvm_busmail_msg *list; - list = p->cvm_busmail_outgoing_list; - - PUSHA_UNLOCKA(&p->cvm_busmail_outgoing_list_lock); - CVM_LOKKA(&p->cvm_busmail_outgoing_list_lock); - - if (list == NULL) { - list = malloc(sizeof(*(list))); - list->valid = 0; - list->busmail_msg_len = 0; - list->acknowledged = 0; - list->how_many_sent = 0; - list->sent = 0; - list->tv_sec = 0; - list->tv_usec = 0; - list->next = NULL; - list->previous = NULL; - } - - if (list->valid != 0) { - struct cvm_busmail_msg *new; - new = malloc(sizeof(*new)); - new->valid = 0; - new->busmail_msg_len = 0; - new->acknowledged = 0; - new->how_many_sent = 0; - new->sent = 0; - new->tv_sec = 0; - new->tv_usec = 0; - new->next = NULL; - new->previous = list; - list->next = new; - list = new; - } - - CVM_UNLOCKA(&p->cvm_busmail_outgoing_list_lock); - POPPA_UNLOCKA(&p->cvm_busmail_outgoing_list_lock); - - return list; -} - -int celliax_serial_list_print_CVM_BUSMAIL(struct celliax_pvt *p, - struct cvm_busmail_msg *list) -{ - struct cvm_busmail_msg *ptr; - ptr = list; - - if (ptr) { - while (ptr->next != NULL) - ptr = ptr->next; - - while (ptr) { - - if (option_debug > 3) - DEBUGA_CVM - ("PTR msg is: %d, seqnum is %.2X, tv_sec is %d, tv_usec is %d, acknowledged is: %d," - " sent is:%d, how_many_sent is: %d\n", CELLIAX_P_LOG, ptr->valid, - /*ptr->seqnum */ 44, - ptr->tv_sec, ptr->tv_usec, ptr->acknowledged, ptr->sent, ptr->how_many_sent); - - ptr = ptr->previous; - } - } - - return 0; -} - -#endif /* CELLIAX_CVM */ diff --git a/src/mod/endpoints/mod_gsmopen/asterisk/celliax_libcsv.c b/src/mod/endpoints/mod_gsmopen/asterisk/celliax_libcsv.c deleted file mode 100644 index 6b5dc3fe4b..0000000000 --- a/src/mod/endpoints/mod_gsmopen/asterisk/celliax_libcsv.c +++ /dev/null @@ -1,356 +0,0 @@ -/* -libcsv - parse and write csv data -Copyright (C) 2007 Robert Gamble - -This library 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.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#if ___STDC_VERSION__ >= 199901L -# include -#else -# define SIZE_MAX ((size_t)-1) /* C89 doesn't have stdint.h or SIZE_MAX */ -#endif - -#include "celliax_libcsv.h" - -#define VERSION "1.0.0" - -#define ROW_NOT_BEGUN 0 -#define FIELD_NOT_BEGUN 1 -#define FIELD_BEGUN 2 -#define FIELD_MIGHT_HAVE_ENDED 3 - -/* - Explanation of states - ROW_NOT_BEGUN There have not been any fields encountered for this row - FIELD_NOT_BEGUN There have been fields but we are currently not in one - FIELD_BEGUN We are in a field - FIELD_MIGHT_HAVE_ENDED - We encountered a double quote inside a quoted field, the - field is either ended or the quote is literal -*/ - -#define MEM_BLK_SIZE 128 - -#define SUBMIT_FIELD(p) \ - do { \ - if (!(p)->quoted) \ - (p)->entry_pos -= (p)->spaces; \ - if (cb1) \ - cb1(p->entry_buf, (p)->entry_pos, data); \ - (p)->pstate = FIELD_NOT_BEGUN; \ - (p)->entry_pos = (p)->quoted = (p)->spaces = 0; \ - } while (0) - -#define SUBMIT_ROW(p, c) \ - do { \ - if (cb2) \ - cb2(c, data); \ - (p)->pstate = ROW_NOT_BEGUN; \ - (p)->entry_pos = (p)->quoted = (p)->spaces = 0; \ - } while (0) - -#define SUBMIT_CHAR(p, c) ((p)->entry_buf[(p)->entry_pos++] = (c)) - -static char *csv_errors[] = {"success", - "error parsing data while strict checking enabled", - "memory exhausted while increasing buffer size", - "data size too large", - "invalid status code"}; - -int -csv_error(struct csv_parser *p) -{ - return p->status; -} - -char * -csv_strerror(int status) -{ - if (status >= CSV_EINVALID || status < 0) - return csv_errors[CSV_EINVALID]; - else - return csv_errors[status]; -} - -int -csv_opts(struct csv_parser *p, unsigned char options) -{ - if (p == NULL) - return -1; - - p->options = options; - return 0; -} - -int -csv_init(struct csv_parser **p, unsigned char options) -{ - /* Initialize a csv_parser object returns 0 on success, -1 on error */ - if (p == NULL) - return -1; - - if ((*p = malloc(sizeof(struct csv_parser))) == NULL) - return -1; - - if ( ((*p)->entry_buf = malloc(MEM_BLK_SIZE)) == NULL ) { - free(*p); - return -1; - } - (*p)->pstate = ROW_NOT_BEGUN; - (*p)->quoted = 0; - (*p)->spaces = 0; - (*p)->entry_pos = 0; - (*p)->entry_size = MEM_BLK_SIZE; - (*p)->status = 0; - (*p)->options = options; - - return 0; -} - -void -csv_free(struct csv_parser *p) -{ - /* Free the entry_buffer and the csv_parser object */ - if (p == NULL) - return; - - if (p->entry_buf) - free(p->entry_buf); - - free(p); - return; -} - -int -csv_fini(struct csv_parser *p, void (*cb1)(char *, size_t, void *), void (*cb2)(char c, void *), void *data) -{ - /* Finalize parsing. Needed, for example, when file does not end in a newline */ - if (p == NULL) - return -1; - - switch (p->pstate) { - case FIELD_MIGHT_HAVE_ENDED: - p->entry_pos -= p->spaces + 1; /* get rid of spaces and original quote */ - case FIELD_NOT_BEGUN: - case FIELD_BEGUN: - SUBMIT_FIELD(p); - SUBMIT_ROW(p, 0); - case ROW_NOT_BEGUN: /* Already ended properly */ - ; - } - - p->spaces = p->quoted = p->entry_pos = p->status = 0; - p->pstate = ROW_NOT_BEGUN; - - return 0; -} - -size_t -csv_parse(struct csv_parser *p, const char *s, size_t len, void (*cb1)(char *, size_t, void *), void (*cb2)(char c, void *), void *data) -{ - char c; /* The character we are currently processing */ - size_t pos = 0; /* The number of characters we have processed in this call */ - - while (pos < len) { - /* Check memory usage */ - if (p->entry_pos == p->entry_size) { - size_t to_add = MEM_BLK_SIZE; - void *vp; - while ( p->entry_size >= SIZE_MAX - to_add ) - to_add /= 2; - if (!to_add) { - p->status = CSV_ETOOBIG; - return pos; - } - while ((vp = realloc(p->entry_buf, p->entry_size + to_add)) == NULL) { - to_add /= 2; - if (!to_add) { - p->status = CSV_ENOMEM; - return pos; - } - } - p->entry_buf = vp; - p->entry_size += to_add; - } - - c = s[pos++]; - switch (p->pstate) { - case ROW_NOT_BEGUN: - case FIELD_NOT_BEGUN: - if (c == CSV_SPACE || c == CSV_TAB) { /* Space or Tab */ - continue; - } else if (c == CSV_CR || c == CSV_LF) { /* Carriage Return or Line Feed */ - if (p->pstate == FIELD_NOT_BEGUN) { - SUBMIT_FIELD(p); - SUBMIT_ROW(p, c); - } else { /* ROW_NOT_BEGUN */ - /* Don't submit empty rows by default */ - if (p->options & CSV_REPALL_NL) { - SUBMIT_ROW(p, c); - } - } - continue; - } else if ( (!(p->options & CSV_USE_SEMICOLON_SEPARATOR) && (c == CSV_COMMA)) || ((p->options & CSV_USE_SEMICOLON_SEPARATOR) && (c == CSV_SEMICOLON)) ) { /* Comma or SemiColon */ - SUBMIT_FIELD(p); - break; - } else if (c == CSV_QUOTE) { /* Quote */ - p->pstate = FIELD_BEGUN; - p->quoted = 1; - } else { /* Anything else */ - p->pstate = FIELD_BEGUN; - p->quoted = 0; - SUBMIT_CHAR(p, c); - } - break; - case FIELD_BEGUN: - if (c == CSV_QUOTE) { /* Quote */ - if (p->quoted) { - SUBMIT_CHAR(p, c); - p->pstate = FIELD_MIGHT_HAVE_ENDED; - } else { - /* STRICT ERROR - double quote inside non-quoted field */ - if (p->options & CSV_STRICT) { - p->status = CSV_EPARSE; - return pos-1; - } - SUBMIT_CHAR(p, c); - p->spaces = 0; - } - } else if ((!(p->options & CSV_USE_SEMICOLON_SEPARATOR) && (c == CSV_COMMA)) || ((p->options & CSV_USE_SEMICOLON_SEPARATOR) && (c == CSV_SEMICOLON))) { /* Comma or SemiColon */ - if (p->quoted) { - SUBMIT_CHAR(p, c); - } else { - SUBMIT_FIELD(p); - } - } else if (c == CSV_CR || c == CSV_LF) { /* Carriage Return or Line Feed */ - if (!p->quoted) { - SUBMIT_FIELD(p); - SUBMIT_ROW(p, c); - } else { - SUBMIT_CHAR(p, c); - } - } else if (!p->quoted && (c == CSV_SPACE || c == CSV_TAB)) { /* Tab or space for non-quoted field */ - SUBMIT_CHAR(p, c); - p->spaces++; - } else { /* Anything else */ - SUBMIT_CHAR(p, c); - p->spaces = 0; - } - break; - case FIELD_MIGHT_HAVE_ENDED: - /* This only happens when a quote character is encountered in a quoted field */ - if ((!(p->options & CSV_USE_SEMICOLON_SEPARATOR) && (c == CSV_COMMA)) || ((p->options & CSV_USE_SEMICOLON_SEPARATOR) && (c == CSV_SEMICOLON))) { /* Comma or SemiColon */ - p->entry_pos -= p->spaces + 1; /* get rid of spaces and original quote */ - SUBMIT_FIELD(p); - } else if (c == CSV_CR || c == CSV_LF) { /* Carriage Return or Line Feed */ - p->entry_pos -= p->spaces + 1; /* get rid of spaces and original quote */ - SUBMIT_FIELD(p); - SUBMIT_ROW(p, c); - } else if (c == CSV_SPACE || c == CSV_TAB) { /* Space or Tab */ - SUBMIT_CHAR(p, c); - p->spaces++; - } else if (c == CSV_QUOTE) { /* Quote */ - if (p->spaces) { - /* STRICT ERROR - unescaped double quote */ - if (p->options & CSV_STRICT) { - p->status = CSV_EPARSE; - return pos-1; - } - p->spaces = 0; - SUBMIT_CHAR(p, c); - } else { - /* Two quotes in a row */ - p->pstate = FIELD_BEGUN; - } - } else { /* Anything else */ - /* STRICT ERROR - unescaped double quote */ - if (p->options & CSV_STRICT) { - p->status = CSV_EPARSE; - return pos-1; - } - p->pstate = FIELD_BEGUN; - p->spaces = 0; - SUBMIT_CHAR(p, c); - } - break; - default: - break; - } - } - return pos; -} - -size_t -csv_write (char *dest, size_t dest_size, const char *src, size_t src_size) -{ - size_t chars = 0; - - if (src == NULL) - return 0; - - if (dest == NULL) - dest_size = 0; - - if (dest_size > 0) - *dest++ = '"'; - chars++; - - while (src_size) { - if (*src == '"') { - if (dest_size > chars) - *dest++ = '"'; - if (chars < SIZE_MAX) chars++; - } - if (dest_size > chars) - *dest++ = *src; - if (chars < SIZE_MAX) chars++; - src_size--; - src++; - } - - if (dest_size > chars) - *dest = '"'; - if (chars < SIZE_MAX) chars++; - - return chars; -} - -int -csv_fwrite (FILE *fp, const char *src, size_t src_size) -{ - if (fp == NULL || src == NULL) - return 0; - - if (fputc('"', fp) == EOF) - return EOF; - - while (src_size) { - if (*src == '"') { - if (fputc('"', fp) == EOF) - return EOF; - } - if (fputc(*src, fp) == EOF) - return EOF; - src_size--; - src++; - } - - if (fputc('"', fp) == EOF) { - return EOF; - } - - return 0; -} diff --git a/src/mod/endpoints/mod_gsmopen/asterisk/celliax_libcsv.h b/src/mod/endpoints/mod_gsmopen/asterisk/celliax_libcsv.h deleted file mode 100644 index 2a2e4465a9..0000000000 --- a/src/mod/endpoints/mod_gsmopen/asterisk/celliax_libcsv.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef LIBCSV_H__ -#define LIBCSV_H__ -#include -#include - -/* Error Codes */ -#define CSV_SUCCESS 0 -#define CSV_EPARSE 1 /* Parse error in strict mode */ -#define CSV_ENOMEM 2 /* Out of memory while increasing buffer size */ -#define CSV_ETOOBIG 3 /* Buffer larger than SIZE_MAX needed */ -#define CSV_EINVALID 4 /* Invalid code, should never receive this from csv_error */ - -/* parser options */ -#define CSV_STRICT 1 /* enable strict mode */ -#define CSV_REPALL_NL 2 /* report all unquoted carriage returns and linefeeds */ -#define CSV_USE_SEMICOLON_SEPARATOR 4 /* use CSV_SEMICOLON as separator instead of CSV_COMMA */ - -/* Character values */ -#define CSV_TAB 0x09 -#define CSV_SPACE 0x20 -#define CSV_CR 0x0d -#define CSV_LF 0x0a -#define CSV_COMMA 0x2c -#define CSV_SEMICOLON 0x3b /* ; */ -#define CSV_QUOTE 0x22 - -struct csv_parser { - int pstate; /* Parser state */ - int quoted; /* Is the current field a quoted field? */ - size_t spaces; /* Number of continious spaces after quote or in a non-quoted field */ - char * entry_buf; /* Entry buffer */ - size_t entry_pos; /* Current position in entry_buf (and current size of entry) */ - size_t entry_size; /* Size of buffer */ - int status; /* Operation status */ - unsigned char options; -}; - -int csv_init(struct csv_parser **p, unsigned char options); -int csv_fini(struct csv_parser *p, void (*cb1)(char *, size_t, void *), void (*cb2)(char, void *), void *data); -void csv_free(struct csv_parser *p); -int csv_error(struct csv_parser *p); -char * csv_strerror(int error); -size_t csv_parse(struct csv_parser *p, const char *s, size_t len, void (*cb1)(char *, size_t, void *), void (*cb2)(char, void *), void *data); -size_t csv_write(char *dest, size_t dest_size, const char *src, size_t src_size); -int csv_fwrite(FILE *fp, const char *src, size_t src_size); -int csv_opts(struct csv_parser *p, unsigned char options); - -#endif diff --git a/src/mod/endpoints/mod_gsmopen/asterisk/celliax_spandsp.c b/src/mod/endpoints/mod_gsmopen/asterisk/celliax_spandsp.c deleted file mode 100644 index b18a498e8d..0000000000 --- a/src/mod/endpoints/mod_gsmopen/asterisk/celliax_spandsp.c +++ /dev/null @@ -1,1059 +0,0 @@ -/* - * SpanDSP - a series of DSP components for telephony - * - * echo.c - An echo cancellor, suitable for electrical and acoustic - * cancellation. This code does not currently comply with - * any relevant standards (e.g. G.164/5/7/8). One day.... - * - * Written by Steve Underwood - * - * Copyright (C) 2001, 2003 Steve Underwood - * - * Based on a bit from here, a bit from there, eye of toad, - * ear of bat, etc - plus, of course, my own 2 cents. - * - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2, as - * published by the Free Software Foundation. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * $Id: echo.c,v 1.20 2006/12/01 18:00:48 steveu Exp $ - */ - -/*! \file */ - -/* TODO: - Finish the echo suppressor option, however nasty suppression may be. - Add an option to reintroduce side tone at -24dB under appropriate conditions. - Improve double talk detector (iterative!) -*/ - -/* We need to differentiate between transmitted energy which will train the echo - canceller well (voice, white noise, and other broadband sources) and energy - which will train it badly (supervisory tones, DTMF, whistles, and other - narrowband sources). There are many ways this might be done. This canceller uses - a method based on the autocorrelation qualities of the transmitted signal. A rather - peaky autocorrelation function is a clear sign of a narrowband signal. We only need - perform the autocorrelation at well spaced intervals, so the compute load is not too - great. Multiple successive autocorrelation functions with a similar peaky shape are a - clear indication of a stationary narrowband signal. Using TKEO, it should be possible to - greatly reduce the compute requirement for narrowband detection. */ - -/* The FIR taps must be adapted as 32 bit values, to get the necessary finesse - in the adaption process. However, they are applied as 16 bit values (bits 30-15 - of the 32 bit values) in the FIR. For the working 16 bit values, we need 4 sets. - - 3 of the 16 bit sets are used on a rotating basis. Normally the canceller steps - round these 3 sets at regular intervals. Any time we detect double talk, we can go - back to the set from two steps ago with reasonable assurance it is a well adapted - set. We cannot just go back one step, as we may have rotated the sets just before - double talk or tone was detected, and that set may already be somewhat corrupted. - - When narrowband energy is detected we need to continue adapting to it, to echo - cancel it. However, the adaption will almost certainly be going astray. Broadband - (or even complex sequences of narrowband) energy will normally lead to a well - trained cancellor, with taps matching the impulse response of the channel. - For stationary narrowband energy, there is usually has an infinite number of - alternative tap sets which will cancel it well. A previously well trained set of - taps will tend to drift amongst the alternatives. When broadband energy resumes, the - taps may be a total mismatch for the signal, and could even amplify rather than - attenuate the echo. The solution is to use a fourth set of 16 bit taps. When we first - detect the narrowband energy we save the oldest of the group of three sets, but do - not change back to an older set. We let the canceller cancel, and it adaption drift - while the narrowband energy is present. When we detect the narrowband energy has ceased, - we switch to using the fourth set of taps which was saved. - - When we revert to an older set of taps, we must replace both the 16 bit and 32 bit - working tap sets. The saved 16 bit values are good enough to also be used as a replacement - for the 32 bit values. We loose the fractions, but they should soon settle down in a - reasonable way. */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include - -#include "celliax_spandsp.h" - -//#include "spandsp/telephony.h" -//#include "spandsp/logging.h" -//#include "spandsp/bit_operations.h" -//#include "spandsp/echo.h" - -//#include "bit_operations.h" -//#include "giova.h" - -#if !defined(NULL) -#define NULL (void *) 0 -#endif -#if !defined(FALSE) -#define FALSE 0 -#endif -#if !defined(TRUE) -#define TRUE (!FALSE) -#endif - -#if 0 -#define MIN_TX_POWER_FOR_ADAPTION 64*64 -#define MIN_RX_POWER_FOR_ADAPTION 64*64 - -static int narrowband_detect(echo_can_state_t * ec) -{ - int k; - int i; - float temp; - float scale; - float sf[128]; - float f_acf[128]; - int32_t acf[28]; - int score; - int len = 32; - int alen = 9; - - k = ec->curr_pos; - for (i = 0; i < len; i++) { - sf[i] = ec->fir_state.history[k++]; - if (k >= 256) - k = 0; - } - for (k = 0; k < alen; k++) { - temp = 0; - for (i = k; i < len; i++) - temp += sf[i] * sf[i - k]; - f_acf[k] = temp; - } - scale = 0x1FFFFFFF / f_acf[0]; - for (k = 0; k < alen; k++) - acf[k] = (int32_t) (f_acf[k] * scale); - score = 0; - for (i = 0; i < 9; i++) { - if (ec->last_acf[i] >= 0 && acf[i] >= 0) { - if ((ec->last_acf[i] >> 1) < acf[i] && acf[i] < (ec->last_acf[i] << 1)) - score++; - } else if (ec->last_acf[i] < 0 && acf[i] < 0) { - if ((ec->last_acf[i] >> 1) > acf[i] && acf[i] > (ec->last_acf[i] << 1)) - score++; - } - } - memcpy(ec->last_acf, acf, alen * sizeof(ec->last_acf[0])); - return score; -} - -static __inline__ void lms_adapt(echo_can_state_t * ec, int factor) -{ - int i; - -#if 0 - mmx_t *mmx_taps; - mmx_t *mmx_coeffs; - mmx_t *mmx_hist; - mmx_t mmx; - - mmx.w[0] = mmx.w[1] = mmx.w[2] = mmx.w[3] = factor; - mmx_hist = (mmx_t *) & fir->history[fir->curr_pos]; - mmx_taps = (mmx_t *) & fir->taps; - mmx_coeffs = (mmx_t *) fir->coeffs; - i = fir->taps; - movq_m2r(mmx, mm0); - while (i > 0) { - movq_m2r(mmx_hist[0], mm1); - movq_m2r(mmx_taps[0], mm0); - movq_m2r(mmx_taps[1], mm1); - movq_r2r(mm1, mm2); - pmulhw(mm0, mm1); - pmullw(mm0, mm2); - - pmaddwd_r2r(mm1, mm0); - pmaddwd_r2r(mm3, mm2); - paddd_r2r(mm0, mm4); - paddd_r2r(mm2, mm4); - movq_r2m(mm0, mmx_taps[0]); - movq_r2m(mm1, mmx_taps[0]); - movq_r2m(mm2, mmx_coeffs[0]); - mmx_taps += 2; - mmx_coeffs += 1; - mmx_hist += 1; - i -= 4; - ) - emms(); -#elif 0 - /* Update the FIR taps */ - for (i = ec->taps - 1; i >= 0; i--) { - /* Leak to avoid the coefficients drifting beyond the ability of the - adaption process to bring them back under control. */ - ec->fir_taps32[i] -= (ec->fir_taps32[i] >> 23); - ec->fir_taps32[i] += (ec->fir_state.history[i + ec->curr_pos] * factor); - ec->latest_correction = (ec->fir_state.history[i + ec->curr_pos] * factor); - ec->fir_taps16[ec->tap_set][i] = ec->fir_taps32[i] >> 15; - } -#else - int offset1; - int offset2; - - /* Update the FIR taps */ - offset2 = ec->curr_pos; - offset1 = ec->taps - offset2; - for (i = ec->taps - 1; i >= offset1; i--) { - ec->fir_taps32[i] += (ec->fir_state.history[i - offset1] * factor); - ec->fir_taps16[ec->tap_set][i] = (int16_t) (ec->fir_taps32[i] >> 15); - } - for (; i >= 0; i--) { - ec->fir_taps32[i] += (ec->fir_state.history[i + offset2] * factor); - ec->fir_taps16[ec->tap_set][i] = (int16_t) (ec->fir_taps32[i] >> 15); - } -#endif -} - -/*- End of function --------------------------------------------------------*/ - -#ifdef NOT_NEEDED -echo_can_state_t *echo_can_create(int len, int adaption_mode) -{ - echo_can_state_t *ec; - int i; - int j; - - ec = (echo_can_state_t *) malloc(sizeof(*ec)); - if (ec == NULL) - return NULL; - memset(ec, 0, sizeof(*ec)); - ec->taps = len; - ec->curr_pos = ec->taps - 1; - ec->tap_mask = ec->taps - 1; - if ((ec->fir_taps32 = (int32_t *) malloc(ec->taps * sizeof(int32_t))) == NULL) { - free(ec); - return NULL; - } - memset(ec->fir_taps32, 0, ec->taps * sizeof(int32_t)); - for (i = 0; i < 4; i++) { - if ((ec->fir_taps16[i] = (int16_t *) malloc(ec->taps * sizeof(int16_t))) == NULL) { - for (j = 0; j < i; j++) - free(ec->fir_taps16[j]); - free(ec->fir_taps32); - free(ec); - return NULL; - } - memset(ec->fir_taps16[i], 0, ec->taps * sizeof(int16_t)); - } - fir16_create(&ec->fir_state, ec->fir_taps16[0], ec->taps); - ec->rx_power_threshold = 10000000; - ec->geigel_max = 0; - ec->geigel_lag = 0; - ec->dtd_onset = FALSE; - ec->tap_set = 0; - ec->tap_rotate_counter = 1600; - ec->cng_level = 1000; - echo_can_adaption_mode(ec, adaption_mode); - return ec; -} - -/*- End of function --------------------------------------------------------*/ - -void echo_can_free(echo_can_state_t * ec) -{ - int i; - - fir16_free(&ec->fir_state); - free(ec->fir_taps32); - for (i = 0; i < 4; i++) - free(ec->fir_taps16[i]); - free(ec); -} - -/*- End of function --------------------------------------------------------*/ - -void echo_can_adaption_mode(echo_can_state_t * ec, int adaption_mode) -{ - ec->adaption_mode = adaption_mode; -} - -/*- End of function --------------------------------------------------------*/ - -void echo_can_flush(echo_can_state_t * ec) -{ - int i; - - for (i = 0; i < 4; i++) - ec->tx_power[i] = 0; - for (i = 0; i < 3; i++) - ec->rx_power[i] = 0; - ec->clean_rx_power = 0; - ec->nonupdate_dwell = 0; - - fir16_flush(&ec->fir_state); - ec->fir_state.curr_pos = ec->taps - 1; - memset(ec->fir_taps32, 0, ec->taps * sizeof(int32_t)); - for (i = 0; i < 4; i++) - memset(ec->fir_taps16[i], 0, ec->taps * sizeof(int16_t)); - - ec->curr_pos = ec->taps - 1; - - ec->supp_test1 = 0; - ec->supp_test2 = 0; - ec->supp1 = 0; - ec->supp2 = 0; - ec->vad = 0; - ec->cng_level = 1000; - ec->cng_filter = 0; - - ec->geigel_max = 0; - ec->geigel_lag = 0; - ec->dtd_onset = FALSE; - ec->tap_set = 0; - ec->tap_rotate_counter = 1600; - - ec->latest_correction = 0; - - memset(ec->last_acf, 0, sizeof(ec->last_acf)); - ec->narrowband_count = 0; - ec->narrowband_score = 0; -} - -/*- End of function --------------------------------------------------------*/ - -int sample_no = 0; - -int16_t echo_can_update(echo_can_state_t * ec, int16_t tx, int16_t rx) -{ - int32_t echo_value; - int clean_rx; - int nsuppr; - int score; - int i; - - sample_no++; - ec->latest_correction = 0; - /* Evaluate the echo - i.e. apply the FIR filter */ - /* Assume the gain of the FIR does not exceed unity. Exceeding unity - would seem like a rather poor thing for an echo cancellor to do :) - This means we can compute the result with a total disregard for - overflows. 16bits x 16bits -> 31bits, so no overflow can occur in - any multiply. While accumulating we may overflow and underflow the - 32 bit scale often. However, if the gain does not exceed unity, - everything should work itself out, and the final result will be - OK, without any saturation logic. */ - /* Overflow is very much possible here, and we do nothing about it because - of the compute costs */ - /* 16 bit coeffs for the LMS give lousy results (maths good, actual sound - bad!), but 32 bit coeffs require some shifting. On balance 32 bit seems - best */ - echo_value = fir16(&ec->fir_state, tx); - - /* And the answer is..... */ - clean_rx = rx - echo_value; -//printf("echo is %" PRId32 "\n", echo_value); - /* That was the easy part. Now we need to adapt! */ - if (ec->nonupdate_dwell > 0) - ec->nonupdate_dwell--; - - /* Calculate short term power levels using very simple single pole IIRs */ - /* TODO: Is the nasty modulus approach the fastest, or would a real - tx*tx power calculation actually be faster? Using the squares - makes the numbers grow a lot! */ - ec->tx_power[3] += ((abs(tx) - ec->tx_power[3]) >> 5); - ec->tx_power[2] += ((tx * tx - ec->tx_power[2]) >> 8); - ec->tx_power[1] += ((tx * tx - ec->tx_power[1]) >> 5); - ec->tx_power[0] += ((tx * tx - ec->tx_power[0]) >> 3); - ec->rx_power[1] += ((rx * rx - ec->rx_power[1]) >> 6); - ec->rx_power[0] += ((rx * rx - ec->rx_power[0]) >> 3); - ec->clean_rx_power += ((clean_rx * clean_rx - ec->clean_rx_power) >> 6); - - score = 0; - /* If there is very little being transmitted, any attempt to train is - futile. We would either be training on the far end's noise or signal, - the channel's own noise, or our noise. Either way, this is hardly good - training, so don't do it (avoid trouble). */ - if (ec->tx_power[0] > MIN_TX_POWER_FOR_ADAPTION) { - /* If the received power is very low, either we are sending very little or - we are already well adapted. There is little point in trying to improve - the adaption under these circumstances, so don't do it (reduce the - compute load). */ - if (ec->tx_power[1] > ec->rx_power[0]) { - /* There is no (or little) far-end speech. */ - if (ec->nonupdate_dwell == 0) { - if (++ec->narrowband_count >= 160) { - ec->narrowband_count = 0; - score = narrowband_detect(ec); -//printf("Do the narrowband test %d at %d\n", score, ec->curr_pos); - if (score > 6) { - if (ec->narrowband_score == 0) - memcpy(ec->fir_taps16[3], ec->fir_taps16[(ec->tap_set + 1) % 3], - ec->taps * sizeof(int16_t)); - ec->narrowband_score += score; - } else { - if (ec->narrowband_score > 200) { -//printf("Revert to %d at %d\n", (ec->tap_set + 1)%3, sample_no); - memcpy(ec->fir_taps16[ec->tap_set], ec->fir_taps16[3], - ec->taps * sizeof(int16_t)); - memcpy(ec->fir_taps16[(ec->tap_set - 1) % 3], ec->fir_taps16[3], - ec->taps * sizeof(int16_t)); - for (i = 0; i < ec->taps; i++) - ec->fir_taps32[i] = ec->fir_taps16[3][i] << 15; - ec->tap_rotate_counter = 1600; - } - ec->narrowband_score = 0; - } - } - ec->dtd_onset = FALSE; - if (--ec->tap_rotate_counter <= 0) { -//printf("Rotate to %d at %d\n", ec->tap_set, sample_no); - ec->tap_rotate_counter = 1600; - ec->tap_set++; - if (ec->tap_set > 2) - ec->tap_set = 0; - ec->fir_state.coeffs = ec->fir_taps16[ec->tap_set]; - } - /* ... and we are not in the dwell time from previous speech. */ - if ((ec->adaption_mode & ECHO_CAN_USE_ADAPTION) && ec->narrowband_score == 0) { - //nsuppr = saturate((clean_rx << 16)/ec->tx_power[1]); - //nsuppr = clean_rx/ec->tx_power[1]; - /* If a sudden surge in signal level (e.g. the onset of a tone - burst) cause an abnormally high instantaneous to average - signal power ratio, we could kick the adaption badly in the - wrong direction. This is because the tx_power takes too long - to react and rise. We need to stop too rapid adaption to the - new signal. We normalise to a value derived from the - instantaneous signal if it exceeds the peak by too much. */ - nsuppr = clean_rx; - /* Divide isn't very quick, but the "where is the top bit" and shift - instructions are single cycle. */ - if (tx > 4 * ec->tx_power[3]) - i = top_bit(tx) - 8; - else - i = top_bit(ec->tx_power[3]) - 8; - if (i > 0) - nsuppr >>= i; - lms_adapt(ec, nsuppr); - } - } - //printf("%10d %10d %10d %10d %10d\n", rx, clean_rx, nsuppr, ec->tx_power[1], ec->rx_power[1]); - //printf("%.4f\n", (float) ec->rx_power[1]/(float) ec->clean_rx_power); - } else { - if (!ec->dtd_onset) { -//printf("Revert to %d at %d\n", (ec->tap_set + 1)%3, sample_no); - memcpy(ec->fir_taps16[ec->tap_set], ec->fir_taps16[(ec->tap_set + 1) % 3], - ec->taps * sizeof(int16_t)); - memcpy(ec->fir_taps16[(ec->tap_set - 1) % 3], - ec->fir_taps16[(ec->tap_set + 1) % 3], ec->taps * sizeof(int16_t)); - for (i = 0; i < ec->taps; i++) - ec->fir_taps32[i] = ec->fir_taps16[(ec->tap_set + 1) % 3][i] << 15; - ec->tap_rotate_counter = 1600; - ec->dtd_onset = TRUE; - } - ec->nonupdate_dwell = NONUPDATE_DWELL_TIME; - } - } - - if (ec->rx_power[1]) - ec->vad = (8000 * ec->clean_rx_power) / ec->rx_power[1]; - else - ec->vad = 0; - if (ec->rx_power[1] > 2048 * 2048 && ec->clean_rx_power > 4 * ec->rx_power[1]) { - /* The EC seems to be making things worse, instead of better. Zap it! */ - memset(ec->fir_taps32, 0, ec->taps * sizeof(int32_t)); - for (i = 0; i < 4; i++) - memset(ec->fir_taps16[i], 0, ec->taps * sizeof(int16_t)); - } -#if defined(XYZZY) - if ((ec->adaption_mode & ECHO_CAN_USE_SUPPRESSOR)) { - ec->supp_test1 += - (ec->fir_state.history[ec->curr_pos] - - ec->fir_state.history[(ec->curr_pos - 7) & ec->tap_mask]); - ec->supp_test2 += - (ec->fir_state.history[(ec->curr_pos - 24) & ec->tap_mask] - - ec->fir_state.history[(ec->curr_pos - 31) & ec->tap_mask]); - if (ec->supp_test1 > 42 && ec->supp_test2 > 42) - supp_change = 25; - else - supp_change = 50; - supp = supp_change + k1 * ec->supp1 + k2 * ec->supp2; - ec->supp2 = ec->supp1; - ec->supp1 = supp; - clean_rx *= (1 - supp); - } -#endif - - if ((ec->adaption_mode & ECHO_CAN_USE_NLP)) { - /* Non-linear processor - a fancy way to say "zap small signals, to avoid - residual echo due to (uLaw/ALaw) non-linearity in the channel.". */ - if (ec->rx_power[1] < 30000000) { - if (!ec->cng) { - ec->cng_level = ec->clean_rx_power; - ec->cng = TRUE; - } - if ((ec->adaption_mode & ECHO_CAN_USE_CNG)) { - /* Very elementary comfort noise generation */ - /* Just random numbers rolled off very vaguely Hoth-like */ - ec->cng_rndnum = 1664525U * ec->cng_rndnum + 1013904223U; - ec->cng_filter = ((ec->cng_rndnum & 0xFFFF) - 32768 + 5 * ec->cng_filter) >> 3; - clean_rx = (ec->cng_filter * ec->cng_level) >> 17; - /* TODO: A better CNG, with more accurate (tracking) spectral shaping! */ - } else { - clean_rx = 0; - } -//clean_rx = -16000; - } else { - ec->cng = FALSE; - } - } else { - ec->cng = FALSE; - } - -//printf("Narrowband score %4d %5d at %d\n", ec->narrowband_score, score, sample_no); - /* Roll around the rolling buffer */ - if (ec->curr_pos <= 0) - ec->curr_pos = ec->taps; - ec->curr_pos--; - return (int16_t) clean_rx; -} - -#endif //NOT_NEEDED -/*- End of function --------------------------------------------------------*/ -/*- End of file ------------------------------------------------------------*/ -#endif - -#include -#include -#include -#include -#include -#include -#include - -//#include "spandsp/telephony.h" -//#include "spandsp/tone_detect.h" -//#include "spandsp/tone_generate.h" -//#include "spandsp/super_tone_rx.h" -//#include "giova.h" - -#if !defined(M_PI) -/* C99 systems may not define M_PI */ -#define M_PI 3.14159265358979323846264338327 -#endif - -//#define USE_3DNOW - -#define DEFAULT_DTMF_TX_LEVEL -10 -#define DEFAULT_DTMF_TX_ON_TIME 50 -#define DEFAULT_DTMF_TX_OFF_TIME 55 - -#define DTMF_THRESHOLD 8.0e7f -#define DTMF_NORMAL_TWIST 6.3f /* 8dB */ -#define DTMF_REVERSE_TWIST 2.5f /* 4dB */ -#define DTMF_RELATIVE_PEAK_ROW 6.3f /* 8dB */ -#define DTMF_RELATIVE_PEAK_COL 6.3f /* 8dB */ -#define DTMF_TO_TOTAL_ENERGY 42.0f - -static const float dtmf_row[] = { - 697.0f, 770.0f, 852.0f, 941.0f -}; -static const float dtmf_col[] = { - 1209.0f, 1336.0f, 1477.0f, 1633.0f -}; - -static const char dtmf_positions[] = "123A" "456B" "789C" "*0#D"; - -static goertzel_descriptor_t dtmf_detect_row[4]; -static goertzel_descriptor_t dtmf_detect_col[4]; - -// -//static int dtmf_tx_inited = 0; -//static tone_gen_descriptor_t dtmf_digit_tones[16]; - -#if defined(USE_3DNOW) -static __inline__ void _dtmf_goertzel_update(goertzel_state_t * s, float x[], int samples) -{ - int n; - float v; - int i; - float vv[16]; - - vv[4] = s[0].v2; - vv[5] = s[1].v2; - vv[6] = s[2].v2; - vv[7] = s[3].v2; - vv[8] = s[0].v3; - vv[9] = s[1].v3; - vv[10] = s[2].v3; - vv[11] = s[3].v3; - vv[12] = s[0].fac; - vv[13] = s[1].fac; - vv[14] = s[2].fac; - vv[15] = s[3].fac; - - //v1 = s->v2; - //s->v2 = s->v3; - //s->v3 = s->fac*s->v2 - v1 + x[0]; - - __asm__ __volatile__(" femms;\n" " movq 16(%%edx),%%mm2;\n" - " movq 24(%%edx),%%mm3;\n" " movq 32(%%edx),%%mm4;\n" - " movq 40(%%edx),%%mm5;\n" " movq 48(%%edx),%%mm6;\n" - " movq 56(%%edx),%%mm7;\n" " jmp 1f;\n" - " .align 32;\n" " 1: ;\n" " prefetch (%%eax);\n" - " movq %%mm3,%%mm1;\n" " movq %%mm2,%%mm0;\n" - " movq %%mm5,%%mm3;\n" " movq %%mm4,%%mm2;\n" - " pfmul %%mm7,%%mm5;\n" " pfmul %%mm6,%%mm4;\n" - " pfsub %%mm1,%%mm5;\n" " pfsub %%mm0,%%mm4;\n" - " movq (%%eax),%%mm0;\n" " movq %%mm0,%%mm1;\n" - " punpckldq %%mm0,%%mm1;\n" " add $4,%%eax;\n" - " pfadd %%mm1,%%mm5;\n" " pfadd %%mm1,%%mm4;\n" - " dec %%ecx;\n" " jnz 1b;\n" - " movq %%mm2,16(%%edx);\n" " movq %%mm3,24(%%edx);\n" - " movq %%mm4,32(%%edx);\n" " movq %%mm5,40(%%edx);\n" - " femms;\n"::"c"(samples), "a"(x), "d"(vv) - :"memory", "eax", "ecx"); - - s[0].v2 = vv[4]; - s[1].v2 = vv[5]; - s[2].v2 = vv[6]; - s[3].v2 = vv[7]; - s[0].v3 = vv[8]; - s[1].v3 = vv[9]; - s[2].v3 = vv[10]; - s[3].v3 = vv[11]; -} - -/*- End of function --------------------------------------------------------*/ -#endif - -int dtmf_rx(dtmf_rx_state_t * s, const int16_t amp[], int samples) -{ - float row_energy[4]; - float col_energy[4]; - float famp; - float v1; - int i; - int j; - int sample; - int best_row; - int best_col; - int limit; - uint8_t hit; - - hit = 0; - for (sample = 0; sample < samples; sample = limit) { - /* The block length is optimised to meet the DTMF specs. */ - if ((samples - sample) >= (102 - s->current_sample)) - limit = sample + (102 - s->current_sample); - else - limit = samples; -#if defined(USE_3DNOW) - _dtmf_goertzel_update(s->row_out, amp + sample, limit - sample); - _dtmf_goertzel_update(s->col_out, amp + sample, limit - sample); -#else - /* The following unrolled loop takes only 35% (rough estimate) of the - time of a rolled loop on the machine on which it was developed */ - for (j = sample; j < limit; j++) { - famp = amp[j]; - if (s->filter_dialtone) { - /* Sharp notches applied at 350Hz and 440Hz - the two common dialtone frequencies. - These are rather high Q, to achieve the required narrowness, without using lots of - sections. */ - v1 = 0.98356f * famp + 1.8954426f * s->z350_1 - 0.9691396f * s->z350_2; - famp = v1 - 1.9251480f * s->z350_1 + s->z350_2; - s->z350_2 = s->z350_1; - s->z350_1 = v1; - - v1 = 0.98456f * famp + 1.8529543f * s->z440_1 - 0.9691396f * s->z440_2; - famp = v1 - 1.8819938f * s->z440_1 + s->z440_2; - s->z440_2 = s->z440_1; - s->z440_1 = v1; - } - s->energy += famp * famp; - /* With GCC 2.95, the following unrolled code seems to take about 35% - (rough estimate) as long as a neat little 0-3 loop */ - v1 = s->row_out[0].v2; - s->row_out[0].v2 = s->row_out[0].v3; - s->row_out[0].v3 = s->row_out[0].fac * s->row_out[0].v2 - v1 + famp; - - v1 = s->col_out[0].v2; - s->col_out[0].v2 = s->col_out[0].v3; - s->col_out[0].v3 = s->col_out[0].fac * s->col_out[0].v2 - v1 + famp; - - v1 = s->row_out[1].v2; - s->row_out[1].v2 = s->row_out[1].v3; - s->row_out[1].v3 = s->row_out[1].fac * s->row_out[1].v2 - v1 + famp; - - v1 = s->col_out[1].v2; - s->col_out[1].v2 = s->col_out[1].v3; - s->col_out[1].v3 = s->col_out[1].fac * s->col_out[1].v2 - v1 + famp; - - v1 = s->row_out[2].v2; - s->row_out[2].v2 = s->row_out[2].v3; - s->row_out[2].v3 = s->row_out[2].fac * s->row_out[2].v2 - v1 + famp; - - v1 = s->col_out[2].v2; - s->col_out[2].v2 = s->col_out[2].v3; - s->col_out[2].v3 = s->col_out[2].fac * s->col_out[2].v2 - v1 + famp; - - v1 = s->row_out[3].v2; - s->row_out[3].v2 = s->row_out[3].v3; - s->row_out[3].v3 = s->row_out[3].fac * s->row_out[3].v2 - v1 + famp; - - v1 = s->col_out[3].v2; - s->col_out[3].v2 = s->col_out[3].v3; - s->col_out[3].v3 = s->col_out[3].fac * s->col_out[3].v2 - v1 + famp; - } -#endif - s->current_sample += (limit - sample); - if (s->current_sample < 102) - continue; - - /* We are at the end of a DTMF detection block */ - /* Find the peak row and the peak column */ - row_energy[0] = goertzel_result(&s->row_out[0]); - best_row = 0; - col_energy[0] = goertzel_result(&s->col_out[0]); - best_col = 0; - - for (i = 1; i < 4; i++) { - row_energy[i] = goertzel_result(&s->row_out[i]); - if (row_energy[i] > row_energy[best_row]) - best_row = i; - col_energy[i] = goertzel_result(&s->col_out[i]); - if (col_energy[i] > col_energy[best_col]) - best_col = i; - } - hit = 0; - /* Basic signal level test and the twist test */ - if (row_energy[best_row] >= DTMF_THRESHOLD && col_energy[best_col] >= DTMF_THRESHOLD - && col_energy[best_col] < row_energy[best_row] * s->reverse_twist - && col_energy[best_col] * s->normal_twist > row_energy[best_row]) { - /* Relative peak test ... */ - for (i = 0; i < 4; i++) { - if ((i != best_col - && col_energy[i] * DTMF_RELATIVE_PEAK_COL > col_energy[best_col]) - || (i != best_row - && row_energy[i] * DTMF_RELATIVE_PEAK_ROW > row_energy[best_row])) { - break; - } - } - /* ... and fraction of total energy test */ - if (i >= 4 - && (row_energy[best_row] + col_energy[best_col]) > - DTMF_TO_TOTAL_ENERGY * s->energy) { - hit = dtmf_positions[(best_row << 2) + best_col]; - } - } - /* The logic in the next test should ensure the following for different successive hit patterns: - -----ABB = start of digit B. - ----B-BB = start of digit B - ----A-BB = start of digit B - BBBBBABB = still in digit B. - BBBBBB-- = end of digit B - BBBBBBC- = end of digit B - BBBBACBB = B ends, then B starts again. - BBBBBBCC = B ends, then C starts. - BBBBBCDD = B ends, then D starts. - This can work with: - - Back to back differing digits. Back-to-back digits should - not happen. The spec. says there should be a gap between digits. - However, many real phones do not impose a gap, and rolling across - the keypad can produce little or no gap. - - It tolerates nasty phones that give a very wobbly start to a digit. - - VoIP can give sample slips. The phase jumps that produces will cause - the block it is in to give no detection. This logic will ride over a - single missed block, and not falsely declare a second digit. If the - hiccup happens in the wrong place on a minimum length digit, however - we would still fail to detect that digit. Could anything be done to - deal with that? Packet loss is clearly a no-go zone. - Note this is only relevant to VoIP using A-law, u-law or similar. - Low bit rate codecs scramble DTMF too much for it to be recognised, - and often slip in units larger than a sample. */ - if (hit != s->in_digit) { - if (s->last_hit != s->in_digit) { - /* We have two successive indications that something has changed. */ - /* To declare digit on, the hits must agree. Otherwise we declare tone off. */ - hit = (hit && hit == s->last_hit) ? hit : 0; -#if 0 - if (s->realtime_callback) { - /* Avoid reporting multiple no digit conditions on flaky hits */ - if (s->in_digit || hit) { - i = (s->in_digit - && !hit) ? -99 : rint(log10f(s->energy) * 10.0f - 20.08f - 90.30F + - DBM0_MAX_POWER); - s->realtime_callback(s->realtime_callback_data, hit, i); - } - } else { -#endif - if (hit) { - if (s->current_digits < MAX_DTMF_DIGITS) { - s->digits[s->current_digits++] = (char) hit; - s->digits[s->current_digits] = '\0'; - if (s->callback) { - s->callback(s->callback_data, s->digits, s->current_digits); - s->current_digits = 0; - } - } else { - s->lost_digits++; - } - } -#if 0 - } -#endif - s->in_digit = hit; - } - } - s->last_hit = hit; - /* Reinitialise the detector for the next block */ - for (i = 0; i < 4; i++) { - goertzel_reset(&s->row_out[i]); - goertzel_reset(&s->col_out[i]); - } - s->energy = 0.0f; - s->current_sample = 0; - } - if (s->current_digits && s->callback) { - s->callback(s->callback_data, s->digits, s->current_digits); - s->digits[0] = '\0'; - s->current_digits = 0; - } - return 0; -} - -/*- End of function --------------------------------------------------------*/ - -size_t dtmf_rx_get(dtmf_rx_state_t * s, char *buf, int max) -{ - if (max > s->current_digits) - max = s->current_digits; - if (max > 0) { - memcpy(buf, s->digits, max); - memmove(s->digits, s->digits + max, s->current_digits - max); - s->current_digits -= max; - } - buf[max] = '\0'; - return max; -} - -/*- End of function --------------------------------------------------------*/ - -#if 0 -void dtmf_rx_set_realtime_callback(dtmf_rx_state_t * s, tone_report_func_t callback, - void *user_data) -{ - s->realtime_callback = callback; - s->realtime_callback_data = user_data; -} -#endif -/*- End of function --------------------------------------------------------*/ - -void dtmf_rx_parms(dtmf_rx_state_t * s, int filter_dialtone, int twist, int reverse_twist) -{ - if (filter_dialtone >= 0) { - s->z350_1 = 0.0f; - s->z350_2 = 0.0f; - s->z440_1 = 0.0f; - s->z440_2 = 0.0f; - s->filter_dialtone = filter_dialtone; - } - if (twist >= 0) - s->normal_twist = powf(10.0f, twist / 10.0f); - if (reverse_twist >= 0) - s->reverse_twist = powf(10.0f, reverse_twist / 10.0f); -} - -/*- End of function --------------------------------------------------------*/ - -dtmf_rx_state_t *dtmf_rx_init(dtmf_rx_state_t * s, dtmf_rx_callback_t callback, - void *user_data) -{ - int i; - static int initialised = 0; - - s->callback = callback; - s->callback_data = user_data; - s->realtime_callback = NULL; - s->realtime_callback_data = NULL; - s->filter_dialtone = 0; - s->normal_twist = DTMF_NORMAL_TWIST; - s->reverse_twist = DTMF_REVERSE_TWIST; - - s->in_digit = 0; - s->last_hit = 0; - - if (!initialised) { - for (i = 0; i < 4; i++) { - make_goertzel_descriptor(&dtmf_detect_row[i], dtmf_row[i], 102); - make_goertzel_descriptor(&dtmf_detect_col[i], dtmf_col[i], 102); - } - initialised = 1; - } - for (i = 0; i < 4; i++) { - goertzel_init(&s->row_out[i], &dtmf_detect_row[i]); - goertzel_init(&s->col_out[i], &dtmf_detect_col[i]); - } - s->energy = 0.0f; - s->current_sample = 0; - s->lost_digits = 0; - s->current_digits = 0; - s->digits[0] = '\0'; - return s; -} - -/*- End of function --------------------------------------------------------*/ - -#if 0 -static void dtmf_tx_initialise(void) -{ - int row; - int col; - - if (dtmf_tx_inited) - return; - for (row = 0; row < 4; row++) { - for (col = 0; col < 4; col++) { - make_tone_gen_descriptor(&dtmf_digit_tones[row * 4 + col], (int) dtmf_row[row], - DEFAULT_DTMF_TX_LEVEL, (int) dtmf_col[col], - DEFAULT_DTMF_TX_LEVEL, DEFAULT_DTMF_TX_ON_TIME, - DEFAULT_DTMF_TX_OFF_TIME, 0, 0, FALSE); - } - } - dtmf_tx_inited = TRUE; -} - -/*- End of function --------------------------------------------------------*/ - -int dtmf_tx(dtmf_tx_state_t * s, int16_t amp[], int max_samples) -{ - int len; - size_t dig; - char *cp; - - len = 0; - if (s->tones.current_section >= 0) { - /* Deal with the fragment left over from last time */ - len = tone_gen(&(s->tones), amp, max_samples); - } - dig = 0; - while (dig < s->current_digits && len < max_samples) { - /* Step to the next digit */ - if ((cp = strchr(dtmf_positions, s->digits[dig++])) == NULL) - continue; - tone_gen_init(&(s->tones), &(s->tone_descriptors[cp - dtmf_positions])); - len += tone_gen(&(s->tones), amp + len, max_samples - len); - } - if (dig) { - /* Shift out the consumed digits */ - s->current_digits -= dig; - memmove(s->digits, s->digits + dig, s->current_digits); - } - return len; -} - -/*- End of function --------------------------------------------------------*/ - -size_t dtmf_tx_put(dtmf_tx_state_t * s, const char *digits) -{ - size_t len; - - /* This returns the number of characters that would not fit in the buffer. - The buffer will only be loaded if the whole string of digits will fit, - in which case zero is returned. */ - if ((len = strlen(digits)) > 0) { - if (s->current_digits + len <= MAX_DTMF_DIGITS) { - memcpy(s->digits + s->current_digits, digits, len); - s->current_digits += len; - len = 0; - } else { - len = MAX_DTMF_DIGITS - s->current_digits; - } - } - return len; -} - -/*- End of function --------------------------------------------------------*/ - -dtmf_tx_state_t *dtmf_tx_init(dtmf_tx_state_t * s) -{ - if (!dtmf_tx_inited) - dtmf_tx_initialise(); - s->tone_descriptors = dtmf_digit_tones; - tone_gen_init(&(s->tones), &dtmf_digit_tones[0]); - s->current_sample = 0; - s->current_digits = 0; - s->tones.current_section = -1; - return s; -} -#endif //NO TX -/*- End of function --------------------------------------------------------*/ -/*- End of file ------------------------------------------------------------*/ - -void make_goertzel_descriptor(goertzel_descriptor_t * t, float freq, int samples) -{ - //t->fac = 2.0f*cosf(2.0f*M_PI*(freq/(float) SAMPLE_RATE)); - t->fac = 2.0f * cosf(2.0f * M_PI * (freq / (float) 8000)); - t->samples = samples; -} - -/*- End of function --------------------------------------------------------*/ - -goertzel_state_t *goertzel_init(goertzel_state_t * s, goertzel_descriptor_t * t) -{ - if (s || (s = malloc(sizeof(goertzel_state_t)))) { - s->v2 = s->v3 = 0.0; - s->fac = t->fac; - s->samples = t->samples; - s->current_sample = 0; - } - return s; -} - -/*- End of function --------------------------------------------------------*/ - -void goertzel_reset(goertzel_state_t * s) -{ - s->v2 = s->v3 = 0.0; - s->current_sample = 0; -} - -/*- End of function --------------------------------------------------------*/ - -int goertzel_update(goertzel_state_t * s, const int16_t amp[], int samples) -{ - int i; - float v1; - - if (samples > s->samples - s->current_sample) - samples = s->samples - s->current_sample; - for (i = 0; i < samples; i++) { - v1 = s->v2; - s->v2 = s->v3; - s->v3 = s->fac * s->v2 - v1 + amp[i]; - } - s->current_sample += samples; - return samples; -} - -/*- End of function --------------------------------------------------------*/ - -float goertzel_result(goertzel_state_t * s) -{ - float v1; - - /* Push a zero through the process to finish things off. */ - v1 = s->v2; - s->v2 = s->v3; - s->v3 = s->fac * s->v2 - v1; - /* Now calculate the non-recursive side of the filter. */ - /* The result here is not scaled down to allow for the magnification - effect of the filter (the usual DFT magnification effect). */ - return s->v3 * s->v3 + s->v2 * s->v2 - s->v2 * s->v3 * s->fac; -} - -/*- End of function --------------------------------------------------------*/ -/*- End of file ------------------------------------------------------------*/ diff --git a/src/mod/endpoints/mod_gsmopen/asterisk/celliax_spandsp.h b/src/mod/endpoints/mod_gsmopen/asterisk/celliax_spandsp.h deleted file mode 100644 index 2fed42d089..0000000000 --- a/src/mod/endpoints/mod_gsmopen/asterisk/celliax_spandsp.h +++ /dev/null @@ -1,1028 +0,0 @@ - -/* - * SpanDSP - a series of DSP components for telephony - * - * bit_operations.h - Various bit level operations, such as bit reversal - * - * Written by Steve Underwood - * - * Copyright (C) 2006 Steve Underwood - * - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2, as - * published by the Free Software Foundation. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * $Id: bit_operations.h,v 1.15 2007/02/23 13:16:13 steveu Exp $ - */ - -/*! \file */ - -#ifndef _CELLIAX_SPANDSP_H -#define _CELLIAX_SPANDSP_H - -#include - -/*! \brief Find the bit position of the highest set bit in a word - \param bits The word to be searched - \return The bit number of the highest set bit, or -1 if the word is zero. */ -static __inline__ int top_bit(unsigned int bits) -{ - int res; - -#if defined(__i386__) || defined(__x86_64__) -__asm__(" xorl %[res],%[res];\n" " decl %[res];\n" " bsrl %[bits],%[res]\n":[res] "=&r" - (res) -: [bits] "rm"(bits)); - return res; -#elif defined(__ppc__) || defined(__powerpc__) -__asm__("cntlzw %[res],%[bits];\n":[res] "=&r"(res) -: [bits] "r"(bits)); - return 31 - res; -#else - if (bits == 0) - return -1; - res = 0; - if (bits & 0xFFFF0000) { - bits &= 0xFFFF0000; - res += 16; - } - if (bits & 0xFF00FF00) { - bits &= 0xFF00FF00; - res += 8; - } - if (bits & 0xF0F0F0F0) { - bits &= 0xF0F0F0F0; - res += 4; - } - if (bits & 0xCCCCCCCC) { - bits &= 0xCCCCCCCC; - res += 2; - } - if (bits & 0xAAAAAAAA) { - bits &= 0xAAAAAAAA; - res += 1; - } - return res; -#endif -} - -/*- End of function --------------------------------------------------------*/ - -/*! \brief Find the bit position of the lowest set bit in a word - \param bits The word to be searched - \return The bit number of the lowest set bit, or -1 if the word is zero. */ -static __inline__ int bottom_bit(unsigned int bits) -{ - int res; - -#if defined(__i386__) || defined(__x86_64__) -__asm__(" xorl %[res],%[res];\n" " decl %[res];\n" " bsfl %[bits],%[res]\n":[res] "=&r" - (res) -: [bits] "rm"(bits)); - return res; -#else - if (bits == 0) - return -1; - res = 31; - if (bits & 0x0000FFFF) { - bits &= 0x0000FFFF; - res -= 16; - } - if (bits & 0x00FF00FF) { - bits &= 0x00FF00FF; - res -= 8; - } - if (bits & 0x0F0F0F0F) { - bits &= 0x0F0F0F0F; - res -= 4; - } - if (bits & 0x33333333) { - bits &= 0x33333333; - res -= 2; - } - if (bits & 0x55555555) { - bits &= 0x55555555; - res -= 1; - } - return res; -#endif -} - -/*- End of function --------------------------------------------------------*/ - -/*! \brief Bit reverse a byte. - \param data The byte to be reversed. - \return The bit reversed version of data. */ -static __inline__ uint8_t bit_reverse8(uint8_t x) -{ -#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__powerpc__) - /* If multiply is fast */ - return ((x * 0x0802U & 0x22110U) | (x * 0x8020U & 0x88440U)) * 0x10101U >> 16; -#else - /* If multiply is slow, but we have a barrel shifter */ - x = (x >> 4) | (x << 4); - x = ((x & 0xCC) >> 2) | ((x & 0x33) << 2); - return ((x & 0xAA) >> 1) | ((x & 0x55) << 1); -#endif -} - -/*- End of function --------------------------------------------------------*/ - -/*! \brief Bit reverse a 16 bit word. - \param data The word to be reversed. - \return The bit reversed version of data. */ -uint16_t bit_reverse16(uint16_t data); - -/*! \brief Bit reverse a 32 bit word. - \param data The word to be reversed. - \return The bit reversed version of data. */ -uint32_t bit_reverse32(uint32_t data); - -/*! \brief Bit reverse each of the four bytes in a 32 bit word. - \param data The word to be reversed. - \return The bit reversed version of data. */ -uint32_t bit_reverse_4bytes(uint32_t data); - -#if defined(__x86_64__) -/*! \brief Bit reverse each of the eight bytes in a 64 bit word. - \param data The word to be reversed. - \return The bit reversed version of data. */ -uint64_t bit_reverse_8bytes(uint64_t data); -#endif - -/*! \brief Bit reverse each bytes in a buffer. - \param to The buffer to place the reversed data in. - \param from The buffer containing the data to be reversed. - \param The length of the data in the buffer. */ -void bit_reverse(uint8_t to[], const uint8_t from[], int len); - -/*! \brief Find the number of set bits in a 32 bit word. - \param x The word to be searched. - \return The number of set bits. */ -int one_bits32(uint32_t x); - -/*! \brief Create a mask as wide as the number in a 32 bit word. - \param x The word to be searched. - \return The mask. */ -uint32_t make_mask32(uint32_t x); - -/*! \brief Create a mask as wide as the number in a 16 bit word. - \param x The word to be searched. - \return The mask. */ -uint16_t make_mask16(uint16_t x); - -/*! \brief Find the least significant one in a word, and return a word - with just that bit set. - \param x The word to be searched. - \return The word with the single set bit. */ -static __inline__ uint32_t least_significant_one32(uint32_t x) -{ - return (x & (-(int32_t) x)); -} - -/*- End of function --------------------------------------------------------*/ - -/*! \brief Find the most significant one in a word, and return a word - with just that bit set. - \param x The word to be searched. - \return The word with the single set bit. */ -static __inline__ uint32_t most_significant_one32(uint32_t x) -{ -#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__powerpc__) - return 1 << top_bit(x); -#else - x = make_mask32(x); - return (x ^ (x >> 1)); -#endif -} - -/*- End of function --------------------------------------------------------*/ - -/*! \brief Find the parity of a byte. - \param x The byte to be checked. - \return 1 for odd, or 0 for even. */ -static __inline__ int parity8(uint8_t x) -{ - x = (x ^ (x >> 4)) & 0x0F; - return (0x6996 >> x) & 1; -} - -/*- End of function --------------------------------------------------------*/ - -/*! \brief Find the parity of a 16 bit word. - \param x The word to be checked. - \return 1 for odd, or 0 for even. */ -static __inline__ int parity16(uint16_t x) -{ - x ^= (x >> 8); - x = (x ^ (x >> 4)) & 0x0F; - return (0x6996 >> x) & 1; -} - -/*- End of function --------------------------------------------------------*/ - -/*! \brief Find the parity of a 32 bit word. - \param x The word to be checked. - \return 1 for odd, or 0 for even. */ -static __inline__ int parity32(uint32_t x) -{ - x ^= (x >> 16); - x ^= (x >> 8); - x = (x ^ (x >> 4)) & 0x0F; - return (0x6996 >> x) & 1; -} - -/*- End of function --------------------------------------------------------*/ - -/*- End of file ------------------------------------------------------------*/ -/* - * SpanDSP - a series of DSP components for telephony - * - * fir.h - General telephony FIR routines - * - * Written by Steve Underwood - * - * Copyright (C) 2002 Steve Underwood - * - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2, as - * published by the Free Software Foundation. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * $Id: fir.h,v 1.8 2006/10/24 13:45:28 steveu Exp $ - */ - -/*! \page fir_page FIR filtering -\section fir_page_sec_1 What does it do? -???. - -\section fir_page_sec_2 How does it work? -???. -*/ - -#if 0 -#if defined(USE_MMX) || defined(USE_SSE2) -#include "mmx.h" -#endif - -/*! - 16 bit integer FIR descriptor. This defines the working state for a single - instance of an FIR filter using 16 bit integer coefficients. -*/ -typedef struct { - int taps; - int curr_pos; - const int16_t *coeffs; - int16_t *history; -} fir16_state_t; - -/*! - 32 bit integer FIR descriptor. This defines the working state for a single - instance of an FIR filter using 32 bit integer coefficients, and filtering - 16 bit integer data. -*/ -typedef struct { - int taps; - int curr_pos; - const int32_t *coeffs; - int16_t *history; -} fir32_state_t; - -/*! - Floating point FIR descriptor. This defines the working state for a single - instance of an FIR filter using floating point coefficients and data. -*/ -typedef struct { - int taps; - int curr_pos; - const float *coeffs; - float *history; -} fir_float_state_t; - -static __inline__ const int16_t *fir16_create(fir16_state_t * fir, const int16_t * coeffs, - int taps) -{ - fir->taps = taps; - fir->curr_pos = taps - 1; - fir->coeffs = coeffs; -#if defined(USE_MMX) || defined(USE_SSE2) - if ((fir->history = malloc(2 * taps * sizeof(int16_t)))) - memset(fir->history, 0, 2 * taps * sizeof(int16_t)); -#else - if ((fir->history = (int16_t *) malloc(taps * sizeof(int16_t)))) - memset(fir->history, 0, taps * sizeof(int16_t)); -#endif - return fir->history; -} - -/*- End of function --------------------------------------------------------*/ - -static __inline__ void fir16_flush(fir16_state_t * fir) -{ -#if defined(USE_MMX) || defined(USE_SSE2) - memset(fir->history, 0, 2 * fir->taps * sizeof(int16_t)); -#else - memset(fir->history, 0, fir->taps * sizeof(int16_t)); -#endif -} - -/*- End of function --------------------------------------------------------*/ - -static __inline__ void fir16_free(fir16_state_t * fir) -{ - free(fir->history); -} - -/*- End of function --------------------------------------------------------*/ - -static __inline__ int16_t fir16(fir16_state_t * fir, int16_t sample) -{ - int i; - int32_t y; -#if defined(USE_MMX) - mmx_t *mmx_coeffs; - mmx_t *mmx_hist; - - fir->history[fir->curr_pos] = sample; - fir->history[fir->curr_pos + fir->taps] = sample; - - mmx_coeffs = (mmx_t *) fir->coeffs; - mmx_hist = (mmx_t *) & fir->history[fir->curr_pos]; - i = fir->taps; - pxor_r2r(mm4, mm4); - /* 8 samples per iteration, so the filter must be a multiple of 8 long. */ - while (i > 0) { - movq_m2r(mmx_coeffs[0], mm0); - movq_m2r(mmx_coeffs[1], mm2); - movq_m2r(mmx_hist[0], mm1); - movq_m2r(mmx_hist[1], mm3); - mmx_coeffs += 2; - mmx_hist += 2; - pmaddwd_r2r(mm1, mm0); - pmaddwd_r2r(mm3, mm2); - paddd_r2r(mm0, mm4); - paddd_r2r(mm2, mm4); - i -= 8; - } - movq_r2r(mm4, mm0); - psrlq_i2r(32, mm0); - paddd_r2r(mm0, mm4); - movd_r2m(mm4, y); - emms(); -#elif defined(USE_SSE2) - xmm_t *xmm_coeffs; - xmm_t *xmm_hist; - - fir->history[fir->curr_pos] = sample; - fir->history[fir->curr_pos + fir->taps] = sample; - - xmm_coeffs = (xmm_t *) fir->coeffs; - xmm_hist = (xmm_t *) & fir->history[fir->curr_pos]; - i = fir->taps; - pxor_r2r(xmm4, xmm4); - /* 16 samples per iteration, so the filter must be a multiple of 16 long. */ - while (i > 0) { - movdqu_m2r(xmm_coeffs[0], xmm0); - movdqu_m2r(xmm_coeffs[1], xmm2); - movdqu_m2r(xmm_hist[0], xmm1); - movdqu_m2r(xmm_hist[1], xmm3); - xmm_coeffs += 2; - xmm_hist += 2; - pmaddwd_r2r(xmm1, xmm0); - pmaddwd_r2r(xmm3, xmm2); - paddd_r2r(xmm0, xmm4); - paddd_r2r(xmm2, xmm4); - i -= 16; - } - movdqa_r2r(xmm4, xmm0); - psrldq_i2r(8, xmm0); - paddd_r2r(xmm0, xmm4); - movdqa_r2r(xmm4, xmm0); - psrldq_i2r(4, xmm0); - paddd_r2r(xmm0, xmm4); - movd_r2m(xmm4, y); -#else - int offset1; - int offset2; - - fir->history[fir->curr_pos] = sample; - - offset2 = fir->curr_pos; - offset1 = fir->taps - offset2; - y = 0; - for (i = fir->taps - 1; i >= offset1; i--) - y += fir->coeffs[i] * fir->history[i - offset1]; - for (; i >= 0; i--) - y += fir->coeffs[i] * fir->history[i + offset2]; -#endif - if (fir->curr_pos <= 0) - fir->curr_pos = fir->taps; - fir->curr_pos--; - return (int16_t) (y >> 15); -} - -/*- End of function --------------------------------------------------------*/ - -static __inline__ const int16_t *fir32_create(fir32_state_t * fir, const int32_t * coeffs, - int taps) -{ - fir->taps = taps; - fir->curr_pos = taps - 1; - fir->coeffs = coeffs; - fir->history = (int16_t *) malloc(taps * sizeof(int16_t)); - if (fir->history) - memset(fir->history, '\0', taps * sizeof(int16_t)); - return fir->history; -} - -/*- End of function --------------------------------------------------------*/ - -static __inline__ void fir32_flush(fir32_state_t * fir) -{ - memset(fir->history, 0, fir->taps * sizeof(int16_t)); -} - -/*- End of function --------------------------------------------------------*/ - -static __inline__ void fir32_free(fir32_state_t * fir) -{ - free(fir->history); -} - -/*- End of function --------------------------------------------------------*/ - -static __inline__ int16_t fir32(fir32_state_t * fir, int16_t sample) -{ - int i; - int32_t y; - int offset1; - int offset2; - - fir->history[fir->curr_pos] = sample; - offset2 = fir->curr_pos; - offset1 = fir->taps - offset2; - y = 0; - for (i = fir->taps - 1; i >= offset1; i--) - y += fir->coeffs[i] * fir->history[i - offset1]; - for (; i >= 0; i--) - y += fir->coeffs[i] * fir->history[i + offset2]; - if (fir->curr_pos <= 0) - fir->curr_pos = fir->taps; - fir->curr_pos--; - return (int16_t) (y >> 15); -} - -/*- End of function --------------------------------------------------------*/ - -static __inline__ const float *fir_float_create(fir_float_state_t * fir, - const float *coeffs, int taps) -{ - fir->taps = taps; - fir->curr_pos = taps - 1; - fir->coeffs = coeffs; - fir->history = (float *) malloc(taps * sizeof(float)); - if (fir->history) - memset(fir->history, '\0', taps * sizeof(float)); - return fir->history; -} - -/*- End of function --------------------------------------------------------*/ - -static __inline__ void fir_float_free(fir_float_state_t * fir) -{ - free(fir->history); -} - -/*- End of function --------------------------------------------------------*/ - -static __inline__ int16_t fir_float(fir_float_state_t * fir, int16_t sample) -{ - int i; - float y; - int offset1; - int offset2; - - fir->history[fir->curr_pos] = sample; - - offset2 = fir->curr_pos; - offset1 = fir->taps - offset2; - y = 0; - for (i = fir->taps - 1; i >= offset1; i--) - y += fir->coeffs[i] * fir->history[i - offset1]; - for (; i >= 0; i--) - y += fir->coeffs[i] * fir->history[i + offset2]; - if (fir->curr_pos <= 0) - fir->curr_pos = fir->taps; - fir->curr_pos--; - return (int16_t) y; -} - -/*- End of function --------------------------------------------------------*/ -#endif - -/*- End of file ------------------------------------------------------------*/ - -/* - * SpanDSP - a series of DSP components for telephony - * - * echo.h - An echo cancellor, suitable for electrical and acoustic - * cancellation. This code does not currently comply with - * any relevant standards (e.g. G.164/5/7/8). - * - * Written by Steve Underwood - * - * Copyright (C) 2001 Steve Underwood - * - * Based on a bit from here, a bit from there, eye of toad, - * ear of bat, etc - plus, of course, my own 2 cents. - * - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2, as - * published by the Free Software Foundation. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * $Id: echo.h,v 1.9 2006/10/24 13:45:28 steveu Exp $ - */ - -/*! \file */ - -/*! \page echo_can_page Line echo cancellation for voice - -\section echo_can_page_sec_1 What does it do? -This module aims to provide G.168-2002 compliant echo cancellation, to remove -electrical echoes (e.g. from 2-4 wire hybrids) from voice calls. - -\section echo_can_page_sec_2 How does it work? -The heart of the echo cancellor is FIR filter. This is adapted to match the echo -impulse response of the telephone line. It must be long enough to adequately cover -the duration of that impulse response. The signal transmitted to the telephone line -is passed through the FIR filter. Once the FIR is properly adapted, the resulting -output is an estimate of the echo signal received from the line. This is subtracted -from the received signal. The result is an estimate of the signal which originated -at the far end of the line, free from echos of our own transmitted signal. - -The least mean squares (LMS) algorithm is attributed to Widrow and Hoff, and was -introduced in 1960. It is the commonest form of filter adaption used in things -like modem line equalisers and line echo cancellers. There it works very well. -However, it only works well for signals of constant amplitude. It works very poorly -for things like speech echo cancellation, where the signal level varies widely. -This is quite easy to fix. If the signal level is normalised - similar to applying -AGC - LMS can work as well for a signal of varying amplitude as it does for a modem -signal. This normalised least mean squares (NLMS) algorithm is the commonest one used -for speech echo cancellation. Many other algorithms exist - e.g. RLS (essentially -the same as Kalman filtering), FAP, etc. Some perform significantly better than NLMS. -However, factors such as computational complexity and patents favour the use of NLMS. - -A simple refinement to NLMS can improve its performance with speech. NLMS tends -to adapt best to the strongest parts of a signal. If the signal is white noise, -the NLMS algorithm works very well. However, speech has more low frequency than -high frequency content. Pre-whitening (i.e. filtering the signal to flatten -its spectrum) the echo signal improves the adapt rate for speech, and ensures the -final residual signal is not heavily biased towards high frequencies. A very low -complexity filter is adequate for this, so pre-whitening adds little to the -compute requirements of the echo canceller. - -An FIR filter adapted using pre-whitened NLMS performs well, provided certain -conditions are met: - - - The transmitted signal has poor self-correlation. - - There is no signal being generated within the environment being cancelled. - -The difficulty is that neither of these can be guaranteed. - -If the adaption is performed while transmitting noise (or something fairly noise -like, such as voice) the adaption works very well. If the adaption is performed -while transmitting something highly correlative (typically narrow band energy -such as signalling tones or DTMF), the adaption can go seriously wrong. The reason -is there is only one solution for the adaption on a near random signal - the impulse -response of the line. For a repetitive signal, there are any number of solutions -which converge the adaption, and nothing guides the adaption to choose the generalised -one. Allowing an untrained canceller to converge on this kind of narrowband -energy probably a good thing, since at least it cancels the tones. Allowing a well -converged canceller to continue converging on such energy is just a way to ruin -its generalised adaption. A narrowband detector is needed, so adapation can be -suspended at appropriate times. - -The adaption process is based on trying to eliminate the received signal. When -there is any signal from within the environment being cancelled it may upset the -adaption process. Similarly, if the signal we are transmitting is small, noise -may dominate and disturb the adaption process. If we can ensure that the -adaption is only performed when we are transmitting a significant signal level, -and the environment is not, things will be OK. Clearly, it is easy to tell when -we are sending a significant signal. Telling, if the environment is generating a -significant signal, and doing it with sufficient speed that the adaption will -not have diverged too much more we stop it, is a little harder. - -The key problem in detecting when the environment is sourcing significant energy -is that we must do this very quickly. Given a reasonably long sample of the -received signal, there are a number of strategies which may be used to assess -whether that signal contains a strong far end component. However, by the time -that assessment is complete the far end signal will have already caused major -mis-convergence in the adaption process. An assessment algorithm is needed which -produces a fairly accurate result from a very short burst of far end energy. - -\section echo_can_page_sec_3 How do I use it? -The echo cancellor processes both the transmit and receive streams sample by -sample. The processing function is not declared inline. Unfortunately, -cancellation requires many operations per sample, so the call overhead is only a -minor burden. -*/ - -#define NONUPDATE_DWELL_TIME 600 /* 600 samples, or 75ms */ - -#if 0 -/* Mask bits for the adaption mode */ -#define ECHO_CAN_USE_NLP 0x01 -#define ECHO_CAN_USE_SUPPRESSOR 0x02 -#define ECHO_CAN_USE_CNG 0x04 -#define ECHO_CAN_USE_ADAPTION 0x08 - -/*! - G.168 echo canceller descriptor. This defines the working state for a line - echo canceller. -*/ -typedef struct { - int tx_power[4]; - int rx_power[3]; - int clean_rx_power; - - int rx_power_threshold; - int nonupdate_dwell; - - fir16_state_t fir_state; - /*! Echo FIR taps (16 bit version) */ - int16_t *fir_taps16[4]; - /*! Echo FIR taps (32 bit version) */ - int32_t *fir_taps32; - - int curr_pos; - - int taps; - int tap_mask; - int adaption_mode; - - int32_t supp_test1; - int32_t supp_test2; - int32_t supp1; - int32_t supp2; - int vad; - int cng; - /* Parameters for the Hoth noise generator */ - int cng_level; - int cng_rndnum; - int cng_filter; - - int16_t geigel_max; - int geigel_lag; - int dtd_onset; - int tap_set; - int tap_rotate_counter; - - int32_t latest_correction; /* Indication of the magnitude of the latest - adaption, or a code to indicate why adaption - was skipped, for test purposes */ - int32_t last_acf[28]; - int narrowband_count; - int narrowband_score; -} echo_can_state_t; - -/*! Create a voice echo canceller context. - \param len The length of the canceller, in samples. - \return The new canceller context, or NULL if the canceller could not be created. -*/ -echo_can_state_t *echo_can_create(int len, int adaption_mode); - -/*! Free a voice echo canceller context. - \param ec The echo canceller context. -*/ -void echo_can_free(echo_can_state_t * ec); - -/*! Flush (reinitialise) a voice echo canceller context. - \param ec The echo canceller context. -*/ -void echo_can_flush(echo_can_state_t * ec); - -/*! Set the adaption mode of a voice echo canceller context. - \param ec The echo canceller context. - \param adapt The mode. -*/ -void echo_can_adaption_mode(echo_can_state_t * ec, int adaption_mode); - -/*! Process a sample through a voice echo canceller. - \param ec The echo canceller context. - \param tx The transmitted audio sample. - \param rx The received audio sample. - \return The clean (echo cancelled) received sample. -*/ -int16_t echo_can_update(echo_can_state_t * ec, int16_t tx, int16_t rx); - -#endif -/*- End of file ------------------------------------------------------------*/ - -/*! - Floating point Goertzel filter descriptor. -*/ -typedef struct { - float fac; - int samples; -} goertzel_descriptor_t; - -/*! - Floating point Goertzel filter state descriptor. -*/ -typedef struct { - float v2; - float v3; - float fac; - int samples; - int current_sample; -} goertzel_state_t; - -/*! \brief Create a descriptor for use with either a Goertzel transform */ -void make_goertzel_descriptor(goertzel_descriptor_t * t, float freq, int samples); - -/*! \brief Initialise the state of a Goertzel transform. - \param s The Goertzel context. If NULL, a context is allocated with malloc. - \param t The Goertzel descriptor. - \return A pointer to the Goertzel state. */ -goertzel_state_t *goertzel_init(goertzel_state_t * s, goertzel_descriptor_t * t); - -/*! \brief Reset the state of a Goertzel transform. - \param s The Goertzel context. - \param t The Goertzel descriptor. - \return A pointer to the Goertzel state. */ -void goertzel_reset(goertzel_state_t * s); - -/*! \brief Update the state of a Goertzel transform. - \param s The Goertzel context - \param amp The samples to be transformed - \param samples The number of samples - \return The number of samples unprocessed */ -int goertzel_update(goertzel_state_t * s, const int16_t amp[], int samples); - -/*! \brief Evaluate the final result of a Goertzel transform. - \param s The Goertzel context - \return The result of the transform. */ -float goertzel_result(goertzel_state_t * s); - -/*! \brief Update the state of a Goertzel transform. - \param s The Goertzel context - \param amp The sample to be transformed. */ -static __inline__ void goertzel_sample(goertzel_state_t * s, int16_t amp) -{ - float v1; - - v1 = s->v2; - s->v2 = s->v3; - s->v3 = s->fac * s->v2 - v1 + amp; - s->current_sample++; -} - -/*- End of function --------------------------------------------------------*/ - -/* - * SpanDSP - a series of DSP components for telephony - * - * tone_detect.c - General telephony tone detection. - * - * Written by Steve Underwood - * - * Copyright (C) 2001-2003, 2005 Steve Underwood - * - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2, as - * published by the Free Software Foundation. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * $Id: tone_detect.c,v 1.31 2007/03/03 10:40:33 steveu Exp $ - */ - -/*! \file tone_detect.h */ - -#if !defined(M_PI) -/* C99 systems may not define M_PI */ -#define M_PI 3.14159265358979323846264338327 -#endif -/*! \page dtmf_rx_page DTMF receiver -\section dtmf_rx_page_sec_1 What does it do? -The DTMF receiver detects the standard DTMF digits. It is compliant with -ITU-T Q.23, ITU-T Q.24, and the local DTMF specifications of most administrations. -Its passes the test suites. It also scores *very* well on the standard -talk-off tests. - -The current design uses floating point extensively. It is not tolerant of DC. -It is expected that a DC restore stage will be placed before the DTMF detector. -Unless the dial tone filter is switched on, the detector has poor tolerance -of dial tone. Whether this matter depends on your application. If you are using -the detector in an IVR application you will need proper echo cancellation to -get good performance in the presence of speech prompts, so dial tone will not -exist. If you do need good dial tone tolerance, a dial tone filter can be -enabled in the detector. - -\section dtmf_rx_page_sec_2 How does it work? -Like most other DSP based DTMF detector's, this one uses the Goertzel algorithm -to look for the DTMF tones. What makes each detector design different is just how -that algorithm is used. - -Basic DTMF specs: - - Minimum tone on = 40ms - - Minimum tone off = 50ms - - Maximum digit rate = 10 per second - - Normal twist <= 8dB accepted - - Reverse twist <= 4dB accepted - - S/N >= 15dB will detect OK - - Attenuation <= 26dB will detect OK - - Frequency tolerance +- 1.5% will detect, +-3.5% will reject - -TODO: -*/ - -/*! \page dtmf_tx_page DTMF tone generation -\section dtmf_tx_page_sec_1 What does it do? - -The DTMF tone generation module provides for the generation of the -repertoire of 16 DTMF dual tones. - -\section dtmf_tx_page_sec_2 How does it work? -*/ - -#define MAX_DTMF_DIGITS 128 - -typedef void (*dtmf_rx_callback_t) (void *user_data, const char *digits, int len); - -/*! - DTMF generator state descriptor. This defines the state of a single - working instance of a DTMF generator. -*/ -#if 0 -typedef struct { - tone_gen_descriptor_t *tone_descriptors; - tone_gen_state_t tones; - char digits[MAX_DTMF_DIGITS + 1]; - int current_sample; - size_t current_digits; -} dtmf_tx_state_t; - -#endif - -/*! - DTMF digit detector descriptor. -*/ -typedef struct { - /*! Optional callback funcion to deliver received digits. */ - dtmf_rx_callback_t callback; - /*! An opaque pointer passed to the callback function. */ - void *callback_data; - /*! Optional callback funcion to deliver real time digit state changes. */ - //tone_report_func_t realtime_callback; - void *realtime_callback; - /*! An opaque pointer passed to the real time callback function. */ - void *realtime_callback_data; - /*! TRUE if dialtone should be filtered before processing */ - int filter_dialtone; - /*! Maximum acceptable "normal" (lower bigger than higher) twist ratio */ - float normal_twist; - /*! Maximum acceptable "reverse" (higher bigger than lower) twist ratio */ - float reverse_twist; - - /*! 350Hz filter state for the optional dialtone filter */ - float z350_1; - float z350_2; - /*! 440Hz filter state for the optional dialtone filter */ - float z440_1; - float z440_2; - - /*! Tone detector working states */ - goertzel_state_t row_out[4]; - goertzel_state_t col_out[4]; - /*! The accumlating total energy on the same period over which the Goertzels work. */ - float energy; - /*! The result of the last tone analysis. */ - uint8_t last_hit; - /*! The confirmed digit we are currently receiving */ - uint8_t in_digit; - /*! The current sample number within a processing block. */ - int current_sample; - - /*! The received digits buffer. This is a NULL terminated string. */ - char digits[MAX_DTMF_DIGITS + 1]; - /*! The number of digits currently in the digit buffer. */ - int current_digits; - /*! The number of digits which have been lost due to buffer overflows. */ - int lost_digits; -} dtmf_rx_state_t; - -#if 0 -/*! \brief Generate a buffer of DTMF tones. - \param s The DTMF generator context. - \param amp The buffer for the generated signal. - \param max_samples The required number of generated samples. - \return The number of samples actually generated. This may be less than - samples if the input buffer empties. */ -int dtmf_tx(dtmf_tx_state_t * s, int16_t amp[], int max_samples); - -/*! \brief Put a string of digits in a DTMF generator's input buffer. - \param s The DTMF generator context. - \param digits The string of digits to be added. - \return The number of digits actually added. This may be less than the - length of the digit string, if the buffer fills up. */ -size_t dtmf_tx_put(dtmf_tx_state_t * s, const char *digits); - -/*! \brief Initialise a DTMF tone generator context. - \param s The DTMF generator context. - \return A pointer to the DTMF generator context. */ -dtmf_tx_state_t *dtmf_tx_init(dtmf_tx_state_t * s); -#endif - -/*! Set a optional realtime callback for a DTMF receiver context. This function - is called immediately a confirmed state change occurs in the received DTMF. It - is called with the ASCII value for a DTMF tone pair, or zero to indicate no tone - is being received. - \brief Set a realtime callback for a DTMF receiver context. - \param s The DTMF receiver context. - \param callback Callback routine used to report the start and end of digits. - \param user_data An opaque pointer which is associated with the context, - and supplied in callbacks. */ -void dtmf_rx_set_realtime_callback(dtmf_rx_state_t * s, - //tone_report_func_t callback, - void *callback, void *user_data); - -/*! \brief Adjust a DTMF receiver context. - \param s The DTMF receiver context. - \param filter_dialtone TRUE to enable filtering of dialtone, FALSE - to disable, < 0 to leave unchanged. - \param twist Acceptable twist, in dB. < 0 to leave unchanged. - \param reverse_twist Acceptable reverse twist, in dB. < 0 to leave unchanged. */ -void dtmf_rx_parms(dtmf_rx_state_t * s, int filter_dialtone, int twist, - int reverse_twist); - -/*! Process a block of received DTMF audio samples. - \brief Process a block of received DTMF audio samples. - \param s The DTMF receiver context. - \param amp The audio sample buffer. - \param samples The number of samples in the buffer. - \return The number of samples unprocessed. */ -int dtmf_rx(dtmf_rx_state_t * s, const int16_t amp[], int samples); - -/*! \brief Get a string of digits from a DTMF receiver's output buffer. - \param s The DTMF receiver context. - \param digits The buffer for the received digits. - \param max The maximum number of digits to be returned, - \return The number of digits actually returned. */ -size_t dtmf_rx_get(dtmf_rx_state_t * s, char *digits, int max); - -/*! \brief Initialise a DTMF receiver context. - \param s The DTMF receiver context. - \param callback An optional callback routine, used to report received digits. If - no callback routine is set, digits may be collected, using the dtmf_rx_get() - function. - \param user_data An opaque pointer which is associated with the context, - and supplied in callbacks. - \return A pointer to the DTMF receiver context. */ -dtmf_rx_state_t *dtmf_rx_init(dtmf_rx_state_t * s, dtmf_rx_callback_t callback, - void *user_data); - -/*- End of file ------------------------------------------------------------*/ - -#endif /* _CELLIAX_SPANDSP_H */ diff --git a/src/mod/endpoints/mod_gsmopen/asterisk/chan_celliax.c b/src/mod/endpoints/mod_gsmopen/asterisk/chan_celliax.c deleted file mode 100644 index 32c6fef4b8..0000000000 --- a/src/mod/endpoints/mod_gsmopen/asterisk/chan_celliax.c +++ /dev/null @@ -1,3094 +0,0 @@ -//indent -gnu -ts4 -br -brs -cdw -lp -ce -nbfda -npcs -nprs -npsl -nbbo -saf -sai -saw -cs -bbo -nhnl -nut -sob -l90 -#include "celliax.h" - -/* GLOBAL VARIABLES */ -char celliax_console_active_array[50] = ""; -char *celliax_console_active = celliax_console_active_array; -/*! \brief Count of active channels for this module */ -int celliax_usecnt = 0; -int celliax_debug = 0; -/*! \brief This is the thread for the monitor which checks for input on the channels - * which are not currently in use. */ -pthread_t celliax_monitor_thread = AST_PTHREADT_NULL; -pthread_t celliax_monitor_audio_thread = AST_PTHREADT_NULL; -int celliax_dir_entry_extension = 0; - -/* CONSTANTS */ -/*! \brief Name of configuration file for this module */ -const char celliax_config[] = "celliax.conf"; - -/*! \brief Textual description for this module */ -const char celliax_desc[] = "Celliax, Audio-Serial Driver"; -/*! \brief Textual type for this module */ -const char celliax_type[] = "Celliax"; - -/*! \brief Definition of this channel for PBX channel registration */ -const struct ast_channel_tech celliax_tech = { - .type = celliax_type, - .description = celliax_desc, - .capabilities = AST_FORMAT_SLINEAR, - .requester = celliax_request, - .hangup = celliax_hangup, - .answer = celliax_answer, - .read = celliax_read, - .call = celliax_call, - .write = celliax_write, - .indicate = celliax_indicate, - .fixup = celliax_fixup, - .devicestate = celliax_devicestate, -#ifdef ASTERISK_VERSION_1_4 - .send_digit_begin = celliax_senddigit_begin, - .send_digit_end = celliax_senddigit_end, -#else /* ASTERISK_VERSION_1_4 */ - .send_digit = celliax_senddigit, -#endif /* ASTERISK_VERSION_1_4 */ -}; - -#ifdef ASTERISK_VERSION_1_4 -#include "asterisk/abstract_jb.h" -/*! Global jitterbuffer configuration - by default, jb is disabled */ -static struct ast_jb_conf default_jbconf = { - .flags = 0, - .max_size = -1, - .resync_threshold = -1, - .impl = "" -}; -static struct ast_jb_conf global_jbconf; -#endif /* ASTERISK_VERSION_1_4 */ - - -#ifdef CELLIAX_ALSA -char celliax_console_alsa_period_usage[] = - "Usage: celliax_alsa_period [alsa_period_size, in bytes] [alsa_periods_in_buffer, how many]\n" - " Shows or set the values of the period and the buffer used by the ALSA subsistem. Standard values are 160 for alsa_period_size and 4 for alsa_periods_in_buffer. Without specifying a value, it just shows the current values. The values are for the \"current\" console (Celliax) channel.\n" - " Enter 'help console' on how to change the \"current\" console\n"; -#endif /* CELLIAX_ALSA */ - -char mandescr_celliax_sendsms[] = - "Description: Send an SMS through the designated Celliax interface.\n" "Variables: \n" - " Interface: The Celliax interface name you want to use.\n" - " Number: The recipient number you want to send the SMS to.\n" - " Text: The text of the SMS to be sent.\n" - " ActionID: The Action ID for this AMI transaction.\n"; - -char celliax_console_celliax_usage[] = - " \n" "chan_celliax commands info\n" " \n" - " chan_celliax adds to Asterisk the following CLI commands and DIALPLAN applications:\n" - " \n" " CLI COMMANDS:\n" " celliax_hangup\n" - " celliax_dial\n" " celliax_console\n" -#ifdef CELLIAX_DIR - " celliax_dir_import\n" " celliax_dir_export\n" -#endif /* CELLIAX_DIR */ - " celliax_playback_boost\n" " celliax_capture_boost\n" - " celliax_sendsms\n" " celliax_echo\n" " celliax_at\n" - " \n" " DIALPLAN APPLICATIONS:\n" " CelliaxSendsms\n" " \n" - " You can type 'help [command]' or 'show application [application]' to obtain more specific info on usage.\n" - " \n"; -char celliax_console_hangup_usage[] = - "Usage: celliax_hangup\n" - " Hangs up any call currently placed on the \"current\" celliax_console (Celliax) channel.\n" - " Enter 'help celliax_console' on how to change the \"current\" celliax_console\n"; -char celliax_console_playback_boost_usage[] = - "Usage: celliax_playback_boost [value]\n" - " Shows or set the value of boost applied to the outgoing sound (voice). Possible values are: 0 (no boost applied), -40 to 40 (negative to positive range, in db). Without specifying a value, it just shows the current value. The value is for the \"current\" celliax_console (Celliax) channel.\n" - " Enter 'help celliax_console' on how to change the \"current\" celliax_console\n"; -char celliax_console_capture_boost_usage[] = - "Usage: celliax_capture_boost [value]\n" - " Shows or set the value of boost applied to the incoming sound (voice). Possible values are: 0 (no boost applied), -40 to 40 (negative to positive range, in db). Without specifying a value, it just shows the current value. The value is for the \"current\" celliax_console (Celliax) channel.\n" - " Enter 'help celliax_console' on how to change the \"current\" celliax_console\n"; - -#ifdef CELLIAX_DIR -char celliax_console_celliax_dir_import_usage[] = - "Usage: celliax_dir_import [add | replace] fromcell\n" - " Write in the celliax_dir.conf config file all the entries found in the phonebook of the cellphone connected on the \"current\" celliax_console (Celliax) channel or in the 'Contacts' list of the Skype client.\n" - " Enter 'help celliax_console' on how to change the \"current\" celliax_console\n"; -char celliax_console_celliax_dir_export_usage[] = -#ifdef CELLIAX_LIBCSV - "Usage: celliax_dir_export tocell|tocsv celliax_cellphonenumber [csv_filename]\n" -#else /* CELLIAX_LIBCSV */ - "Usage: celliax_dir_export tocell celliax_cellphonenumber\n" -#endif /* CELLIAX_LIBCSV */ - " With 'tocell' modifier, write in the cellphone connected on the \"current\" celliax_console (Celliax) all the entries found in directoriax.conf, in the form: [celliax_cellphonenumber]wait_for_answer celliax_dir_prefix celliax_dir_entry. So, you can choose the new entry from the cellphone phonebook, dial it, and be directly connected to celliax_dir extension chosen, without having to pass through the voice menu.\n" -#ifdef CELLIAX_LIBCSV - " With 'tocsv' modifier, write in a file (Comma Separated Values, suitable to be imported by various software (eg Outlook) and smartphones) all the entries found in directoriax.conf, in the form: [celliax_cellphonenumber]wait_for_answer celliax_dir_prefix celliax_dir_entry. So, you can choose the new entry from the imported phonebook, dial it, and be directly connected to celliax_dir extension chosen, without having to pass through the voice menu.\n" -#endif /* CELLIAX_LIBCSV */ - " Enter 'help celliax_console' on how to change the \"current\" celliax_console\n"; - -#endif /* CELLIAX_DIR */ - -char celliax_console_dial_usage[] = - "Usage: celliax_dial [DTMFs]\n" - " Dials a given DTMF string in the call currently placed on the\n" - " \"current\" celliax_console (Celliax) channel.\n" - " Enter 'help celliax_console' on how to change the \"current\" celliax_console\n"; -char celliax_console_sendsms_usage[] = - "Usage: celliax_sendsms interfacename/number_to_send_sms_to SMS_TEXT\n" - " This CLI command will use the specified Celliax interface to send an SMS with content SMS_TEXT to the number_to_send_sms_to\n" - " Eg:\n" " celliax_sendsms nicephone/3472665618 \"ciao bello\"\n"; - -char celliax_console_celliax_console_usage[] = - "Usage: celliax_console [interface] | show\n" - " If used without a parameter, displays which interface is the \"current\"\n" - " celliax_console. If a device is specified, the \"current\" celliax_console is changed to\n" - " the interface specified.\n" - " If the parameter is \"show\", the available interfaces are listed\n"; -char *celliax_sendsmsapp = "CelliaxSendsms"; - -char *celliax_sendsmssynopsis = "CelliaxSendsms sends an SMS through the cellphone"; -char *celliax_sendsmsdescrip = - " CelliaxSendsms(interface_name / number_to_send_sms_to , SMS_TEXT):\n" - " This application will use the specified Celliax interface to send an SMS with content SMS_TEXT to the number_to_send_sms_to\n" - " Eg:\n" " CelliaxSendsms(nicephone/3472665618,\"ciao bello\")\n" " or\n" - " CelliaxSendsms(nicephone/3472665618,${DATETIME}\"ciao bello\")\n" "\n"; -char celliax_console_echo_usage[] = - "Usage: celliax_echo [0|1] [0|1]\n" - " Shows or set the values (0 meaning OFF and 1 meaning ON) of the echo suppression options: speexecho and speexpreprocess. Without specifying a value, it just shows the current values. The values are for the \"current\" celliax_console (Celliax) channel.\n" - " Enter 'help celliax_console' on how to change the \"current\" celliax_console\n"; -char celliax_console_at_usage[] = - "Usage: celliax_at [command string]\n" - " Send the 'command string' to the 'AT modem' (cellphone) connected to the \"current\" celliax_console (Celliax) channel.\n" - " Enter 'help celliax_console' on how to change the \"current\" celliax_console\n"; -/*! \brief fake celliax_pvt structure values, - * just for logging purposes */ -struct celliax_pvt celliax_log_struct = { - .name = "none", -}; - -/*! \brief Default celliax_pvt structure values, - * used by celliax_mkif to initialize the interfaces */ -struct celliax_pvt celliax_default = { - .readpos = AST_FRIENDLY_OFFSET, /* start here on reads */ - .oss_write_dst = 0, /* start here on reads */ - .interface_state = AST_STATE_DOWN, - .phone_callflow = CALLFLOW_CALL_IDLE, - .dsp_silence_threshold = 512, - .context = "default", - .language = "en", - .exten = "s", - .controldevice_name = "none", - .controldevfd = 0, - .next = NULL, - .owner = NULL, - .dsp = NULL, - .fbus2_outgoing_list = NULL, - .seqnumfbus = FBUS2_SEQNUM_MAX, - .controldev_thread = AST_PTHREADT_NULL, - .arraycounter = 0, -#ifndef GIOVA48 - .celliax_sound_rate = 8000, -#else // GIOVA48 - .celliax_sound_rate = 48000, -#endif // GIOVA48 - .celliax_sound_capt_fd = -1, - .need_acoustic_ring = 0, - .celliax_serial_synced_timestamp = 0, - .celliax_serial_sync_period = 300, - .audio_play_reset_timestamp = 0, - .audio_capture_reset_timestamp = 0, - .controldevice_speed = B38400, - .capture_boost = 0, - .playback_boost = 0, - .stripmsd = 0, - .controldev_dead = 0, - .dtmf_inited = 0, - .at_dial_pre_number = "AT+CKPD=\"", - //.at_dial_post_number = "S\"", - .at_dial_post_number = ";", - .at_dial_expect = "OK", - .at_early_audio = 0, - .at_hangup = "AT+CKPD=\"E\"", - .at_hangup_expect = "OK", - .at_answer = "ATA", - .at_answer_expect = "OK", - .at_send_dtmf = "AT+CKPD", - .at_initial_pause = 0, - .at_preinit_1 = "", - .at_preinit_1_expect = "", - .at_preinit_2 = "", - .at_preinit_2_expect = "", - .at_preinit_3 = "", - .at_preinit_3_expect = "", - .at_preinit_4 = "", - .at_preinit_4_expect = "", - .at_preinit_5 = "", - .at_preinit_5_expect = "", - .at_after_preinit_pause = 0, - .at_postinit_1 = "", - .at_postinit_1_expect = "", - .at_postinit_2 = "", - .at_postinit_2_expect = "", - .at_postinit_3 = "", - .at_postinit_3_expect = "", - .at_postinit_4 = "", - .at_postinit_4_expect = "", - .at_postinit_5 = "", - .at_postinit_5_expect = "", - .at_query_battchg = "", - .at_query_battchg_expect = "", - .at_query_signal = "", - .at_query_signal_expect = "", - .at_call_idle = "", - .at_call_incoming = "", - .at_call_active = "", - .at_call_failed = "", - .at_call_calling = "", - .at_indicator_noservice_string = "CIEV: 2,0", - .at_indicator_nosignal_string = "CIEV: 5,0", - .at_indicator_lowsignal_string = "CIEV: 5,1", - .at_indicator_lowbattchg_string = "CIEV: 0,1", - .at_indicator_nobattchg_string = "CIEV: 0,0", - .at_indicator_callactive_string = "CIEV: 3,1", - .at_indicator_nocallactive_string = "CIEV: 3,0", - .at_indicator_nocallsetup_string = "CIEV: 6,0", - .at_indicator_callsetupincoming_string = "CIEV: 6,1", - .at_indicator_callsetupoutgoing_string = "CIEV: 6,2", - .at_indicator_callsetupremoteringing_string = "CIEV: 6,3", - .at_has_clcc = 0, - .at_has_ecam = 0, - - .skype = 0, - .celliax_dir_entry_extension_prefix = 5, - -#ifdef CELLIAX_CVM - .cvm_subsc_1_pin = "0000", - .cvm_subsc_2_pin = "0000", - .cvm_subsc_no = 1, - .cvm_lock_state = CVM_UNKNOWN_LOCK_STATE, - .cvm_register_state = CVM_UNKNOWN_REGISTER_STATE, - .cvm_busmail_outgoing_list = NULL, - .busmail_rxseq_cvm_last = 0xFF, /*!< \brief sequential number of BUSMAIL messages, (0-7) */ - .busmail_txseq_celliax_last = 0xFF, /*!< \brief sequential number of BUSMAIL messages, (0-7) */ - .cvm_volume_level = 5, - .cvm_celliax_serial_delay = 200, /* 200ms delay after sending down the wire, fix for a bug ? */ - .cvm_handset_no = 0, - .cvm_fp_is_cvm = 0, - .cvm_rssi = 0, - -#endif /* CELLIAX_CVM */ -#ifdef CELLIAX_LIBCSV - .csv_separator_is_semicolon = 0, //FIXME as option - .csv_complete_name_pos = 4, //FIXME as option was 4 for outlook express and some outlook, other outlook 2 - .csv_email_pos = 6, //FIXME as option for outlook express - .csv_home_phone_pos = 32, //FIXME as option was 12 for outlook express - .csv_mobile_phone_pos = 33, //FIXME as option was 14 for outlook express - .csv_business_phone_pos = 41, //FIXME as option was 22 for outlook express - .csv_first_row_is_title = 1, //FIXME as option -#endif /* CELLIAX_LIBCSV */ - - .audio_play_reset_period = 0, //do not reset - - .isInputInterleaved = 1, - .isOutputInterleaved = 1, - .numInputChannels = 1, - .numOutputChannels = 1, -#ifndef GIOVA48 - .framesPerCallback = 160, -#else // GIOVA48 - .framesPerCallback = 960, -#endif // GIOVA48 - .speexecho = 1, - .speexpreprocess = 1, - .portaudiocindex = -1, - .portaudiopindex = -1, -#ifdef CELLIAX_ALSA - .alsa_period_size = 160, - .alsa_periods_in_buffer = 4, - .alsac = NULL, - .alsap = NULL, - .alsawrite_filled = 0, -#endif /* CELLIAX_ALSA */ - -}; - -/*! - * \brief PVT structure for a celliax interface (channel), created by celliax_mkif - */ -struct celliax_pvt *celliax_iflist = NULL; - -#ifdef ASTERISK_VERSION_1_6_0 -struct ast_cli_entry myclis[] = { - AST_CLI_DEFINE(celliax_console_hangup, "Hangup a call on the console"), - //AST_CLI_DEFINE(celliax_console_dial, "Dial an extension on the console"), - //AST_CLI_DEFINE(celliax_console_playback_boost, "Sets/displays spk boost in dB"), - //AST_CLI_DEFINE(celliax_console_capture_boost, "Sets/displays mic boost in dB"), - //AST_CLI_DEFINE(celliax_console_set_active, "Sets/displays active console"), - //AST_CLI_DEFINE(celliax_console_at, "Sends an AT command"), - //AST_CLI_DEFINE(celliax_console_echo, "Echo suppression"), -#ifdef CELLIAX_DIR - //AST_CLI_DEFINE(celliax_console_celliax_dir_import, "imports entries from cellphone"), - //AST_CLI_DEFINE(celliax_console_celliax_dir_export, "exports entries to cellphone"), -#endif /* CELLIAX_DIR */ - //AST_CLI_DEFINE(celliax_console_celliax, "all things celliax"), - //AST_CLI_DEFINE(celliax_console_sendsms, "Send an SMS from a Celliax interface"), -}; -#else -struct ast_cli_entry myclis[] = { - {{"celliax_hangup", NULL}, celliax_console_hangup, - "Hangup a call on the celliax_console", - celliax_console_hangup_usage}, - {{"celliax_playback_boost", NULL}, celliax_console_playback_boost, "playback boost", - celliax_console_playback_boost_usage}, - {{"celliax_capture_boost", NULL}, celliax_console_capture_boost, "capture boost", - celliax_console_capture_boost_usage}, - {{"celliax_usage", NULL}, celliax_console_celliax, "chan_celliax commands info", - celliax_console_celliax_usage}, - - {{"celliax_at", NULL}, celliax_console_at, "AT command", - celliax_console_at_usage}, - {{"celliax_echo", NULL}, celliax_console_echo, "echo suppression", - celliax_console_echo_usage}, -#ifdef CELLIAX_DIR - {{"celliax_dir_import", NULL}, celliax_console_celliax_dir_import, - "Write the celliax_dir.conf file, used by celliax_dir app", - celliax_console_celliax_dir_import_usage}, - {{"celliax_dir_export", NULL}, celliax_console_celliax_dir_export, - "Write in the cellphone the contents of the celliax_dir.conf file, used by celliax_dir app", - celliax_console_celliax_dir_export_usage}, -#endif /* CELLIAX_DIR */ -#ifdef CELLIAX_ALSA - {{"celliax_alsa_period", NULL}, console_alsa_period, "alsa_period", - celliax_console_alsa_period_usage}, -#endif /* CELLIAX_ALSA */ - - {{"celliax_dial", NULL}, celliax_console_dial, - "Dial an extension on the celliax_console", - celliax_console_dial_usage}, - {{"celliax_sendsms", NULL}, celliax_console_sendsms, - "Send an SMS from a Celliax interface", - celliax_console_sendsms_usage}, - {{"celliax_console", NULL}, celliax_console_set_active, - "Sets/displays active celliax_console", - celliax_console_celliax_console_usage}, -}; -#endif /* ASTERISK_VERSION_1_6_0 */ - -/* IMPLEMENTATION */ - -#ifdef CELLIAX_ALSA -int console_alsa_period(int fd, int argc, char *argv[]) -{ - struct celliax_pvt *p = celliax_console_find_desc(celliax_console_active); - - if (argc > 3 || argc == 2) - return RESULT_SHOWUSAGE; - if (!p) { - ast_cli(fd, - "No \"current\" console for alsa_period_size, please enter 'help console'\n"); - return RESULT_SUCCESS; - } - - if (argc == 1) { - ast_cli(fd, - "On the active console, that is [%s], alsa_period_size and alsa_periods_in_buffer are: %d and %d\n", - celliax_console_active, p->alsa_period_size, p->alsa_periods_in_buffer); - } else if (argc == 3) { - - if (p->owner) { - ast_cli(fd, - "CANNOT SET alsa_period_size and alsa_periods_in_buffer on the active console, that is [%s], because there is a call ongoing\n", - celliax_console_active); - return RESULT_SUCCESS; - } - sscanf(argv[1], "%d", &p->alsa_period_size); - sscanf(argv[2], "%d", &p->alsa_periods_in_buffer); - ast_cli(fd, - "alsa_period_size and alsa_periods_in_buffer on the active console, that is [%s], are now: %d and %d\n", - celliax_console_active, p->alsa_period_size, p->alsa_periods_in_buffer); - - if (celliax_monitor_audio_thread - && (celliax_monitor_audio_thread != AST_PTHREADT_NULL) - && (celliax_monitor_audio_thread != AST_PTHREADT_STOP)) { - - if (pthread_cancel(celliax_monitor_audio_thread)) { - ERRORA("pthread_cancel celliax_monitor_audio_thread failed, BAD\n", - CELLIAX_P_LOG); - } - if (pthread_kill(celliax_monitor_audio_thread, SIGURG)) { - DEBUGA_PBX("pthread_kill celliax_monitor_audio_thread failed, no problem\n", CELLIAX_P_LOG); //maybe it just died - } - - if (pthread_join(celliax_monitor_audio_thread, NULL)) { - ERRORA("pthread_join failed, BAD\n", CELLIAX_P_LOG); - } - } - - alsa_shutdown(p); - //sleep(5); - alsa_init(p); - - if (ast_pthread_create - (&celliax_monitor_audio_thread, NULL, celliax_do_audio_monitor, NULL) < 0) { - ERRORA("Unable to start audio_monitor thread.\n", CELLIAX_P_LOG); - return -1; - } - - ast_cli(fd, - "ACTIVATED alsa_period_size and alsa_periods_in_buffer on the active console\n"); - } - - return RESULT_SUCCESS; -} -#endif /* CELLIAX_ALSA */ - -void celliax_unlocka_log(void *x) -{ - ast_mutex_t *y; - y = x; - int i; - - for (i = 0; i < 5; i++) { //let's be generous - - ast_log(LOG_DEBUG, - CELLIAX_SVN_VERSION - "[%-7lx] I'm a dying thread, and I'm to go unlocking mutex %p for the %dth time\n", - (unsigned long int) pthread_self(), y, i); - - ast_mutex_unlock(y); - } - ast_log(LOG_DEBUG, - CELLIAX_SVN_VERSION - "[%-7lx] I'm a dying thread, I've finished unlocking mutex %p\n", - (unsigned long int) pthread_self(), y); -} - -int celliax_queue_control(struct ast_channel *c, int control) -{ - struct celliax_pvt *p = c->tech_pvt; - int times; - -/* queue the frame */ - if (p) - p->control_to_send = control; - else - return 0; - DEBUGA_PBX("Queued CONTROL FRAME %d\n", CELLIAX_P_LOG, control); - -/* wait for the frame to be sent */ - while (p->control_to_send){ - usleep(1000); - times++; - if(times == 1000){ - ERRORA("Queued CONTROL FRAME %d FAILED to be sent\n", CELLIAX_P_LOG, control); - p->control_to_send = 0; - break; - } - } - - return 0; -} - -int celliax_devicestate(void *data) -{ - struct celliax_pvt *p = NULL; - char *name = data; - int res = AST_DEVICE_INVALID; - - if (!data) { - ERRORA("Devicestate requested with no data\n", CELLIAX_P_LOG); - return res; - } - - /* lock the interfaces' list */ - LOKKA(&celliax_iflock); - /* make a pointer to the first interface in the interfaces list */ - p = celliax_iflist; - /* Search for the requested interface and verify if is unowned */ - while (p) { - size_t length = strlen(p->name); - /* is this the requested interface? */ - if (strncmp(name, p->name, length) == 0) { - /* is this interface unowned? */ - if (!p->owner) { - res = AST_DEVICE_NOT_INUSE; - DEBUGA_PBX("Interface is NOT OWNED by a channel\n", CELLIAX_P_LOG); - } else { - /* interface owned by a channel */ - res = AST_DEVICE_INUSE; - DEBUGA_PBX("Interface is OWNED by a channel\n", CELLIAX_P_LOG); - } - - /* we found the requested interface, bail out from the while loop */ - break; - } - /* not yet found, next please */ - p = p->next; - } - /* unlock the interfaces' list */ - UNLOCKA(&celliax_iflock); - - if (res == AST_DEVICE_INVALID) { - ERRORA("Checking device state for interface [%s] returning AST_DEVICE_INVALID\n", - CELLIAX_P_LOG, name); - } - return res; -} - -#ifndef ASTERISK_VERSION_1_4 -int celliax_indicate(struct ast_channel *c, int cond) -#else -int celliax_indicate(struct ast_channel *c, int cond, const void *data, size_t datalen) -#endif -{ - struct celliax_pvt *p = c->tech_pvt; - int res = 0; - - switch (cond) { - case AST_CONTROL_BUSY: - case AST_CONTROL_CONGESTION: - case AST_CONTROL_RINGING: - case -1: - NOTICA("Let's INDICATE %d\n", CELLIAX_P_LOG, cond); - res = -1; /* Ask for inband indications */ - break; - case AST_CONTROL_PROGRESS: - case AST_CONTROL_PROCEEDING: - case AST_CONTROL_VIDUPDATE: - case AST_CONTROL_HOLD: - case AST_CONTROL_UNHOLD: -#ifdef ASTERISK_VERSION_1_4 - //FIXME case AST_CONTROL_SRCUPDATE: -#endif /* ASTERISK_VERSION_1_4 */ - NOTICA("Let's NOT INDICATE %d\n", CELLIAX_P_LOG, cond); - break; - default: - WARNINGA("Don't know how to display condition %d on %s\n", CELLIAX_P_LOG, cond, - c->name); - /* The core will play inband indications for us if appropriate */ - res = -1; - } - - return res; -} - -/*! \brief PBX interface function -build celliax pvt structure - * celliax calls initiated by the PBX arrive here */ -struct ast_channel *celliax_request(const char *type, int format, void *data, int *cause) -{ - struct celliax_pvt *p = NULL; - struct ast_channel *tmp = NULL; - char *name = data; - - if (option_debug) { - DEBUGA_PBX("ENTERING FUNC\n", CELLIAX_P_LOG); - } - - DEBUGA_PBX("Try to request type: %s, name: %s, cause: %d," " format: %d\n", - CELLIAX_P_LOG, type, name, *cause, format); - - if (!data) { - ERRORA("Channel requested with no data\n", CELLIAX_P_LOG); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return NULL; - } - - /* lock the interfaces' list */ - LOKKA(&celliax_iflock); - /* make a pointer to the first interface in the interfaces list */ - p = celliax_iflist; - /* Search for the requested interface and verify if is unowned and format compatible */ - //TODO implement groups a la chan_zap - while (p) { - size_t length = strlen(p->name); - /* is this the requested interface? */ - if (strncmp(name, p->name, length) == 0) { - /* is the requested format supported by this interface? */ - if ((format & AST_FORMAT_SLINEAR) != 0) { - /* is this interface unowned? */ - if (!p->owner) { - DEBUGA_PBX("Requesting: %s, name: %s, format: %d\n", CELLIAX_P_LOG, type, name, - format); - /* create a new channel owning this interface */ - tmp = celliax_new(p, AST_STATE_DOWN, p->context); - if (!tmp) { - /* the channel was not created, probable memory allocation error */ - *cause = AST_CAUSE_SWITCH_CONGESTION; - } - } else { - /* interface owned by another channel */ - WARNINGA("owned by another channel\n", CELLIAX_P_LOG); - *cause = AST_CAUSE_REQUESTED_CHAN_UNAVAIL; - } - } else { - /* requested format not supported */ - WARNINGA("format %d not supported\n", CELLIAX_P_LOG, format); - *cause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL; - } - /* we found the requested interface, bail out from the while loop */ - break; - } - /* not yet found, next please */ - p = p->next; - } - /* unlock the interfaces' list */ - UNLOCKA(&celliax_iflock); - /* restart the monitor so it will watch only the remaining unowned interfaces */ - celliax_restart_monitor(); - if (tmp == NULL) { - /* new channel was not created */ - WARNINGA("Unable to create new Celliax channel %s\n", CELLIAX_P_LOG, name); - } - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - /* return the newly created channel */ - return tmp; -} - -/*! \brief Hangup celliax call - * Part of PBX interface, called from ast_hangup */ - -int celliax_hangup(struct ast_channel *c) -{ - struct celliax_pvt *p; - int res; - - /* get our celliax pvt interface from channel */ - p = c->tech_pvt; - /* if there is not celliax pvt why we are here ? */ - if (!p) { - ERRORA("Asked to hangup channel not connected\n", CELLIAX_P_LOG); - return 0; - } - - if (option_debug) { - DEBUGA_PBX("ENTERING FUNC\n", CELLIAX_P_LOG); - } - - p->phone_callflow = CALLFLOW_CALL_HANGUP_REQUESTED; - /* shutdown the serial monitoring thread */ - if (p->controldev_thread && (p->controldev_thread != AST_PTHREADT_NULL) - && (p->controldev_thread != AST_PTHREADT_STOP)) { - if (pthread_cancel(p->controldev_thread)) { - ERRORA("controldev_thread pthread_cancel failed, maybe he killed himself?\n", - CELLIAX_P_LOG); - } - /* push it, maybe is stuck in a select or so */ - if (pthread_kill(p->controldev_thread, SIGURG)) { - DEBUGA_SERIAL("controldev_thread pthread_kill failed, no problem\n", CELLIAX_P_LOG); - } -#ifndef __CYGWIN__ /* under cygwin, this seems to be not reliable, get stuck at times */ - /* wait for it to die */ - if (pthread_join(p->controldev_thread, NULL)) { - ERRORA("controldev_thread pthread_join failed, BAD\n", CELLIAX_P_LOG); - } -#else /* __CYGWIN__ */ -/* allow the serial thread to die */ - usleep(300000); //300msecs -#endif /* __CYGWIN__ */ - } - p->controldev_thread = AST_PTHREADT_NULL; - - if (p->controldevprotocol != PROTOCOL_NO_SERIAL) { - if (p->interface_state != AST_STATE_DOWN) { - /* actually hangup through the serial port */ - if (p->controldevprotocol != PROTOCOL_NO_SERIAL) { - res = celliax_serial_hangup(p); - if (res) { - ERRORA("celliax_serial_hangup error: %d\n", CELLIAX_P_LOG, res); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return -1; - } - } - - while (p->interface_state != AST_STATE_DOWN) { - usleep(10000); //10msec - } - if (p->interface_state != AST_STATE_DOWN) { - ERRORA("call hangup failed\n", CELLIAX_P_LOG); - return -1; - } else { - DEBUGA_SERIAL("call hungup\n", CELLIAX_P_LOG); - } - } - } else { - p->interface_state = AST_STATE_DOWN; - p->phone_callflow = CALLFLOW_CALL_IDLE; - } - /* if there is a dsp struct alloced, free it */ - if (p->dsp) { - ast_dsp_free(p->dsp); - p->dsp = NULL; - } -#ifndef __CYGWIN__ -#ifdef CELLIAX_ALSA -/* restart alsa */ - snd_pcm_drop(p->alsap); - snd_pcm_prepare(p->alsap); - - snd_pcm_prepare(p->alsac); - snd_pcm_start(p->alsac); - - /* shutdown the sound system, close sound fds, and if exist shutdown the sound managing threads */ - DEBUGA_SOUND("shutting down sound\n", CELLIAX_P_LOG); - res = celliax_sound_shutdown(p); - if (res == -1) { - ERRORA("Failed to shutdown sound\n", CELLIAX_P_LOG); - } - - -#endif /* CELLIAX_ALSA */ - -#endif /* __CYGWIN__ */ -#ifdef CELLIAX_PORTAUDIO - speex_echo_state_reset(p->stream->echo_state); -#endif // CELLIAX_PORTAUDIO - - /* re-init the serial port, be paranoid */ - if (p->controldevprotocol != PROTOCOL_NO_SERIAL) { - p->controldevfd = celliax_serial_init(p, p->controldevice_speed); - if (p->controldevfd < 1) { - ERRORA("bad, bad, bad\n", CELLIAX_P_LOG); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return -1; - } - } -#ifndef ASTERISK_VERSION_1_4 - /* subtract one to the usage count of Celliax-type channels */ - LOKKA(&celliax_usecnt_lock); - celliax_usecnt--; - if (celliax_usecnt < 0) - ERRORA("Usecnt < 0???\n", CELLIAX_P_LOG); - UNLOCKA(&celliax_usecnt_lock); - ast_update_use_count(); -#else /* ASTERISK_VERSION_1_4 */ - ast_module_unref(ast_module_info->self); -#endif /* ASTERISK_VERSION_1_4 */ - - /* our celliax pvt interface is no more part of a channel */ - p->owner = NULL; - /* our channel has no more this celliax pvt interface to manage */ - c->tech_pvt = NULL; - /* set the channel state to DOWN, eg. available, not in active use */ - if (ast_setstate(c, AST_STATE_DOWN)) { - ERRORA("ast_setstate failed, BAD\n", CELLIAX_P_LOG); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return -1; - } - - if (option_debug) - DEBUGA_PBX("Hanged Up\n", CELLIAX_P_LOG); - /* restart the monitor thread, so it can recheck which interfaces it have to watch during its loop (the interfaces that are not owned by channels) */ - if (celliax_restart_monitor()) { - ERRORA("celliax_restart_monitor failed, BAD\n", CELLIAX_P_LOG); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return -1; - } - - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return 0; -} - -/*! \brief Answer incoming call, - * Part of PBX interface */ -int celliax_answer(struct ast_channel *c) -{ - struct celliax_pvt *p = c->tech_pvt; - int res; - - if (option_debug) { - DEBUGA_PBX("ENTERING FUNC\n", CELLIAX_P_LOG); - } - /* do something to actually answer the call, if needed (eg. pick up the phone) */ - if (p->controldevprotocol != PROTOCOL_NO_SERIAL) { - if (celliax_serial_answer(p)) { - ERRORA("celliax_answer FAILED\n", CELLIAX_P_LOG); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return -1; - } - } - p->interface_state = AST_STATE_UP; - p->phone_callflow = CALLFLOW_CALL_ACTIVE; - - while (p->interface_state == AST_STATE_RING) { - usleep(10000); //10msec - } - if (p->interface_state != AST_STATE_UP) { - ERRORA("call answering failed\n", CELLIAX_P_LOG); - res = -1; - } else { - if (option_debug) - DEBUGA_PBX("call answered\n", CELLIAX_P_LOG); - res = 0; -#ifdef CELLIAX_PORTAUDIO - speex_echo_state_reset(p->stream->echo_state); -#endif // CELLIAX_PORTAUDIO - - if (p->owner) { - DEBUGA_PBX("going to send AST_STATE_UP\n", CELLIAX_P_LOG); - ast_setstate(p->owner, AST_STATE_UP); - //ast_queue_control(p->owner, AST_CONTROL_ANSWER); - //celliax_queue_control(p->owner, AST_CONTROL_ANSWER); - DEBUGA_PBX("just sent AST_STATE_UP\n", CELLIAX_P_LOG); - } - } - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return res; -} - -#ifdef ASTERISK_VERSION_1_4 -int celliax_senddigit_begin(struct ast_channel *c, char digit) -{ - struct celliax_pvt *p = c->tech_pvt; - - DEBUGA_PBX("DIGIT BEGIN received: %c\n", CELLIAX_P_LOG, digit); - - return 0; -} - -int celliax_senddigit_end(struct ast_channel *c, char digit, unsigned int duration) -{ - struct celliax_pvt *p = c->tech_pvt; - - NOTICA("DIGIT END received: %c %d\n", CELLIAX_P_LOG, digit, duration); - - if (p->controldevprotocol == PROTOCOL_AT && p->at_send_dtmf[0]) { - int res = 0; - char at_command[256]; - - memset(at_command, '\0', 256); - sprintf(at_command, "%s=\"%c\"", p->at_send_dtmf, digit); - res = celliax_serial_write_AT_ack(p, at_command); - if (res) { - ERRORA("senddigit command failed, command used: '%s=\"%c\"', giving up\n", - CELLIAX_P_LOG, p->at_send_dtmf, digit); - } - } - return 0; -} -#else /* ASTERISK_VERSION_1_4 */ -int celliax_senddigit(struct ast_channel *c, char digit) -{ - struct celliax_pvt *p = c->tech_pvt; - - NOTICA("DIGIT received: %c\n", CELLIAX_P_LOG, digit); - - if (p->controldevprotocol == PROTOCOL_AT && p->at_send_dtmf[0]) { - int res = 0; - char at_command[256]; - - memset(at_command, '\0', 256); - sprintf(at_command, "%s=\"%c\"", p->at_send_dtmf, digit); - res = celliax_serial_write_AT_ack(p, at_command); - if (res) { - ERRORA("senddigit command failed, command used: '%s=\"%c\"', giving up\n", - CELLIAX_P_LOG, p->at_send_dtmf, digit); - } - } - return 0; -} - -#endif /* ASTERISK_VERSION_1_4 */ - -/*! \brief Read audio frames from channel */ -struct ast_frame *celliax_read(struct ast_channel *c) -{ - struct ast_frame *f; - struct celliax_pvt *p = c->tech_pvt; - int actual; - char buf[128 + 1]; - - if (p->dtmf_inited == 0) { - dtmf_rx_init(&p->dtmf_state, NULL, NULL); - p->dtmf_inited = 1; - dtmf_rx_parms(&p->dtmf_state, 0, 10, 10); - p->dtmf_timestamp.tv_sec=0; - p->dtmf_timestamp.tv_usec=0; - DEBUGA_SOUND("DTMF recognition inited\n", CELLIAX_P_LOG); - } - -/* if there are control frames queued to be sent by celliax_queue_control, send it the first */ -//FIXME maybe better a real queue? - if (p && p->owner && p->control_to_send) { - ast_queue_control(p->owner, p->control_to_send); - DEBUGA_PBX("Sent CONTROL FRAME %d\n", CELLIAX_P_LOG, p->control_to_send); - p->control_to_send = 0; - } - -#ifdef CELLIAX_PORTAUDIO -/* if the call is not active (ie: answered), do not send audio frames, they would pile up in a lag queue */ - if (!p->owner || p->owner->_state != AST_STATE_UP) -#else /* CELLIAX_PORTAUDIO */ - if (!p->owner ) -#endif /* CELLIAX_PORTAUDIO */ - { - static struct ast_frame f; -#ifdef CELLIAX_PORTAUDIO - char c; -#endif /* CELLIAX_PORTAUDIO */ - - f.frametype = AST_FRAME_NULL; - f.subclass = 0; - f.samples = 0; - f.datalen = 0; -#ifdef ASTERISK_VERSION_1_6_0_1 - f.data.ptr = NULL; -#else - f.data = NULL; -#endif /* ASTERISK_VERSION_1_6_0_1 */ - f.offset = 0; - f.src = celliax_type; - f.mallocd = 0; - f.delivery.tv_sec = 0; - f.delivery.tv_usec = 0; -/* read the char that was written by the audio thread in this pipe, this pipe is the fd monitored by asterisk, asterisk then has called the function we are inside) */ -#ifdef CELLIAX_PORTAUDIO - read(p->audiopipe[0], &c, 1); -#endif /* CELLIAX_PORTAUDIO */ - - return &f; - } - - /* read one asterisk frame of audio from sound interface */ - f = celliax_sound_read(p); - if (f) { - struct timeval now_timestamp; -#ifndef __CYGWIN__ -#ifdef CELLIAX_PORTAUDIO - char c[1000]; - int letti = 2; - - while (letti > 1) { - letti = read(p->audiopipe[0], &c, 1000); - if (letti > 0) - DEBUGA_SOUND("READ from audiopipe: %d\n", CELLIAX_P_LOG, letti); - //usleep(1); - } - //if(letti == -1) - //ERRORA("error: %s\n", CELLIAX_P_LOG, strerror(errno)); -#endif /* CELLIAX_PORTAUDIO */ -#endif /* __CYGWIN__ */ - - /* scale sound samples volume up or down */ - celliax_sound_boost(f, p->capture_boost); - - gettimeofday(&now_timestamp, NULL); - - if( (((now_timestamp.tv_sec - p->dtmf_timestamp.tv_sec) * 1000000) < 0) || ( ((now_timestamp.tv_sec - p->dtmf_timestamp.tv_sec) * 1000000) + (now_timestamp.tv_usec - p->dtmf_timestamp.tv_usec) ) > 300000) { // if more than 0.3 seconds from last DTMF, or never got DTMFs before - -#ifdef ASTERISK_VERSION_1_6_0_1 - dtmf_rx(&p->dtmf_state, f->data.ptr, f->samples); -#else - dtmf_rx(&p->dtmf_state, f->data, f->samples); -#endif /* ASTERISK_VERSION_1_6_0_1 */ - actual = dtmf_rx_get(&p->dtmf_state, buf, 128); - if (actual) { - //if (option_debug) - NOTICA("delta_usec=%ld, inband audio DTMF: %s\n", CELLIAX_P_LOG, ( (now_timestamp.tv_sec - p->dtmf_timestamp.tv_sec) * 1000000) + (now_timestamp.tv_usec - p->dtmf_timestamp.tv_usec), buf); - struct ast_frame f2 = { AST_FRAME_DTMF, buf[0], }; - ast_queue_frame(p->owner, &f2); - gettimeofday(&p->dtmf_timestamp, NULL); - } - } - return f; - } - return NULL; -} - -/*! \brief Initiate celliax call from PBX - * used from the dial() application - */ -int celliax_call(struct ast_channel *c, char *idest, int timeout) -{ - struct celliax_pvt *p = NULL; - p = c->tech_pvt; - char rdest[80], *where, dstr[100] = ""; - char *stringp = NULL; - int status; - - if (option_debug) { - DEBUGA_PBX("ENTERING FUNC\n", CELLIAX_P_LOG); - } - if ((c->_state != AST_STATE_DOWN) - && (c->_state != AST_STATE_RESERVED)) { - ERRORA("celliax_call called on %s, neither down nor reserved\n", CELLIAX_P_LOG, - c->name); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return -1; - } - - if (option_debug > 1) - DEBUGA_PBX("celliax_call to call idest: %s, timeout: %d!\n", CELLIAX_P_LOG, idest, - timeout); - - strncpy(rdest, idest, sizeof(rdest) - 1); - // try '/' as separator - stringp = rdest; - strsep(&stringp, "/"); - where = strsep(&stringp, "/"); - - if (!where) { - ERRORA - ("Destination %s is not recognized. Chan_celliax requires a standard destination with slashes (Celliax/device/destination, eg: 'Celliax/nicephone/3472665618')\n", - CELLIAX_P_LOG, idest); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return -1; - } - - strncpy(dstr, where + p->stripmsd, sizeof(dstr) - 1); - if (option_debug > 1) - DEBUGA_PBX("celliax_call dialing idest: %s, timeout: %d, dstr: %s!\n", CELLIAX_P_LOG, - idest, timeout, dstr); - - if (p->controldev_dead) { - WARNINGA("celliax_call: device is dead, cannot call!\n", CELLIAX_P_LOG); - status = -1; - } else { - ast_setstate(c, AST_STATE_DIALING); - status = celliax_serial_call(p, dstr); - } - - if (status) { - WARNINGA("celliax_call dialing failed: %d!\n", CELLIAX_P_LOG, status); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return -1; - } else { - if (option_debug) - DEBUGA_PBX("call ongoing\n", CELLIAX_P_LOG); - ast_queue_control(p->owner, AST_CONTROL_RINGING); - } - - if (option_debug > 1) - DEBUGA_PBX("celliax_call dialed idest: %s, timeout: %d, dstr: %s!\n", CELLIAX_P_LOG, - idest, timeout, dstr); - - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } -#ifdef CELLIAX_PORTAUDIO - speex_echo_state_reset(p->stream->echo_state); -#endif // CELLIAX_PORTAUDIO - return 0; -} - -/*! \brief Send audio frame to channel */ -int celliax_write(struct ast_channel *c, struct ast_frame *f) -{ - struct celliax_pvt *p = c->tech_pvt; - if (p->owner && p->owner->_state != AST_STATE_UP) { - return 0; - } - - celliax_sound_boost(f, p->playback_boost); - - return celliax_sound_write(p, f); -} - -/*! \brief Fix up a channel: If a channel is consumed, this is called. - * Basically update any ->owner links */ -int celliax_fixup(struct ast_channel *oldchan, struct ast_channel *newchan) -{ - struct celliax_pvt *p = newchan->tech_pvt; - - if (!p) { - ERRORA("No pvt after masquerade. Strange things may happen\n", CELLIAX_P_LOG); - return -1; - } - - if (p->owner != oldchan) { - ERRORA("old channel wasn't %p but was %p\n", CELLIAX_P_LOG, oldchan, p->owner); - return -1; - } - - p->owner = newchan; - return 0; -} - -int celliax_sound_boost(struct ast_frame *f, double boost) -{ -/* LUIGI RIZZO's magic */ - if (boost != 0) { /* scale and clip values */ - int i, x; - -#ifdef ASTERISK_VERSION_1_6_0_1 - int16_t *ptr = (int16_t *) f->data.ptr; -#else - int16_t *ptr = (int16_t *) f->data; -#endif /* ASTERISK_VERSION_1_6_0_1 */ - for (i = 0; i < f->samples; i++) { - x = (ptr[i] * boost) / BOOST_SCALE; - if (x > 32767) { - x = 32767; - } else if (x < -32768) { - x = -32768; - } - ptr[i] = x; - } - } - return 0; -} - -struct ast_channel *celliax_new(struct celliax_pvt *p, int state, char *context) -{ - struct ast_channel *tmp; - - if (option_debug) { - DEBUGA_PBX("ENTERING FUNC\n", CELLIAX_P_LOG); - } - /* alloc a generic channel struct */ -#ifndef ASTERISK_VERSION_1_4 - tmp = ast_channel_alloc(1); -#else - //tmp = ast_channel_alloc(1, state, 0, 0, "", p->exten, p->context, 0, ""); - tmp = - ast_channel_alloc(1, state, 0, 0, "", p->exten, p->context, 0, "Celliax/%s", p->name); - -#endif /* ASTERISK_VERSION_1_4 */ - if (tmp) { -int res; - -/* initialize the soundcard channels (input and output) used by this interface (a multichannel soundcard can be used by multiple interfaces), optionally starting the sound managing threads */ - res = celliax_sound_init(p); - if (res == -1) { - ERRORA("Failed initializing sound device\n", CELLIAX_P_LOG); - /* we failed, free the PVT */ - if (tmp) - free(tmp); - return NULL; - } - - /* give a name to the newly created channel */ -#ifndef ASTERISK_VERSION_1_4 - snprintf(tmp->name, sizeof(tmp->name), "Celliax/%s", p->name); - tmp->type = celliax_type; -#else /* ASTERISK_VERSION_1_4 */ - ast_string_field_build(tmp, name, "Celliax/%s", p->name); -#endif /* ASTERISK_VERSION_1_4 */ - - DEBUGA_PBX("new channel: name=%s requested_state=%d\n", CELLIAX_P_LOG, tmp->name, - state); - - /* fd for the channel to poll for incoming audio */ - tmp->fds[0] = p->celliax_sound_capt_fd; - - /* audio formats managed */ - tmp->nativeformats = AST_FORMAT_SLINEAR; - tmp->readformat = AST_FORMAT_SLINEAR; - tmp->writeformat = AST_FORMAT_SLINEAR; - /* the technology description (eg. the interface type) of the newly created channel is the Celliax's one */ - tmp->tech = &celliax_tech; - /* the technology pvt (eg. the interface) of the newly created channel is this interface pvt */ - tmp->tech_pvt = p; - - /* copy this interface default context, extension, language to the newly created channel */ - if (strlen(p->context)) - strncpy(tmp->context, p->context, sizeof(tmp->context) - 1); - if (strlen(p->exten)) - strncpy(tmp->exten, p->exten, sizeof(tmp->exten) - 1); -#ifndef ASTERISK_VERSION_1_4 - if (strlen(p->language)) - strncpy(tmp->language, p->language, sizeof(tmp->language) - 1); -#else - if (strlen(p->language)) - ast_string_field_set(tmp, language, p->language); -#endif /* ASTERISK_VERSION_1_4 */ - /* copy the requested context (not necessarily the interface default) to the newly created channel */ - if (strlen(context)) - strncpy(tmp->context, context, sizeof(tmp->context) - 1); - - /* copy this interface default callerid in the newly created channel */ - ast_set_callerid(tmp, !ast_strlen_zero(p->callid_number) ? p->callid_number : NULL, - !ast_strlen_zero(p->callid_name) ? p->callid_name : NULL, - !ast_strlen_zero(p->callid_number) ? p->callid_number : NULL); - - /* the owner of this interface pvt is the newly created channel */ - p->owner = tmp; - /* if this interface pvt has an initialized dsp struct, free it */ - if (p->dsp) { - DEBUGA_SOUND("freeing dsp\n", CELLIAX_P_LOG); - ast_dsp_free(p->dsp); - p->dsp = NULL; - } -#ifndef ASTERISK_VERSION_1_4 - /* set the newly created channel state to the requested state */ - if (ast_setstate(tmp, state)) { - ERRORA("ast_setstate failed, BAD\n", CELLIAX_P_LOG); - ast_dsp_free(p->dsp); - ast_channel_free(tmp); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return NULL; - } -#endif /* ASTERISK_VERSION_1_4 */ - -#ifdef AST_VERION_1_4 - ast_module_ref(ast_module_info->self); - ast_jb_configure(tmp, &global_jbconf); -#endif /* AST_VERION_1_4 */ - - /* if the requested state is different from DOWN, let the pbx manage this interface (now part of the newly created channel) */ - if (state != AST_STATE_DOWN) { - DEBUGA_PBX("Try to start PBX on %s, state=%d\n", CELLIAX_P_LOG, tmp->name, state); - if (ast_pbx_start(tmp)) { - ERRORA("Unable to start PBX on %s\n", CELLIAX_P_LOG, tmp->name); - ast_dsp_free(p->dsp); - ast_channel_free(tmp); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return NULL; - } - } - /* let's start the serial monitoring thread too, so we can have serial signaling */ - if (ast_pthread_create(&p->controldev_thread, NULL, celliax_do_controldev_thread, p) < - 0) { - ERRORA("Unable to start controldev thread.\n", CELLIAX_P_LOG); - ast_dsp_free(p->dsp); - ast_channel_free(tmp); - tmp = NULL; - } - DEBUGA_SERIAL("STARTED controldev_thread=%lu STOP=%lu NULL=%lu\n", CELLIAX_P_LOG, - (unsigned long) p->controldev_thread, (unsigned long) AST_PTHREADT_STOP, - (unsigned long) AST_PTHREADT_NULL); - -#ifndef ASTERISK_VERSION_1_4 - /* add one to the usage count of Celliax-type channels */ - LOKKA(&celliax_usecnt_lock); - celliax_usecnt++; - UNLOCKA(&celliax_usecnt_lock); - ast_update_use_count(); -#endif /* ASTERISK_VERSION_1_4 */ - - /* return the newly created channel */ - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return tmp; - } - ERRORA("failed memory allocation for Celliax channel\n", CELLIAX_P_LOG); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return NULL; -} - -/*! - * \brief Load the module into Asterisk and start its threads - * - * This function register the module into Asterisk, - * create the interfaces for the channels, - * start the auxiliary threads for the interfaces, - * then start a monitor thread. The monitor thread - * will signal Asterisk when an interface receive a call. - * - * - * \return zero on success, -1 on error. - */ -int load_module(void) -{ - int i; - struct ast_config *cfg; - struct celliax_pvt *tmp; - struct celliax_pvt *p = NULL; -#ifdef ASTERISK_VERSION_1_6_0 - struct ast_flags config_flags = { 0 }; -#endif /* ASTERISK_VERSION_1_6_0 */ - - - -#ifdef ASTERISK_VERSION_1_4 - /* Copy the default jb config over global_jbconf */ - memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf)); -#endif /* ASTERISK_VERSION_1_4 */ - - if (option_debug) { - DEBUGA_PBX("ENTERING FUNC\n", CELLIAX_P_LOG); - } - ast_register_application(celliax_sendsmsapp, celliax_sendsms, celliax_sendsmssynopsis, - celliax_sendsmsdescrip); - - ast_manager_register2("CELLIAXsendsms", EVENT_FLAG_SYSTEM, celliax_manager_sendsms, - "Send an SMS", mandescr_celliax_sendsms); - /* make sure we can register our channel type with Asterisk */ - i = ast_channel_register(&celliax_tech); - if (i < 0) { - ERRORA("Unable to register channel type '%s'\n", CELLIAX_P_LOG, celliax_type); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return -1; - } - /* load celliax.conf config file */ -#ifdef ASTERISK_VERSION_1_6_0 - cfg = ast_config_load(celliax_config, config_flags); -#else - cfg = ast_config_load(celliax_config); -#endif /* ASTERISK_VERSION_1_6_0 */ - if (cfg != NULL) { - char *ctg = NULL; - int is_first_category = 1; - while ((ctg = ast_category_browse(cfg, ctg)) != NULL) { - /* create one interface for each category in celliax.conf config file, first one set the defaults */ - tmp = celliax_mkif(cfg, ctg, is_first_category); - if (tmp) { - NOTICA("Created channel Celliax: celliax.conf category '[%s]', channel name '%s'" - " control_device_name '%s'\n", CELLIAX_P_LOG, ctg, tmp->name, - tmp->controldevice_name); - /* add interface to celliax_iflist */ - tmp->next = celliax_iflist; - celliax_iflist = tmp; - /* next one will not be the first ;) */ - if (is_first_category == 1) { - is_first_category = 0; - celliax_console_active = tmp->name; - } - } else { - ERRORA("Unable to create channel Celliax from celliax.conf category '[%s]'\n", - CELLIAX_P_LOG, ctg); - /* if error, unload config from memory and return */ - ast_config_destroy(cfg); - ast_channel_unregister(&celliax_tech); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return -1; - } - /* do it for each category described in config */ - } - - /* we finished, unload config from memory */ - ast_config_destroy(cfg); - } else { - ERRORA("Unable to load celliax_config celliax.conf\n", CELLIAX_P_LOG); - ast_channel_unregister(&celliax_tech); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return -1; - } -#ifndef ASTERISK_VERSION_1_6_0 - ast_cli_register_multiple(myclis, sizeof(myclis) / sizeof(struct ast_cli_entry)); -#endif /* ASTERISK_VERSION_1_6_0 */ - /* start to monitor the interfaces (celliax_iflist) for the first time */ - if (celliax_restart_monitor()) { - ERRORA("celliax_restart_monitor failed, BAD\n", CELLIAX_P_LOG); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return -1; - } -#ifdef CELLIAX_DIR - //celliax_dir_create_extensions(); -#endif /* CELLIAX_DIR */ - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return 0; -} - -/*! - * \brief Unload the module from Asterisk and shutdown its threads - * - * This function unregister the module from Asterisk, - * destroy the interfaces for the channels, - * shutdown the auxiliary threads for the interfaces, - * then shutdown its monitor thread. - * - * \return zero on success, -1 on error. - */ -int unload_module(void) -{ - struct celliax_pvt *p = NULL, *p2 = NULL; - int res; - - if (option_debug) { - DEBUGA_PBX("ENTERING FUNC\n", CELLIAX_P_LOG); - } - - /* unregister our channel type with Asterisk */ - ast_channel_unregister(&celliax_tech); - ast_cli_unregister_multiple(myclis, sizeof(myclis) / sizeof(struct ast_cli_entry)); - - ast_unregister_application(celliax_sendsmsapp); - - /* lock the celliax_monlock, kill the monitor thread, unlock the celliax_monlock */ - LOKKA(&celliax_monlock); - if (celliax_monitor_thread && (celliax_monitor_thread != AST_PTHREADT_NULL) - && (celliax_monitor_thread != AST_PTHREADT_STOP)) { - if (pthread_cancel(celliax_monitor_thread)) { - ERRORA("pthread_cancel failed, BAD\n", CELLIAX_P_LOG); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return -1; - } - if (pthread_kill(celliax_monitor_thread, SIGURG)) { - DEBUGA_PBX("pthread_kill failed\n", CELLIAX_P_LOG); //maybe it just died - } -#ifndef __CYGWIN__ /* under cygwin, this seems to be not reliable, get stuck at times */ - if (pthread_join(celliax_monitor_thread, NULL)) { - ERRORA("pthread_join failed, BAD\n", CELLIAX_P_LOG); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return -1; - } -#endif /* __CYGWIN__ */ - } - celliax_monitor_thread = AST_PTHREADT_STOP; - UNLOCKA(&celliax_monlock); - - if (celliax_monitor_audio_thread && (celliax_monitor_audio_thread != AST_PTHREADT_NULL) - && (celliax_monitor_audio_thread != AST_PTHREADT_STOP)) { - - if (pthread_cancel(celliax_monitor_audio_thread)) { - ERRORA("pthread_cancel celliax_monitor_audio_thread failed, BAD\n", CELLIAX_P_LOG); - } - if (pthread_kill(celliax_monitor_audio_thread, SIGURG)) { - DEBUGA_PBX("pthread_kill celliax_monitor_audio_thread failed, no problem\n", CELLIAX_P_LOG); //maybe it just died - } - - if (pthread_join(celliax_monitor_audio_thread, NULL)) { - ERRORA("pthread_join failed, BAD\n", CELLIAX_P_LOG); - } - } - /* lock the celliax_iflock, and go through the interfaces list (celliax_iflist) */ - LOKKA(&celliax_iflock); - p = celliax_iflist; - while (p) { - /* for each interface in list */ - p2 = p->next; - /* shutdown the sound system, close sound fds, and if exist shutdown the sound managing threads */ - DEBUGA_SOUND("shutting down sound\n", CELLIAX_P_LOG); - res = celliax_sound_shutdown(p); - if (res == -1) { - ERRORA("Failed to shutdown sound\n", CELLIAX_P_LOG); - } - - /* if a serial port has been opened, close it */ - if (p->controldevprotocol != PROTOCOL_NO_SERIAL) - if (p->controldevfd) - close(p->controldevfd); - - /* if a dsp struct has been allocated, free it */ - if (p->dsp) { - ast_dsp_free(p->dsp); - p->dsp = NULL; - } - DEBUGA_PBX("freeing PVT\n", CELLIAX_P_LOG); - /* free the pvt allocated memory */ - free(p); - /* next one, please */ - p = p2; - } - /* finished with the interfaces list, unlock the celliax_iflock */ - UNLOCKA(&celliax_iflock); - -#ifdef __CYGWIN__ - NOTICA("Sleping 5 secs, please wait...\n", CELLIAX_P_LOG); - sleep(5); /* without this pause, for some unknown (to me) reason it crashes on cygwin */ -#endif /* __CYGWIN__ */ - NOTICA("Unloaded Celliax Module\n", CELLIAX_P_LOG); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG); - } - return 0; -} - -/*! - * \brief Return the count of active channels for this module - * - * \return the count of active channels for this module - */ -int usecount() -{ - int res; - static struct celliax_pvt *p = &celliax_log_struct; -/* lock the celliax_usecnt lock */ - LOKKA(&celliax_usecnt_lock); - /* retrieve the celliax_usecnt */ - res = celliax_usecnt; -/* unlock the celliax_usecnt lock */ - UNLOCKA(&celliax_usecnt_lock); - /* return the celliax_usecnt */ - return res; -} - -/*! - * \brief Return the textual description of the module - * - * \return the textual description of the module - */ -char *description() -{ - return (char *) celliax_desc; -} - -/*! - * \brief Return the ASTERISK_GPL_KEY - * - * \return the ASTERISK_GPL_KEY - */ -char *key() -{ - struct celliax_pvt *p = NULL; - - if (option_debug) - NOTICA("Returning Key\n", CELLIAX_P_LOG); - - return ASTERISK_GPL_KEY; -} - -/*! - * \brief Create and initialize one interface for the module - * \param cfg pointer to configuration data from celliax.conf - * \param ctg pointer to a category name to be found in cfg - * \param is_first_category is this the first category in cfg - * - * This function create and initialize one interface for the module - * - * \return a pointer to the PVT structure of interface on success, NULL on error. - */ -struct celliax_pvt *celliax_mkif(struct ast_config *cfg, char *ctg, int is_first_category) -{ - struct celliax_pvt *tmp; - struct ast_variable *v; - int res; - - int debug_all = 0; - int debug_at = 0; - int debug_fbus2 = 0; - int debug_serial = 0; - int debug_sound = 0; - int debug_pbx = 0; - int debug_skype = 0; - int debug_call = 0; - int debug_locks = 0; - int debug_monitorlocks = 0; -#ifdef CELLIAX_CVM - int debug_cvm = 0; -#endif /* CELLIAX_CVM */ - - /* alloc memory for PVT */ - tmp = malloc(sizeof(struct celliax_pvt)); - if (tmp == NULL) /* fail */ - return NULL; - /* clear memory for PVT */ - memset(tmp, 0, sizeof(struct celliax_pvt)); - - //NOTICA("malloced %d bytes\n", CELLIAX_TMP_LOG, sizeof(struct celliax_pvt)); - - /* if we are reading the "first" category of the config file, take SELECTED values as defaults, overriding the values in celliax_default */ - if (is_first_category == 1) { - /* for each variable in category, copy it in the celliax_default struct */ - for (v = ast_variable_browse(cfg, ctg); v; v = v->next) { - M_START(v->name, v->value); - - M_STR("control_device_protocol", celliax_default.controldevprotocolname) - M_STR("context", celliax_default.context) - M_STR("language", celliax_default.language) - M_STR("extension", celliax_default.exten) - M_UINT("dsp_silence_threshold", celliax_default.dsp_silence_threshold) - M_UINT("audio_play_reset_period", celliax_default.audio_play_reset_period) -#ifdef CELLIAX_ALSA - M_UINT("alsa_period_size", celliax_default.alsa_period_size) - M_UINT("alsa_periods_in_buffer", celliax_default.alsa_periods_in_buffer) -#endif /* CELLIAX_ALSA */ - M_F("playback_boost", - celliax_store_boost(v->value, &celliax_default.playback_boost)) - M_F("capture_boost", - celliax_store_boost(v->value, &celliax_default.capture_boost)) - M_UINT("celliax_dir_entry_extension_prefix", - celliax_default.celliax_dir_entry_extension_prefix) - M_UINT("celliax_dir_prefix", celliax_default.celliax_dir_prefix) - M_STR("sms_receiving_program", tmp->sms_receiving_program) - M_END(; - ); - } - } - - /* initialize the newly created PVT from the celliax_default values */ - *tmp = celliax_default; - - /* initialize the mutexes */ - ast_mutex_init(&tmp->controldev_lock); - ast_mutex_init(&tmp->fbus2_outgoing_list_lock); -#ifdef CELLIAX_CVM - ast_mutex_init(&tmp->cvm_busmail_outgoing_list_lock); -#endif /* CELLIAX_CVM */ - - /* the category name becomes the interface name */ - tmp->name = strdup(ctg); - - /* for each category in config file, "first" included, read in ALL the values */ - for (v = ast_variable_browse(cfg, ctg); v; v = v->next) { - M_START(v->name, v->value); - - M_BOOL("debug_all", debug_all) - M_BOOL("debug_at", debug_at) - M_BOOL("debug_fbus2", debug_fbus2) - M_BOOL("debug_serial", debug_serial) - M_BOOL("debug_sound", debug_sound) - M_BOOL("debug_pbx", debug_pbx) - M_BOOL("debug_skype", debug_skype) - M_BOOL("debug_call", debug_call) - M_BOOL("debug_locks", debug_locks) - M_BOOL("debug_monitorlocks", debug_monitorlocks) -#ifdef CELLIAX_CVM - M_BOOL("debug_cvm", debug_cvm) - M_STR("cvm_subscription_1_pin", tmp->cvm_subsc_1_pin) - M_STR("cvm_subscription_2_pin", tmp->cvm_subsc_2_pin) - M_UINT("cvm_subscription_no", tmp->cvm_subsc_no) - M_UINT("cvm_volume_level", tmp->cvm_volume_level) - M_UINT("cvm_celliax_serial_delay", tmp->cvm_celliax_serial_delay) -#endif /* CELLIAX_CVM */ - M_BOOL("skype", tmp->skype) - M_BOOL("need_acoustic_ring", tmp->need_acoustic_ring) - M_STR("control_device_name", tmp->controldevice_name) - M_UINT("control_device_speed", tmp->controldevice_speed) - M_STR("control_device_protocol", tmp->controldevprotocolname) - M_STR("context", tmp->context) - M_STR("language", tmp->language) - M_STR("extension", tmp->exten) - M_UINT("dsp_silence_threshold", tmp->dsp_silence_threshold) - M_UINT("audio_play_reset_period", tmp->audio_play_reset_period) - M_UINT("portaudio_capture_device_id", tmp->portaudiocindex) - M_UINT("portaudio_playback_device_id", tmp->portaudiopindex) - M_F("playback_boost", celliax_store_boost(v->value, &tmp->playback_boost)) - M_F("capture_boost", celliax_store_boost(v->value, &tmp->capture_boost)) -#ifdef CELLIAX_ALSA - M_STR("alsa_capture_device_name", tmp->alsacname) - M_STR("alsa_playback_device_name", tmp->alsapname) - M_UINT("alsa_period_size", tmp->alsa_period_size) - M_UINT("alsa_periods_in_buffer", tmp->alsa_periods_in_buffer) -#endif /* CELLIAX_WINMM */ - M_STR("at_dial_pre_number", tmp->at_dial_pre_number) - M_STR("at_dial_post_number", tmp->at_dial_post_number) - - M_STR("at_dial_expect", tmp->at_dial_expect) - M_UINT("at_early_audio", tmp->at_early_audio) - M_STR("at_hangup", tmp->at_hangup) - M_STR("at_hangup_expect", tmp->at_hangup_expect) - M_STR("at_answer", tmp->at_answer) - M_STR("at_answer_expect", tmp->at_answer_expect) - M_STR("at_send_dtmf", tmp->at_send_dtmf) - - M_UINT("at_initial_pause", tmp->at_initial_pause) - M_STR("at_preinit_1", tmp->at_preinit_1) - M_STR("at_preinit_1_expect", tmp->at_preinit_1_expect) - M_STR("at_preinit_2", tmp->at_preinit_2) - M_STR("at_preinit_2_expect", tmp->at_preinit_2_expect) - M_STR("at_preinit_3", tmp->at_preinit_3) - M_STR("at_preinit_3_expect", tmp->at_preinit_3_expect) - M_STR("at_preinit_4", tmp->at_preinit_4) - M_STR("at_preinit_4_expect", tmp->at_preinit_4_expect) - M_STR("at_preinit_5", tmp->at_preinit_5) - M_STR("at_preinit_5_expect", tmp->at_preinit_5_expect) - M_UINT("at_after_preinit_pause", tmp->at_after_preinit_pause) - - M_STR("at_postinit_1", tmp->at_postinit_1) - M_STR("at_postinit_1_expect", tmp->at_postinit_1_expect) - M_STR("at_postinit_2", tmp->at_postinit_2) - M_STR("at_postinit_2_expect", tmp->at_postinit_2_expect) - M_STR("at_postinit_3", tmp->at_postinit_3) - M_STR("at_postinit_3_expect", tmp->at_postinit_3_expect) - M_STR("at_postinit_4", tmp->at_postinit_4) - M_STR("at_postinit_4_expect", tmp->at_postinit_4_expect) - M_STR("at_postinit_5", tmp->at_postinit_5) - M_STR("at_postinit_5_expect", tmp->at_postinit_5_expect) - - M_STR("at_query_battchg", tmp->at_query_battchg) - M_STR("at_query_battchg_expect", tmp->at_query_battchg_expect) - M_STR("at_query_signal", tmp->at_query_signal) - M_STR("at_query_signal_expect", tmp->at_query_signal_expect) - M_STR("at_call_idle", tmp->at_call_idle) - M_STR("at_call_incoming", tmp->at_call_incoming) - M_STR("at_call_active", tmp->at_call_active) - M_STR("at_call_failed", tmp->at_call_failed) - M_STR("at_call_calling", tmp->at_call_calling) - M_STR("at_indicator_noservice_string", tmp->at_indicator_noservice_string) - M_STR("at_indicator_nosignal_string", tmp->at_indicator_nosignal_string) - M_STR("at_indicator_lowsignal_string", tmp->at_indicator_lowsignal_string) - M_STR("at_indicator_lowbattchg_string", tmp->at_indicator_lowbattchg_string) - M_STR("at_indicator_nobattchg_string", tmp->at_indicator_nobattchg_string) - M_STR("at_indicator_callactive_string", tmp->at_indicator_callactive_string) - M_STR("at_indicator_nocallactive_string", tmp->at_indicator_nocallactive_string) - M_STR("at_indicator_nocallsetup_string", tmp->at_indicator_nocallsetup_string) - M_STR("at_indicator_callsetupincoming_string", - tmp->at_indicator_callsetupincoming_string) - M_STR("at_indicator_callsetupoutgoing_string", - tmp->at_indicator_callsetupoutgoing_string) - M_STR("at_indicator_callsetupremoteringing_string", - tmp->at_indicator_callsetupremoteringing_string) - M_UINT("celliax_dir_entry_extension_prefix", - tmp->celliax_dir_entry_extension_prefix) - M_UINT("celliax_dir_prefix", tmp->celliax_dir_prefix) -#ifdef CELLIAX_LIBCSV - M_UINT("csv_separator_is_semicolon", tmp->csv_separator_is_semicolon) - M_UINT("csv_complete_name_pos", tmp->csv_complete_name_pos) - M_UINT("csv_email_pos", tmp->csv_email_pos) - M_UINT("csv_home_phone_pos", tmp->csv_home_phone_pos) - M_UINT("csv_mobile_phone_pos", tmp->csv_mobile_phone_pos) - M_UINT("csv_business_phone_pos", tmp->csv_business_phone_pos) - M_UINT("csv_first_row_is_title", tmp->csv_first_row_is_title) -#endif /* CELLIAX_LIBCSV */ - M_STR("sms_receiving_program", tmp->sms_receiving_program) - M_BOOL("speexecho", tmp->speexecho) - M_BOOL("speexpreprocess", tmp->speexpreprocess) - M_END(; - ); - } - - if (debug_all) { - celliax_debug = celliax_debug | DEBUG_ALL; - if (!option_debug) { - WARNINGA - ("DEBUG_ALL activated, but option_debug is 0. You have to set debug level higher than zero to see some debugging output. Please use the command \"set debug 10\" or start Asterisk with \"-dddddddddd\" option for full DEBUG_ALL debugging output.\n", - CELLIAX_TMP_LOG); - } else { - NOTICA("DEBUG_ALL activated. \n", CELLIAX_TMP_LOG); - } - } - if (debug_at) { - celliax_debug = celliax_debug | DEBUG_AT; - if (!option_debug) { - WARNINGA - ("DEBUG_AT activated, but option_debug is 0. You have to set debug level higher than zero to see some debugging output. Please use the command \"set debug 10\" or start Asterisk with \"-dddddddddd\" option for full DEBUG_AT debugging output.\n", - CELLIAX_TMP_LOG); - } else { - NOTICA("DEBUG_AT activated. \n", CELLIAX_TMP_LOG); - } - } - - if (debug_fbus2) { - celliax_debug = celliax_debug | DEBUG_FBUS2; - if (!option_debug) { - WARNINGA - ("DEBUG_FBUS2 activated, but option_debug is 0. You have to set debug level higher than zero to see some debugging output. Please use the command \"set debug 10\" or start Asterisk with \"-dddddddddd\" option for full DEBUG_FBUS2 debugging output.\n", - CELLIAX_TMP_LOG); - } else { - NOTICA("DEBUG_FBUS2 activated. \n", CELLIAX_TMP_LOG); - } - } - - if (debug_serial) { - celliax_debug = celliax_debug | DEBUG_SERIAL; - if (!option_debug) { - WARNINGA - ("DEBUG_SERIAL activated, but option_debug is 0. You have to set debug level higher than zero to see some debugging output. Please use the command \"set debug 10\" or start Asterisk with \"-dddddddddd\" option for full DEBUG_SERIAL debugging output.\n", - CELLIAX_TMP_LOG); - } else { - NOTICA("DEBUG_SERIAL activated. \n", CELLIAX_TMP_LOG); - } - } - - if (debug_sound) { - celliax_debug = celliax_debug | DEBUG_SOUND; - if (!option_debug) { - WARNINGA - ("DEBUG_SOUND activated, but option_debug is 0. You have to set debug level higher than zero to see some debugging output. Please use the command \"set debug 10\" or start Asterisk with \"-dddddddddd\" option for full DEBUG_SOUND debugging output.\n", - CELLIAX_TMP_LOG); - } else { - NOTICA("DEBUG_SOUND activated. \n", CELLIAX_TMP_LOG); - } - } - - if (debug_pbx) { - celliax_debug = celliax_debug | DEBUG_PBX; - if (!option_debug) { - WARNINGA - ("DEBUG_PBX activated, but option_debug is 0. You have to set debug level higher than zero to see some debugging output. Please use the command \"set debug 10\" or start Asterisk with \"-dddddddddd\" option for full DEBUG_PBX debugging output.\n", - CELLIAX_TMP_LOG); - } else { - NOTICA("DEBUG_PBX activated. \n", CELLIAX_TMP_LOG); - } - } - - if (debug_call) { - celliax_debug = celliax_debug | DEBUG_CALL; - if (!option_debug) { - WARNINGA - ("DEBUG_CALL activated, but option_debug is 0. You have to set debug level higher than zero to see some debugging output. Please use the command \"set debug 10\" or start Asterisk with \"-dddddddddd\" option for full DEBUG_CALL debugging output.\n", - CELLIAX_TMP_LOG); - } else { - NOTICA("DEBUG_CALL activated. \n", CELLIAX_TMP_LOG); - } - } - - if (debug_locks) { - celliax_debug = celliax_debug | DEBUG_LOCKS; - if (!option_debug) { - WARNINGA - ("DEBUG_LOCKS activated, but option_debug is 0. You have to set debug level higher than zero to see some debugging output. Please use the command \"set debug 10\" or start Asterisk with \"-dddddddddd\" option for full DEBUG_LOCKS debugging output.\n", - CELLIAX_TMP_LOG); - } else { - NOTICA("DEBUG_LOCKS activated. \n", CELLIAX_TMP_LOG); - } - } - - if (debug_monitorlocks) { - celliax_debug = celliax_debug | DEBUG_MONITORLOCKS; - if (!option_debug) { - WARNINGA - ("DEBUG_MONITORLOCKS activated, but option_debug is 0. You have to set debug level higher than zero to see some debugging output. Please use the command \"set debug 10\" or start Asterisk with \"-dddddddddd\" option for full DEBUG_MONITORLOCKS debugging output.\n", - CELLIAX_TMP_LOG); - } else { - NOTICA("DEBUG_MONITORLOCKS activated. \n", CELLIAX_TMP_LOG); - } - } -#ifdef CELLIAX_CVM - if (debug_cvm) { - celliax_debug = celliax_debug | DEBUG_CVM; - if (!option_debug) { - WARNINGA - ("DEBUG_CVM activated, but option_debug is 0. You have to set debug level higher than zero to see some debugging output. Please use the command \"set debug 10\" or start Asterisk with \"-dddddddddd\" option for full DEBUG_CVM debugging output.\n", - CELLIAX_TMP_LOG); - } else { - NOTICA("DEBUG_CVM activated. \n", CELLIAX_TMP_LOG); - } - } -#endif /* CELLIAX_CVM */ - - if (option_debug > 1) { - DEBUGA_SOUND("playback_boost is %f\n", CELLIAX_TMP_LOG, tmp->playback_boost); - DEBUGA_SOUND("capture_boost is %f\n", CELLIAX_TMP_LOG, tmp->capture_boost); - } - - /* serial protocols are named in config with a string, but as int in this software */ - if (strcasecmp(tmp->controldevprotocolname, "fbus2") == 0) - tmp->controldevprotocol = PROTOCOL_FBUS2; - else if (strcasecmp(tmp->controldevprotocolname, "at") == 0) - tmp->controldevprotocol = PROTOCOL_AT; - else if (strcasecmp(tmp->controldevprotocolname, "no_serial") == 0) - tmp->controldevprotocol = PROTOCOL_NO_SERIAL; - else if (strcasecmp(tmp->controldevprotocolname, "alsa_voicemodem") == 0) - tmp->controldevprotocol = PROTOCOL_ALSA_VOICEMODEM; -#ifdef CELLIAX_CVM - else if (strcasecmp(tmp->controldevprotocolname, "cvm_busmail") == 0) - tmp->controldevprotocol = PROTOCOL_CVM_BUSMAIL; -#endif /* CELLIAX_CVM */ - else { -#ifndef CELLIAX_CVM - ERRORA - ("control_device_protocol in celliax.conf MUST be = fbus2|at|no_serial|alsa_voicemodem, but is = '%s'\n", - CELLIAX_TMP_LOG, - tmp->controldevprotocolname ? tmp->controldevprotocolname : "NULL"); -#else - ERRORA - ("control_device_protocol in celliax.conf MUST be = fbus2|at|no_serial|alsa_voicemodem|cvm_busmail, but is = '%s'\n", - CELLIAX_TMP_LOG, - tmp->controldevprotocolname ? tmp->controldevprotocolname : "NULL"); -#endif /* CELLIAX_CVM */ - - /* we failed, free the PVT */ - free(tmp); - return NULL; - } - - if (tmp->controldevice_speed != celliax_default.controldevice_speed) { - /* serial speeds are numbers in config file, but we needs definitions in this software */ - if (tmp->controldevice_speed == 9600) - tmp->controldevice_speed = B9600; - else if (tmp->controldevice_speed == 19200) - tmp->controldevice_speed = B19200; - else if (tmp->controldevice_speed == 38400) - tmp->controldevice_speed = B38400; - else if (tmp->controldevice_speed == 57600) - tmp->controldevice_speed = B57600; - else if (tmp->controldevice_speed == 115200) - tmp->controldevice_speed = B115200; - else { - ERRORA - ("controldevice_speed has to be given one of the following values: 9600|19200|38400|57600|115200. In the config file, was given: %d\n", - CELLIAX_TMP_LOG, tmp->controldevice_speed); - free(tmp); - return NULL; - } - } - -/* CVM PP DECT modules supports registration to two DECT FPs (bases), but CVM can be only connected to one DECT FP at the time, so we need two PINs (for registration) and info to which DECT FP connect*/ -#ifdef CELLIAX_CVM - if (tmp->cvm_subsc_no != celliax_default.cvm_subsc_no) { - if ((tmp->cvm_subsc_no != 1) && (tmp->cvm_subsc_no != 2)) { - ERRORA - ("cvm_subscription_no has to be given one of the following values: 1|2. In the config file, was given: %d\n", - CELLIAX_TMP_LOG, tmp->cvm_subsc_no); - free(tmp); - return NULL; - } - } - - if (tmp->cvm_subsc_1_pin != celliax_default.cvm_subsc_1_pin) { - if (4 != strlen(tmp->cvm_subsc_1_pin)) { - ERRORA - ("cvm_subscription_1_pin has to be 4 digits long. In the config file, was given: %s\n", - CELLIAX_TMP_LOG, tmp->cvm_subsc_1_pin); - free(tmp); - return NULL; - } - } - - if (tmp->cvm_subsc_2_pin != celliax_default.cvm_subsc_2_pin) { - if (4 != strlen(tmp->cvm_subsc_2_pin)) { - ERRORA - ("cvm_subscription_2_pin has to be 4 digits long. In the config file, was given: %s\n", - CELLIAX_TMP_LOG, tmp->cvm_subsc_2_pin); - free(tmp); - return NULL; - } - } - - if (tmp->cvm_volume_level != celliax_default.cvm_volume_level) { - if ((0 > tmp->cvm_volume_level) && (9 < tmp->cvm_volume_level)) { - ERRORA("cvm_volume_level has to be 0-9. In the config file, was given: %d\n", - CELLIAX_TMP_LOG, tmp->cvm_volume_level); - free(tmp); - return NULL; - } - } - - if (tmp->cvm_celliax_serial_delay != celliax_default.cvm_celliax_serial_delay) { - if ((0 > tmp->cvm_celliax_serial_delay) && (65535 < tmp->cvm_celliax_serial_delay)) { - ERRORA - ("cvm_celliax_serial_dealy has to be 0-65535. In the config file, was given: %d\n", - CELLIAX_TMP_LOG, tmp->cvm_celliax_serial_delay); - free(tmp); - return NULL; - } - } -#endif /* CELLIAX_CVM */ - if (tmp->need_acoustic_ring) { - /* alloc and initialize a new dsp struct for this interface pvt, WITH silence suppression */ - if (celliax_sound_dsp_set(tmp, tmp->dsp_silence_threshold, 1)) { - ERRORA("celliax_sound_dsp_set failed\n", CELLIAX_TMP_LOG); - celliax_sound_shutdown(tmp); - if (tmp) - free(tmp); - return NULL; - } - -/* initialize the soundcard channels (input and output) used by this interface (a multichannel soundcard can be used by multiple interfaces), optionally starting the sound managing threads */ - res = celliax_sound_init(tmp); - if (res == -1) { - ERRORA("Failed initializing sound device\n", CELLIAX_TMP_LOG); - /* we failed, free the PVT */ - if (tmp) - free(tmp); - return NULL; - } - - } - - /* init the serial port */ - if (tmp->controldevprotocol != PROTOCOL_NO_SERIAL) { - tmp->controldevfd = celliax_serial_init(tmp, tmp->controldevice_speed); - if (tmp->controldevfd < 1) { - ERRORA("celliax_serial_init failed\n", CELLIAX_TMP_LOG); - celliax_sound_shutdown(tmp); - if (tmp) - free(tmp); - return NULL; - } - } - - /* config the phone/modem on the serial port */ - if (tmp->controldevprotocol != PROTOCOL_NO_SERIAL) { - //int res; - res = celliax_serial_config(tmp); - if (res) { - ERRORA("celliax_serial_config failed\n", CELLIAX_TMP_LOG); - celliax_sound_shutdown(tmp); - if (tmp) - free(tmp); - return NULL; - } - } - - /* return the newly created celliax_pvt */ - return tmp; -} - -/*! \brief (Re)Start the module main monitor thread, watching for incoming calls on the interfaces */ -int celliax_restart_monitor(void) -{ - static struct celliax_pvt *p = &celliax_log_struct; - /* If we're supposed to be stopped -- stay stopped */ - if (celliax_monitor_thread == AST_PTHREADT_STOP) - return 0; - LOKKA(&celliax_monlock); - /* Do not seems possible to me that this function can be called by the very same monitor thread, but let's be paranoid */ - if (celliax_monitor_thread == pthread_self()) { - UNLOCKA(&celliax_monlock); - ERRORA("Cannot kill myself\n", CELLIAX_P_LOG); - return -1; - } - /* if the monitor thread exists */ - if (celliax_monitor_thread != AST_PTHREADT_NULL) { - /* Wake up the thread, it can be stuck waiting in a select or so */ - pthread_kill(celliax_monitor_thread, SIGURG); - pthread_kill(celliax_monitor_audio_thread, SIGURG); - } else { - /* the monitor thread does not exists, start a new monitor */ - if (ast_pthread_create(&celliax_monitor_thread, NULL, celliax_do_monitor, NULL) < 0) { - UNLOCKA(&celliax_monlock); - ERRORA("Unable to start monitor thread.\n", CELLIAX_P_LOG); - return -1; - } - - if (ast_pthread_create - (&celliax_monitor_audio_thread, NULL, celliax_do_audio_monitor, NULL) < 0) { - ERRORA("Unable to start audio_monitor thread.\n", CELLIAX_P_LOG); - return -1; - } - - } - UNLOCKA(&celliax_monlock); - return 0; -} - -/*! \brief The celliax monitoring thread - * \note This thread monitors all the celliax interfaces that are not in a call - * (and thus do not have a separate thread) indefinitely - * */ -void *celliax_do_monitor(void *data) -{ - fd_set rfds; - int res; - struct celliax_pvt *p = NULL; - int max = -1; - struct timeval to; - time_t now_timestamp; - - if (pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL)) { - ERRORA("Unable to set cancel type to deferred\n", CELLIAX_P_LOG); - return NULL; - } - - for (;;) { - pthread_testcancel(); - /* Don't let anybody kill us right away. Nobody should lock the interface list - and wait for the monitor list, but the other way around is okay. */ - PUSHA_UNLOCKA(&celliax_monlock); - MONITORLOKKA(&celliax_monlock); - /* Lock the interface list */ - PUSHA_UNLOCKA(&celliax_iflock); - MONITORLOKKA(&celliax_iflock); - /* Build the stuff we're going to select on, that is the celliax_serial_fd of every - celliax_pvt that does not have an associated owner channel. In the case of FBUS2 3310 - and in the case of PROTOCOL_NO_SERIAL we add the audio_fd as well, because there is not serial signaling of incoming calls */ - FD_ZERO(&rfds); - - time(&now_timestamp); - p = celliax_iflist; - while (p) { - if (!p->owner) { - /* This interface needs to be watched, as it lacks an owner */ - - if (p->controldevprotocol != PROTOCOL_NO_SERIAL && !p->controldev_dead) { - /* This interface needs its serial connection to be watched, nokia 3310 and compatibles needs sounds as well */ - if (FD_ISSET(p->controldevfd, &rfds)) { - ERRORA("Bizarre! Descriptor %d (controldevfd) appears twice ?\n", - CELLIAX_P_LOG, p->controldevfd); - } - if (p->controldevfd > 0) { - - //time(&now_timestamp); - if ((now_timestamp - p->celliax_serial_synced_timestamp) > p->celliax_serial_sync_period) { //TODO find a sensible period. 5min? in config? - int rt; - if (option_debug > 1) - DEBUGA_SERIAL("Syncing Serial\n", CELLIAX_P_LOG); - rt = celliax_serial_sync(p); - if (rt) { - p->controldev_dead = 1; - close(p->controldevfd); - ERRORA("serial sync failed, declaring %s dead\n", CELLIAX_P_LOG, - p->controldevice_name); - } - rt = celliax_serial_getstatus(p); - if (rt) { - p->controldev_dead = 1; - close(p->controldevfd); - ERRORA("serial getstatus failed, declaring %s dead\n", CELLIAX_P_LOG, - p->controldevice_name); - } - - } - - if (!p->controldev_dead) { - /* add this file descriptor to the set watched by the select */ - FD_SET(p->controldevfd, &rfds); - if (p->controldevfd > max) { - /* adjust the maximum file descriptor value the select has to watch for */ - max = p->controldevfd; - } - } - } - } - - } - /* next interface, please */ - p = p->next; - } - /* Okay, now that we know what to do, release the interface lock */ - MONITORUNLOCKA(&celliax_iflock); - POPPA_UNLOCKA(&celliax_iflock); - /* And from now on, we're okay to be killed, so release the monitor lock as well */ - MONITORUNLOCKA(&celliax_monlock); - POPPA_UNLOCKA(&celliax_monlock); - - /* you want me to die? */ - pthread_testcancel(); - - /* Wait for something to happen */ - to.tv_sec = 0; - to.tv_usec = 500000; /* we select with this timeout because under cygwin we avoid the signal usage, so there is no way to end the thread if it is stuck waiting for select */ - res = ast_select(max + 1, &rfds, NULL, NULL, &to); - - /* you want me to die? */ - pthread_testcancel(); - - /* Okay, select has finished. Let's see what happened. */ - - /* If there are errors... */ - if (res < 0) { - if (errno == EINTR) /* EINTR is just the select - being interrupted by a SIGURG, or so */ - continue; - else { - ERRORA("select returned %d: %s\n", CELLIAX_P_LOG, res, strerror(errno)); -//FIXME what to do here? is the interface that failed signaled? which interface we have to disable? - return NULL; - } - } - - /* must not be killed while celliax_iflist is locked */ - PUSHA_UNLOCKA(&celliax_monlock); - MONITORLOKKA(&celliax_monlock); - /* Alright, lock the interface list again, and let's look and see what has - happened */ - PUSHA_UNLOCKA(&celliax_iflock); - MONITORLOKKA(&celliax_iflock); - - p = celliax_iflist; - for (; p; p = p->next) { - - if (p->controldevprotocol != PROTOCOL_NO_SERIAL && !p->controldev_dead) { - if (!p->owner) { //give all the serial channels that have no owner a read, so we can have the timers clicking - - if (!p->celliax_serial_monitoring) { - p->celliax_serial_monitoring = 1; - res = celliax_serial_monitor(p); - if (res == -1) { //manage the graceful interface shutdown - p->controldev_dead = 1; - close(p->controldevfd); - ERRORA("celliax_serial_monitor failed, declaring %s dead\n", CELLIAX_P_LOG, - p->controldevice_name); - } else if (!p->need_acoustic_ring - && p->controldevprotocol != PROTOCOL_NO_SERIAL - && p->interface_state == AST_STATE_RING) { - if (option_debug) - DEBUGA_PBX("INCOMING RING\n", CELLIAX_P_LOG); - if (!celliax_new(p, AST_STATE_RING, p->context)) { - //FIXME what to do here? - ERRORA("celliax_new failed! BAD BAD BAD\n", CELLIAX_P_LOG); - } - } - p->celliax_serial_monitoring = 0; - } - } - } - - if (p->controldevprotocol != PROTOCOL_NO_SERIAL && p->controldev_dead) { - - /* init the serial port */ - p->controldevfd = celliax_serial_init(p, p->controldevice_speed); - if (p->controldevfd < 1) { - DEBUGA_SERIAL("celliax_serial_init failed\n", CELLIAX_P_LOG); - } else { - - /* config the phone/modem on the serial port */ - res = celliax_serial_config(p); - if (res) { - DEBUGA_SERIAL("celliax_serial_config failed\n", CELLIAX_P_LOG); - close(p->controldevfd); - } else { - - NOTICA("Wow, the serial port has come back! Let's see if it will work\n", - CELLIAX_P_LOG); - p->controldev_dead = 0; - } - - } - - } - - } - MONITORUNLOCKA(&celliax_iflock); - POPPA_UNLOCKA(&celliax_iflock); - MONITORUNLOCKA(&celliax_monlock); - POPPA_UNLOCKA(&celliax_monlock); - pthread_testcancel(); - } -/* Never reached */ - return NULL; - -} - -void *celliax_do_audio_monitor(void *data) -{ - fd_set rfds; - int res; - struct celliax_pvt *p = NULL; - int max = -1; - struct timeval to; - - if (pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL)) { - ERRORA("Unable to set cancel type to deferred\n", CELLIAX_P_LOG); - return NULL; - } - - for (;;) { - pthread_testcancel(); - /* Lock the interface list */ - PUSHA_UNLOCKA(&celliax_iflock); - MONITORLOKKA(&celliax_iflock); - - FD_ZERO(&rfds); - - p = celliax_iflist; - while (p) { - if (!p->owner) { - /* This interface needs to be watched, as it lacks an owner */ - - if (p->controldevprotocol == PROTOCOL_NO_SERIAL || p->need_acoustic_ring) { - /* This interface needs its incoming sound to be watched, because it cannot signal incoming ring from serial (eg nokia 3310 and compatibles) */ - if (p->celliax_sound_capt_fd > 0) { - /* if fd exist */ - if (FD_ISSET(p->celliax_sound_capt_fd, &rfds)) { - ERRORA("Bizarre! Descriptor %d (celliax_sound_capt_fd) appears twice ?\n", - CELLIAX_P_LOG, p->celliax_sound_capt_fd); - } - /* add this file descriptor to the set watched by the select */ - FD_SET(p->celliax_sound_capt_fd, &rfds); - if (p->celliax_sound_capt_fd > max) { - /* adjust the maximum file descriptor value the select has to watch for */ - max = p->celliax_sound_capt_fd; - } - } - } - - } - /* next interface, please */ - p = p->next; - } - /* Okay, now that we know what to do, release the interface lock */ - - MONITORUNLOCKA(&celliax_iflock); - POPPA_UNLOCKA(&celliax_iflock); - /* you want me to die? */ - pthread_testcancel(); - - /* Wait for something to happen */ - to.tv_sec = 0; - to.tv_usec = 500000; /* we select with this timeout because under cygwin we avoid the signal usage, so there is no way to end the thread if it is stuck waiting for select */ - res = ast_select(max + 1, &rfds, NULL, NULL, &to); - - /* you want me to die? */ - pthread_testcancel(); - - /* Okay, select has finished. Let's see what happened. */ - - /* If there are errors... */ - if (res < 0) { - if (errno == EINTR) { /* EINTR is just the select - being interrupted by a SIGURG, or so */ - usleep(100); - continue; - } else { - ERRORA("select returned %d: %s\n", CELLIAX_P_LOG, res, strerror(errno)); -//FIXME what to do here? is the interface that failed signaled? which interface we have to disable? - return NULL; - } - } - /* If there are no file descriptors changed, just continue */ - - if (res == 0) { - usleep(100); //let's breath - continue; - } -//usleep(10); //let's breath - - /* Lock the interface list */ - PUSHA_UNLOCKA(&celliax_iflock); - MONITORLOKKA(&celliax_iflock); - - p = celliax_iflist; - for (; p; p = p->next) { - - if (FD_ISSET(p->celliax_sound_capt_fd, &rfds)) { - res = celliax_sound_monitor(p); - if (res < 0) { - ERRORA("celliax_sound_monitor ERROR %d\n", CELLIAX_P_LOG, res); - } else if (res == CALLFLOW_INCOMING_RING) { - p->phone_callflow = CALLFLOW_INCOMING_RING; - p->interface_state = AST_STATE_RING; - if (option_debug) - DEBUGA_PBX("INCOMING RING\n", CELLIAX_P_LOG); - if (!celliax_new(p, AST_STATE_RING, p->context)) - ERRORA("celliax_new failed! BAD BAD BAD\n", CELLIAX_P_LOG); - } else { - } - - } - - } -/* Okay, now that we know what to do, release the interface lock */ - - MONITORUNLOCKA(&celliax_iflock); - POPPA_UNLOCKA(&celliax_iflock); - - pthread_testcancel(); - } -/* Never reached */ - return NULL; -} - -/*! - * \brief Initialize the soundcard channels (input and output) used by one interface (a multichannel soundcard can be used by multiple interfaces) - * \param p the celliax_pvt of the interface - * - * This function initialize the soundcard channels (input and output) used by one interface (a multichannel soundcard can be used by multiple interfaces). It simply pass its parameters to the right function for the sound system for which has been compiled, eg. alsa_init for ALSA, oss_init for OSS, winmm_init for Windows Multimedia, etc and return the result - * - * \return zero on success, -1 on error. - */ - -int celliax_sound_init(struct celliax_pvt *p) -{ -#ifdef CELLIAX_ALSA - return alsa_init(p); -#endif /* CELLIAX_ALSA */ -#ifdef CELLIAX_PORTAUDIO - return celliax_portaudio_init(p); -#endif /* CELLIAX_PORTAUDIO */ - - return -1; -} - -/*! - * \brief Shutdown the soundcard channels (input and output) used by one interface (a multichannel soundcard can be used by multiple interfaces) - * \param p the celliax_pvt of the interface - * - * This function shutdown the soundcard channels (input and output) used by one interface (a multichannel soundcard can be used by multiple interfaces). It simply pass its parameters to the right function for the sound system for which has been compiled, eg. alsa_shutdown for ALSA, oss_shutdown for OSS, winmm_shutdown for Windows Multimedia, etc and return the result - * - * \return zero on success, -1 on error. - */ - -int celliax_sound_shutdown(struct celliax_pvt *p) -{ - -#ifdef CELLIAX_ALSA - return alsa_shutdown(p); -#endif /* CELLIAX_ALSA */ -#ifdef CELLIAX_PORTAUDIO - return celliax_portaudio_shutdown(p); -#endif /* CELLIAX_PORTAUDIO */ - - return -1; -} - -/*! \brief returns an asterisk frame categorized by dsp algorithms */ -struct ast_frame *celliax_sound_dsp_analize(struct celliax_pvt *p, struct ast_frame *f, - int dsp_silence_threshold) -{ - if (!p->dsp) { - DEBUGA_SOUND("no dsp, initializing it \n", CELLIAX_P_LOG); - if (celliax_sound_dsp_set(p, dsp_silence_threshold, 1)) { - ERRORA("celliax_sound_dsp_set failed\n", CELLIAX_P_LOG); - return NULL; - } - } - - /* process with dsp */ - if (p->dsp) { - if (f->frametype == AST_FRAME_VOICE) { - f = ast_dsp_process(p->owner, p->dsp, f); - } else { - //WARNINGA("not a VOICE frame ! \n", CELLIAX_P_LOG); - } - } - return f; -} - -/*! \brief initialize the dsp algorithms and structures */ -int celliax_sound_dsp_set(struct celliax_pvt *p, int dsp_silence_threshold, - int silence_suppression) -{ - -/* let asterisk dsp algorithms detect dtmf */ - if (p->dsp) { - return 0; - } - if (option_debug > 1) - DEBUGA_SOUND("alloc dsp \n", CELLIAX_P_LOG); - p->dsp = ast_dsp_new(); - if (p->dsp) { - if (silence_suppression) { - ast_dsp_set_threshold(p->dsp, dsp_silence_threshold); - DEBUGA_SOUND("set dsp_silence_threshold=%d\n", CELLIAX_P_LOG, - dsp_silence_threshold); - if (option_debug > 1) - DEBUGA_SOUND("Detecting silence, I mean, voice\n", CELLIAX_P_LOG); - ast_dsp_set_features(p->dsp, 0 | DSP_FEATURE_SILENCE_SUPPRESS); - } else { - if (option_debug > 1) - DEBUGA_SOUND("WITHOUT SILENCE_SUPPRESS, Detecting inband dtmf with sw DSP\n", - CELLIAX_P_LOG); - -#ifdef ASTERISK_VERSION_1_6_0_1 - ast_dsp_set_features(p->dsp, 0 | DSP_FEATURE_DIGIT_DETECT); -#else - ast_dsp_set_features(p->dsp, 0 | DSP_FEATURE_DTMF_DETECT); -#endif /* ASTERISK_VERSION_1_6_0_1 */ - } - - /* - if (ast_dsp_digitmode(p->dsp, DSP_DIGITMODE_DTMF | DSP_DIGITMODE_RELAXDTMF)) { - ERRORA("ast_dsp_digitmode failed\n", CELLIAX_P_LOG); - return -1; - } - */ - } else { - ERRORA("ast_dsp_new failed\n", CELLIAX_P_LOG); - return -1; - } - return 0; -} - -/*! \brief Read audio frames from interface */ -struct ast_frame *celliax_sound_read(struct celliax_pvt *p) -{ - struct ast_frame *f = NULL; -#ifdef CELLIAX_ALSA - f = alsa_read(p); -#endif /* CELLIAX_ALSA */ -#ifdef CELLIAX_PORTAUDIO - f = celliax_portaudio_read(p); -#endif /* CELLIAX_PORTAUDIO */ - - return f; -} - -/*! \brief Send audio frame to interface */ -int celliax_sound_write(struct celliax_pvt *p, struct ast_frame *f) -{ - int ret = -1; - -#ifdef CELLIAX_ALSA - ret = alsa_write(p, f); -#endif /* CELLIAX_ALSA */ -#ifdef CELLIAX_PORTAUDIO - ret = celliax_portaudio_write(p, f); -#endif /* CELLIAX_PORTAUDIO */ - - return ret; -} - -/*! \brief read an audio frame and tell if is "voice" (interpreted as incoming RING) */ -int celliax_sound_monitor(struct celliax_pvt *p) -{ - struct ast_frame *f; - f = celliax_sound_read(p); - if (f) { - f = celliax_sound_dsp_analize(p, f, p->dsp_silence_threshold); - if (f) { - if (f->frametype == AST_FRAME_VOICE) { - DEBUGA_SOUND("VOICE\n", CELLIAX_P_LOG); - return CALLFLOW_INCOMING_RING; - } else { - return AST_STATE_DOWN; - } - } - } - return -1; -} - -/*! - * \brief This thread runs during a call, and monitor the interface serial port for signaling, like hangup, caller id, etc - * - */ -void *celliax_do_controldev_thread(void *data) -{ - struct celliax_pvt *p = data; - int res; - - DEBUGA_SERIAL("In celliax_do_controldev_thread: started, p=%p\n", CELLIAX_P_LOG, p); - - if (pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL)) { - ERRORA("Unable to set cancel type to deferred\n", CELLIAX_P_LOG); - return NULL; - } - - while (1) { - int rt; - time_t now_timestamp; - - if (p->controldevprotocol == PROTOCOL_NO_SERIAL) { - while (1) { - usleep(10000); - pthread_testcancel(); - } - } -#ifdef CELLIAX_CVM - if (p->controldevprotocol == PROTOCOL_CVM_BUSMAIL) { - usleep(p->cvm_celliax_serial_delay * 1000); //to get msecs - } else { - usleep(1000); - } - -#else - usleep(1000); -#endif /* CELLIAX_CVM */ - - pthread_testcancel(); - /* do not read from a dead controldev */ - if (p->controldev_dead) { - DEBUGA_SERIAL("celliax_do_controldev_thread: device %s is dead\n", CELLIAX_P_LOG, - p->controldevice_name); - if (p->owner) - celliax_queue_control(p->owner, AST_CONTROL_HANGUP); - return NULL; - } else { - pthread_testcancel(); - res = celliax_serial_read(p); - pthread_testcancel(); - if (res == -1) { - p->controldev_dead = 1; - close(p->controldevfd); - ERRORA("serial read failed, declaring %s dead\n", CELLIAX_P_LOG, - p->controldevice_name); - } - } - - pthread_testcancel(); - time(&now_timestamp); - if ((now_timestamp - p->celliax_serial_synced_timestamp) > p->celliax_serial_synced_timestamp && !p->controldev_dead) { //TODO find a sensible period. 5min? in config? - DEBUGA_SERIAL("Syncing Serial\n", CELLIAX_P_LOG); - pthread_testcancel(); - rt = celliax_serial_sync(p); - pthread_testcancel(); - if (rt) { - p->controldev_dead = 1; - close(p->controldevfd); - ERRORA("serial sync failed, declaring %s dead\n", CELLIAX_P_LOG, - p->controldevice_name); - } - pthread_testcancel(); - rt = celliax_serial_getstatus(p); - pthread_testcancel(); - if (rt) { - p->controldev_dead = 1; - close(p->controldevfd); - ERRORA("serial getstatus failed, declaring %s dead\n", CELLIAX_P_LOG, - p->controldevice_name); - } - - } - pthread_testcancel(); - } - return NULL; - -} - -int celliax_serial_init(struct celliax_pvt *p, speed_t controldevice_speed) -{ - int fd; - int rt; - struct termios tp; - -/* if there is a file descriptor, close it. But it is probably just an old value, so don't check for close success*/ - fd = p->controldevfd; - if (fd) { - close(fd); - } -/* open the serial port */ -#ifdef __CYGWIN__ - fd = open(p->controldevice_name, O_RDWR | O_NOCTTY | O_NONBLOCK); - sleep(1); - close(fd); -#endif /* __CYGWIN__ */ - fd = open(p->controldevice_name, O_RDWR | O_NOCTTY | O_NONBLOCK); - if (fd == -1) { - DEBUGA_SERIAL("serial error: %s\n", CELLIAX_P_LOG, strerror(errno)); - p->controldevfd = fd; - return -1; - } -/* flush it */ - rt = tcflush(fd, TCIFLUSH); - if (rt == -1) { - ERRORA("serial error: %s", CELLIAX_P_LOG, strerror(errno)); - } -/* attributes */ - tp.c_cflag = B0 | CS8 | CLOCAL | CREAD | HUPCL; - tp.c_iflag = IGNPAR; - tp.c_cflag &= ~CRTSCTS; - tp.c_oflag = 0; - tp.c_lflag = 0; - tp.c_cc[VMIN] = 1; - tp.c_cc[VTIME] = 0; -/* set controldevice_speed */ - rt = cfsetispeed(&tp, p->controldevice_speed); - if (rt == -1) { - ERRORA("serial error: %s", CELLIAX_P_LOG, strerror(errno)); - } - rt = cfsetospeed(&tp, p->controldevice_speed); - if (rt == -1) { - ERRORA("serial error: %s", CELLIAX_P_LOG, strerror(errno)); - } -/* set port attributes */ - if (tcsetattr(fd, TCSADRAIN, &tp) == -1) { - ERRORA("serial error: %s", CELLIAX_P_LOG, strerror(errno)); - } - rt = tcsetattr(fd, TCSANOW, &tp); - if (rt == -1) { - ERRORA("serial error: %s", CELLIAX_P_LOG, strerror(errno)); - } - unsigned int status = 0; -#ifndef __CYGWIN__ - ioctl(fd, TIOCMGET, &status); - status |= TIOCM_DTR; /* Set DTR high */ - status &= ~TIOCM_RTS; /* Set RTS low */ - ioctl(fd, TIOCMSET, &status); - ioctl(fd, TIOCMGET, &status); - unsigned int flags = TIOCM_DTR; - ioctl(fd, TIOCMBIS, &flags); - flags = TIOCM_RTS; - ioctl(fd, TIOCMBIC, &flags); - ioctl(fd, TIOCMGET, &status); -#else /* __CYGWIN__ */ - ioctl(fd, TIOCMGET, &status); - status |= TIOCM_DTR; /* Set DTR high */ - status &= ~TIOCM_RTS; /* Set RTS low */ - ioctl(fd, TIOCMSET, &status); -#endif /* __CYGWIN__ */ - p->controldevfd = fd; - DEBUGA_SERIAL("Syncing Serial\n", CELLIAX_P_LOG); - rt = celliax_serial_sync(p); - if (rt == -1) { - ERRORA("Serial init error\n", CELLIAX_P_LOG); - return -1; - } - return (fd); -} - -int celliax_serial_sync(struct celliax_pvt *p) -{ - if (p->controldevprotocol == PROTOCOL_AT) - return celliax_serial_sync_AT(p); -#ifdef CELLIAX_FBUS2 - if (p->controldevprotocol == PROTOCOL_FBUS2) - return celliax_serial_sync_FBUS2(p); -#endif /* CELLIAX_FBUS2 */ -#ifdef CELLIAX_CVM - if (p->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return celliax_serial_sync_CVM_BUSMAIL(p); -#endif /* CELLIAX_CVM */ - - return -1; -} - -int celliax_serial_getstatus(struct celliax_pvt *p) -{ - if (p->controldevprotocol == PROTOCOL_AT) - return celliax_serial_getstatus_AT(p); -#ifdef CELLIAX_FBUS2 - if (p->controldevprotocol == PROTOCOL_FBUS2) - return celliax_serial_getstatus_FBUS2(p); -#endif /* CELLIAX_FBUS2 */ - -#ifdef CELLIAX_CVM - if (p->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return celliax_serial_getstatus_CVM_BUSMAIL(p); -#endif /* CELLIAX_CVM */ - return -1; -} - -int celliax_serial_read(struct celliax_pvt *p) -{ - if (p->controldevprotocol == PROTOCOL_AT) - return celliax_serial_read_AT(p, 0, 100000, 0, NULL, 1); // a 10th of a second timeout -#ifdef CELLIAX_FBUS2 - if (p->controldevprotocol == PROTOCOL_FBUS2) - return celliax_serial_read_FBUS2(p); -#endif /* CELLIAX_FBUS2 */ -#ifdef CELLIAX_CVM - if (p->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return celliax_serial_read_CVM_BUSMAIL(p); -#endif /* CELLIAX_CVM */ - return -1; -} - -int celliax_serial_hangup(struct celliax_pvt *p) -{ - if (p->controldevprotocol == PROTOCOL_AT) - return celliax_serial_hangup_AT(p); -#ifdef CELLIAX_FBUS2 - if (p->controldevprotocol == PROTOCOL_FBUS2) - return celliax_serial_hangup_FBUS2(p); -#endif /* CELLIAX_FBUS2 */ -#ifdef CELLIAX_CVM - if (p->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return celliax_serial_hangup_CVM_BUSMAIL(p); -#endif /* CELLIAX_CVM */ - return -1; -} - -int celliax_serial_answer(struct celliax_pvt *p) -{ - if (p->controldevprotocol == PROTOCOL_AT) - return celliax_serial_answer_AT(p); -#ifdef CELLIAX_FBUS2 - if (p->controldevprotocol == PROTOCOL_FBUS2) - return celliax_serial_answer_FBUS2(p); -#endif /* CELLIAX_FBUS2 */ -#ifdef CELLIAX_CVM - if (p->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return celliax_serial_answer_CVM_BUSMAIL(p); -#endif /* CELLIAX_CVM */ - return -1; -} - -int celliax_serial_config(struct celliax_pvt *p) -{ - if (p->controldevprotocol == PROTOCOL_AT) - return celliax_serial_config_AT(p); -#ifdef CELLIAX_FBUS2 - if (p->controldevprotocol == PROTOCOL_FBUS2) - return celliax_serial_config_FBUS2(p); -#endif /* CELLIAX_FBUS2 */ -#ifdef CELLIAX_CVM - if (p->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return celliax_serial_config_CVM_BUSMAIL(p); -#endif /* CELLIAX_CVM */ - return -1; -} - -int celliax_serial_monitor(struct celliax_pvt *p) -{ - if (p->controldevprotocol == PROTOCOL_AT) - return celliax_serial_read_AT(p, 0, 100000, 0, NULL, 1); // a 10th of a second timeout -#ifdef CELLIAX_FBUS2 - if (p->controldevprotocol == PROTOCOL_FBUS2) - return celliax_serial_read_FBUS2(p); -#endif /* CELLIAX_FBUS2 */ -#ifdef CELLIAX_CVM - if (p->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return celliax_serial_read_CVM_BUSMAIL(p); -#endif /* CELLIAX_CVM */ - return -1; -} - -/************************************************/ - -/* LUIGI RIZZO's magic */ -/* - * store the boost factor - */ -#ifdef ASTERISK_VERSION_1_6_0 -void celliax_store_boost(const char *s, double *boost) -#else -void celliax_store_boost(char *s, double *boost) -#endif /* ASTERISK_VERSION_1_6_0 */ -{ - struct celliax_pvt *p = NULL; - - if (sscanf(s, "%lf", boost) != 1) { - ERRORA("invalid boost <%s>\n", CELLIAX_P_LOG, s); - return; - } - if (*boost < -BOOST_MAX) { - WARNINGA("boost %s too small, using %d\n", CELLIAX_P_LOG, s, -BOOST_MAX); - *boost = -BOOST_MAX; - } else if (*boost > BOOST_MAX) { - WARNINGA("boost %s too large, using %d\n", CELLIAX_P_LOG, s, BOOST_MAX); - *boost = BOOST_MAX; - } - *boost = exp(log(10) * *boost / 20) * BOOST_SCALE; - if (option_debug > 1) - DEBUGA_SOUND("setting boost %s to %f\n", CELLIAX_P_LOG, s, *boost); -} - -int celliax_serial_call(struct celliax_pvt *p, char *dstr) -{ - if (p->controldevprotocol == PROTOCOL_AT) - return celliax_serial_call_AT(p, dstr); -#ifdef CELLIAX_FBUS2 - if (p->controldevprotocol == PROTOCOL_FBUS2) - return celliax_serial_call_FBUS2(p, dstr); -#endif /* CELLIAX_FBUS2 */ - if (p->controldevprotocol == PROTOCOL_NO_SERIAL) - return 0; -#ifdef CELLIAX_CVM - if (p->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return celliax_serial_call_CVM_BUSMAIL(p, dstr); -#endif /* CELLIAX_CVM */ - return -1; -} - -/* - * returns a pointer to the descriptor with the given name - */ -struct celliax_pvt *celliax_console_find_desc(char *dev) -{ - struct celliax_pvt *p; - - for (p = celliax_iflist; p && strcmp(p->name, dev) != 0; p = p->next); - if (p == NULL) - WARNINGA("could not find <%s>\n", CELLIAX_P_LOG, dev); - - return p; -} - -int celliax_console_playback_boost(int fd, int argc, char *argv[]) -{ - struct celliax_pvt *p = celliax_console_find_desc(celliax_console_active); - - if (argc > 2) - return RESULT_SHOWUSAGE; - if (!p) { - ast_cli(fd, - "No \"current\" celliax_console for playback_boost, please enter 'help celliax_console'\n"); - return RESULT_SUCCESS; - } - - if (argc == 1) { - ast_cli(fd, "playback_boost on the active celliax_console, that is [%s], is: %5.1f\n", - celliax_console_active, - 20 * log10(((double) p->playback_boost / (double) BOOST_SCALE))); - } else if (argc == 2) { - celliax_store_boost(argv[1], &p->playback_boost); - - ast_cli(fd, - "playback_boost on the active celliax_console, that is [%s], is now: %5.1f\n", - celliax_console_active, - 20 * log10(((double) p->playback_boost / (double) BOOST_SCALE))); - } - - return RESULT_SUCCESS; -} - -int celliax_console_capture_boost(int fd, int argc, char *argv[]) -{ - struct celliax_pvt *p = celliax_console_find_desc(celliax_console_active); - - if (argc > 2) - return RESULT_SHOWUSAGE; - if (!p) { - ast_cli(fd, - "No \"current\" celliax_console for capture_boost, please enter 'help celliax_console'\n"); - return RESULT_SUCCESS; - } - - if (argc == 1) { - ast_cli(fd, "capture_boost on the active celliax_console, that is [%s], is: %5.1f\n", - celliax_console_active, - 20 * log10(((double) p->capture_boost / (double) BOOST_SCALE))); - } else if (argc == 2) { - celliax_store_boost(argv[1], &p->capture_boost); - - ast_cli(fd, - "capture_boost on the active celliax_console, that is [%s], is now: %5.1f\n", - celliax_console_active, - 20 * log10(((double) p->capture_boost / (double) BOOST_SCALE))); - } - - return RESULT_SUCCESS; -} - -int celliax_console_echo(int fd, int argc, char *argv[]) -{ - struct celliax_pvt *p = celliax_console_find_desc(celliax_console_active); - - if (argc != 3 && argc != 1) - return RESULT_SHOWUSAGE; - if (!p) { - ast_cli(fd, - "No \"current\" celliax_console for celliax_echo, please enter 'help celliax_console'\n"); - return RESULT_SUCCESS; - } - - if (argc == 1) { - ast_cli(fd, - "On the active celliax_console, that is [%s], speexecho and speexpreprocess are: %d and %d\n", - celliax_console_active, p->speexecho, p->speexpreprocess); - } else if (argc == 3) { - sscanf(argv[1], "%d", &p->speexecho); - sscanf(argv[2], "%d", &p->speexpreprocess); - ast_cli(fd, - "On the active celliax_console, that is [%s], speexecho and speexpreprocess are NOW: %d and %d\n", - celliax_console_active, p->speexecho, p->speexpreprocess); - } - - return RESULT_SUCCESS; -} - -#ifndef ASTERISK_VERSION_1_6_0 -int celliax_console_hangup(int fd, int argc, char *argv[]) -{ - struct celliax_pvt *p = celliax_console_find_desc(celliax_console_active); - - if (argc != 1) - return RESULT_SHOWUSAGE; - if (!p) { - ast_cli(fd, - "No \"current\" celliax_console for hanging up, please enter 'help celliax_console'\n"); - return RESULT_SUCCESS; - } - if (!p->owner) { - ast_cli(fd, "No call to hangup on the active celliax_console, that is [%s]\n", - celliax_console_active); - return RESULT_FAILURE; - } - if (p->owner) - ast_queue_hangup(p->owner); - return RESULT_SUCCESS; -} -#else /* ASTERISK_VERSION_1_6_0 */ -char *celliax_console_hangup(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) -{ - struct celliax_pvt *p = celliax_console_find_desc(celliax_console_active); - - - switch (cmd) { - case CLI_INIT: - e->command = "celliax hangup"; - e->usage = - "Usage: celliax hangup\n" - " Hangup a call on the celliax channel.\n"; - - return NULL; - case CLI_GENERATE: - return NULL; - } - - if (a->argc != 2) - return CLI_SHOWUSAGE; - if (!p) { - ast_cli(a->fd, - "No \"current\" celliax_console for hanging up, please enter 'help celliax_console'\n"); - return CLI_SUCCESS; - } - if (!p->owner) { - ast_cli(a->fd, "No call to hangup on the active celliax_console, that is [%s]\n", - celliax_console_active); - return CLI_FAILURE; - } - if (p->owner) - ast_queue_hangup(p->owner); - return CLI_SUCCESS; -} - -#endif /* ASTERISK_VERSION_1_6_0 */ -int celliax_console_sendsms(int fd, int argc, char *argv[]) -{ - char *s = NULL; - char *s1 = NULL; - char command[512]; - - if (argc != 3) - return RESULT_SHOWUSAGE; - - s = argv[1]; - s1 = argv[2]; - - memset(command, 0, sizeof(command)); - - sprintf(command, "%s|%s|", s, s1); - - celliax_sendsms(NULL, (void *) &command); - - return RESULT_SUCCESS; -} - -int celliax_console_dial(int fd, int argc, char *argv[]) -{ - char *s = NULL; - struct celliax_pvt *p = celliax_console_find_desc(celliax_console_active); - - if (argc != 2) - return RESULT_SHOWUSAGE; - if (!p) { - ast_cli(fd, - "No \"current\" celliax_console for dialing, please enter 'help celliax_console'\n"); - return RESULT_SUCCESS; - } - - if (p->owner) { /* already in a call */ - int i; - struct ast_frame f = { AST_FRAME_DTMF, 0 }; - - s = argv[1]; - /* send the string one char at a time */ - for (i = 0; i < strlen(s); i++) { - f.subclass = s[i]; - ast_queue_frame(p->owner, &f); - } - return RESULT_SUCCESS; - } else - ast_cli(fd, - "No call in which to dial on the \"current\" celliax_console, that is [%s]\n", - celliax_console_active); - if (s) - free(s); - return RESULT_SUCCESS; -} - -int celliax_console_set_active(int fd, int argc, char *argv[]) -{ - if (argc == 1) - ast_cli(fd, - "\"current\" celliax_console is [%s]\n Enter 'celliax_console show' to see the available interfaces.\n Enter 'celliax_console interfacename' to change the \"current\" celliax_console.\n", - celliax_console_active); - else if (argc != 2) - return RESULT_SHOWUSAGE; - else { - struct celliax_pvt *p; - if (strcmp(argv[1], "show") == 0) { - ast_cli(fd, "Available interfaces:\n"); - for (p = celliax_iflist; p; p = p->next) - ast_cli(fd, " [%s]\n", p->name); - return RESULT_SUCCESS; - } - p = celliax_console_find_desc(argv[1]); - if (p == NULL) - ast_cli(fd, "Interface [%s] do not exists!\n", argv[1]); - else { - celliax_console_active = p->name; - ast_cli(fd, "\"current\" celliax_console is now: [%s]\n", argv[1]); - } - } - return RESULT_SUCCESS; -} - -int celliax_console_celliax(int fd, int argc, char *argv[]) -{ - return RESULT_SHOWUSAGE; -} - -#ifdef ASTERISK_VERSION_1_4 -#ifndef AST_MODULE -#define AST_MODULE "chan_celliax" -#endif -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Celliax, Audio-Serial Driver"); -#endif /* ASTERISK_VERSION_1_4 */ diff --git a/src/mod/endpoints/mod_gsmopen/asterisk/ciapalo b/src/mod/endpoints/mod_gsmopen/asterisk/ciapalo deleted file mode 100755 index aa9ea7f4dd..0000000000 --- a/src/mod/endpoints/mod_gsmopen/asterisk/ciapalo +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/perl -open(FILEOUT, ">> /tmp/smses_received"); -while(<>){ - print FILEOUT $_ ; - printf FILEOUT "\n" ; -} -close(FILEOUT); - diff --git a/src/mod/endpoints/mod_gsmopen/configs/gsmopen.conf.xml b/src/mod/endpoints/mod_gsmopen/configs/gsmopen.conf.xml deleted file mode 100644 index 0647f53168..0000000000 --- a/src/mod/endpoints/mod_gsmopen/configs/gsmopen.conf.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mod/endpoints/mod_gsmopen/driver_usb_dongle/Makefile b/src/mod/endpoints/mod_gsmopen/driver_usb_dongle/Makefile deleted file mode 100644 index f87fe778f5..0000000000 --- a/src/mod/endpoints/mod_gsmopen/driver_usb_dongle/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -# Comment/uncomment the following line to disable/enable debugging -#DEBUG = y -#LDDINC= - -# Add your debugging flag (or not) to CFLAGS -ifeq ($(DEBUG),y) - DEBFLAGS = -O -g -DSKYPOPEN_DEBUG # "-O" is needed to expand inlines -else - DEBFLAGS = -O2 -Wall -endif - -EXTRA_CFLAGS += $(DEBFLAGS) -EXTRA_CFLAGS += -I$(LDDINC) - -ifneq ($(KERNELRELEASE),) -# call from kernel build system - -option-objs := main.o - -obj-m := option.o - -else - -KERNELDIR ?= /lib/modules/$(shell uname -r)/build -PWD := $(shell pwd) - -modules: - $(MAKE) -C $(KERNELDIR) M=$(PWD) LDDINC=$(PWD)/../include modules - -endif - - - -clean: - rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions *.order *.symvers - -depend .depend dep: - $(CC) $(EXTRA_CFLAGS) -M *.c > .depend - - -ifeq (.depend,$(wildcard .depend)) -include .depend -endif diff --git a/src/mod/endpoints/mod_gsmopen/driver_usb_dongle/README b/src/mod/endpoints/mod_gsmopen/driver_usb_dongle/README deleted file mode 100644 index c89411760d..0000000000 --- a/src/mod/endpoints/mod_gsmopen/driver_usb_dongle/README +++ /dev/null @@ -1,9 +0,0 @@ -On kernels < 2.6.34 the option modem driver, needed by your dongle, is unstable. - -In this directory you can build an option.ko module for kernels 2.6.32.* (eg: Proxmox, OpenVZ) and 2.6.34.* - -To install it: - -make clean ; make -cp /lib/modules/$(uname -r)/kernel/drivers/usb/serial/option.ko /lib/modules/$(uname -r)/kernel/drivers/usb/serial/option.ko-backup -cp option.ko /lib/modules/$(uname -r)/kernel/drivers/usb/serial/ diff --git a/src/mod/endpoints/mod_gsmopen/driver_usb_dongle/main.c b/src/mod/endpoints/mod_gsmopen/driver_usb_dongle/main.c deleted file mode 100644 index c626fdaeec..0000000000 --- a/src/mod/endpoints/mod_gsmopen/driver_usb_dongle/main.c +++ /dev/null @@ -1,1817 +0,0 @@ -/* - USB Driver for GSM modems - - Copyright (C) 2005 Matthias Urlichs - - This driver is free software; you can redistribute it and/or modify - it under the terms of Version 2 of the GNU General Public License as - published by the Free Software Foundation. - - Portions copied from the Keyspan driver by Hugh Blemings - - History: see the git log. - - Work sponsored by: Sigos GmbH, Germany - - This driver exists because the "normal" serial driver doesn't work too well - with GSM modems. Issues: - - data loss -- one single Receive URB is not nearly enough - - nonstandard flow (Option devices) control - - controlling the baud rate doesn't make sense - - This driver is named "option" because the most common device it's - used for is a PC-Card (with an internal OHCI-USB interface, behind - which the GSM interface sits), made by Option Inc. - - Some of the "one port" devices actually exhibit multiple USB instances - on the USB bus. This is not a bug, these ports are used for different - device features. -*/ - -#define DRIVER_VERSION "v0.7.2" -#define DRIVER_AUTHOR "Matthias Urlichs " -#define DRIVER_DESC "USB Driver for GSM modems" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Function prototypes */ -static int option_probe(struct usb_serial *serial, - const struct usb_device_id *id); -static int option_open(struct tty_struct *tty, struct usb_serial_port *port); -static void option_close(struct usb_serial_port *port); -static void option_dtr_rts(struct usb_serial_port *port, int on); - -static int option_startup(struct usb_serial *serial); -static void option_disconnect(struct usb_serial *serial); -static void option_release(struct usb_serial *serial); -static int option_write_room(struct tty_struct *tty); - -static void option_instat_callback(struct urb *urb); - -static int option_write(struct tty_struct *tty, struct usb_serial_port *port, - const unsigned char *buf, int count); -static int option_chars_in_buffer(struct tty_struct *tty); -static void option_set_termios(struct tty_struct *tty, - struct usb_serial_port *port, struct ktermios *old); -static int option_tiocmget(struct tty_struct *tty, struct file *file); -static int option_tiocmset(struct tty_struct *tty, struct file *file, - unsigned int set, unsigned int clear); -static int option_send_setup(struct usb_serial_port *port); -#ifdef CONFIG_PM -static int option_suspend(struct usb_serial *serial, pm_message_t message); -static int option_resume(struct usb_serial *serial); -#endif - -/* Vendor and product IDs */ -#define OPTION_VENDOR_ID 0x0AF0 -#define OPTION_PRODUCT_COLT 0x5000 -#define OPTION_PRODUCT_RICOLA 0x6000 -#define OPTION_PRODUCT_RICOLA_LIGHT 0x6100 -#define OPTION_PRODUCT_RICOLA_QUAD 0x6200 -#define OPTION_PRODUCT_RICOLA_QUAD_LIGHT 0x6300 -#define OPTION_PRODUCT_RICOLA_NDIS 0x6050 -#define OPTION_PRODUCT_RICOLA_NDIS_LIGHT 0x6150 -#define OPTION_PRODUCT_RICOLA_NDIS_QUAD 0x6250 -#define OPTION_PRODUCT_RICOLA_NDIS_QUAD_LIGHT 0x6350 -#define OPTION_PRODUCT_COBRA 0x6500 -#define OPTION_PRODUCT_COBRA_BUS 0x6501 -#define OPTION_PRODUCT_VIPER 0x6600 -#define OPTION_PRODUCT_VIPER_BUS 0x6601 -#define OPTION_PRODUCT_GT_MAX_READY 0x6701 -#define OPTION_PRODUCT_FUJI_MODEM_LIGHT 0x6721 -#define OPTION_PRODUCT_FUJI_MODEM_GT 0x6741 -#define OPTION_PRODUCT_FUJI_MODEM_EX 0x6761 -#define OPTION_PRODUCT_KOI_MODEM 0x6800 -#define OPTION_PRODUCT_SCORPION_MODEM 0x6901 -#define OPTION_PRODUCT_ETNA_MODEM 0x7001 -#define OPTION_PRODUCT_ETNA_MODEM_LITE 0x7021 -#define OPTION_PRODUCT_ETNA_MODEM_GT 0x7041 -#define OPTION_PRODUCT_ETNA_MODEM_EX 0x7061 -#define OPTION_PRODUCT_ETNA_KOI_MODEM 0x7100 -#define OPTION_PRODUCT_GTM380_MODEM 0x7201 - -#define HUAWEI_VENDOR_ID 0x12D1 -#define HUAWEI_PRODUCT_E600 0x1001 -#define HUAWEI_PRODUCT_E220 0x1003 -#define HUAWEI_PRODUCT_E220BIS 0x1004 -#define HUAWEI_PRODUCT_E1401 0x1401 -#define HUAWEI_PRODUCT_E1402 0x1402 -#define HUAWEI_PRODUCT_E1403 0x1403 -#define HUAWEI_PRODUCT_E1404 0x1404 -#define HUAWEI_PRODUCT_E1405 0x1405 -#define HUAWEI_PRODUCT_E1406 0x1406 -#define HUAWEI_PRODUCT_E1407 0x1407 -#define HUAWEI_PRODUCT_E1408 0x1408 -#define HUAWEI_PRODUCT_E1409 0x1409 -#define HUAWEI_PRODUCT_E140A 0x140A -#define HUAWEI_PRODUCT_E140B 0x140B -#define HUAWEI_PRODUCT_E140C 0x140C -#define HUAWEI_PRODUCT_E140D 0x140D -#define HUAWEI_PRODUCT_E140E 0x140E -#define HUAWEI_PRODUCT_E140F 0x140F -#define HUAWEI_PRODUCT_E1410 0x1410 -#define HUAWEI_PRODUCT_E1411 0x1411 -#define HUAWEI_PRODUCT_E1412 0x1412 -#define HUAWEI_PRODUCT_E1413 0x1413 -#define HUAWEI_PRODUCT_E1414 0x1414 -#define HUAWEI_PRODUCT_E1415 0x1415 -#define HUAWEI_PRODUCT_E1416 0x1416 -#define HUAWEI_PRODUCT_E1417 0x1417 -#define HUAWEI_PRODUCT_E1418 0x1418 -#define HUAWEI_PRODUCT_E1419 0x1419 -#define HUAWEI_PRODUCT_E141A 0x141A -#define HUAWEI_PRODUCT_E141B 0x141B -#define HUAWEI_PRODUCT_E141C 0x141C -#define HUAWEI_PRODUCT_E141D 0x141D -#define HUAWEI_PRODUCT_E141E 0x141E -#define HUAWEI_PRODUCT_E141F 0x141F -#define HUAWEI_PRODUCT_E1420 0x1420 -#define HUAWEI_PRODUCT_E1421 0x1421 -#define HUAWEI_PRODUCT_E1422 0x1422 -#define HUAWEI_PRODUCT_E1423 0x1423 -#define HUAWEI_PRODUCT_E1424 0x1424 -#define HUAWEI_PRODUCT_E1425 0x1425 -#define HUAWEI_PRODUCT_E1426 0x1426 -#define HUAWEI_PRODUCT_E1427 0x1427 -#define HUAWEI_PRODUCT_E1428 0x1428 -#define HUAWEI_PRODUCT_E1429 0x1429 -#define HUAWEI_PRODUCT_E142A 0x142A -#define HUAWEI_PRODUCT_E142B 0x142B -#define HUAWEI_PRODUCT_E142C 0x142C -#define HUAWEI_PRODUCT_E142D 0x142D -#define HUAWEI_PRODUCT_E142E 0x142E -#define HUAWEI_PRODUCT_E142F 0x142F -#define HUAWEI_PRODUCT_E1430 0x1430 -#define HUAWEI_PRODUCT_E1431 0x1431 -#define HUAWEI_PRODUCT_E1432 0x1432 -#define HUAWEI_PRODUCT_E1433 0x1433 -#define HUAWEI_PRODUCT_E1434 0x1434 -#define HUAWEI_PRODUCT_E1435 0x1435 -#define HUAWEI_PRODUCT_E1436 0x1436 -#define HUAWEI_PRODUCT_E1437 0x1437 -#define HUAWEI_PRODUCT_E1438 0x1438 -#define HUAWEI_PRODUCT_E1439 0x1439 -#define HUAWEI_PRODUCT_E143A 0x143A -#define HUAWEI_PRODUCT_E143B 0x143B -#define HUAWEI_PRODUCT_E143C 0x143C -#define HUAWEI_PRODUCT_E143D 0x143D -#define HUAWEI_PRODUCT_E143E 0x143E -#define HUAWEI_PRODUCT_E143F 0x143F -#define HUAWEI_PRODUCT_K4505 0x1464 -#define HUAWEI_PRODUCT_K3765 0x1465 -#define HUAWEI_PRODUCT_E14AC 0x14AC -#define HUAWEI_PRODUCT_ETS1220 0x1803 - -#define QUANTA_VENDOR_ID 0x0408 -#define QUANTA_PRODUCT_Q101 0xEA02 -#define QUANTA_PRODUCT_Q111 0xEA03 -#define QUANTA_PRODUCT_GLX 0xEA04 -#define QUANTA_PRODUCT_GKE 0xEA05 -#define QUANTA_PRODUCT_GLE 0xEA06 - -#define NOVATELWIRELESS_VENDOR_ID 0x1410 - -/* YISO PRODUCTS */ - -#define YISO_VENDOR_ID 0x0EAB -#define YISO_PRODUCT_U893 0xC893 - -/* MERLIN EVDO PRODUCTS */ -#define NOVATELWIRELESS_PRODUCT_V640 0x1100 -#define NOVATELWIRELESS_PRODUCT_V620 0x1110 -#define NOVATELWIRELESS_PRODUCT_V740 0x1120 -#define NOVATELWIRELESS_PRODUCT_V720 0x1130 - -/* MERLIN HSDPA/HSPA PRODUCTS */ -#define NOVATELWIRELESS_PRODUCT_U730 0x1400 -#define NOVATELWIRELESS_PRODUCT_U740 0x1410 -#define NOVATELWIRELESS_PRODUCT_U870 0x1420 -#define NOVATELWIRELESS_PRODUCT_XU870 0x1430 -#define NOVATELWIRELESS_PRODUCT_X950D 0x1450 - -/* EXPEDITE PRODUCTS */ -#define NOVATELWIRELESS_PRODUCT_EV620 0x2100 -#define NOVATELWIRELESS_PRODUCT_ES720 0x2110 -#define NOVATELWIRELESS_PRODUCT_E725 0x2120 -#define NOVATELWIRELESS_PRODUCT_ES620 0x2130 -#define NOVATELWIRELESS_PRODUCT_EU730 0x2400 -#define NOVATELWIRELESS_PRODUCT_EU740 0x2410 -#define NOVATELWIRELESS_PRODUCT_EU870D 0x2420 - -/* OVATION PRODUCTS */ -#define NOVATELWIRELESS_PRODUCT_MC727 0x4100 -#define NOVATELWIRELESS_PRODUCT_MC950D 0x4400 -#define NOVATELWIRELESS_PRODUCT_U727 0x5010 -#define NOVATELWIRELESS_PRODUCT_MC727_NEW 0x5100 -#define NOVATELWIRELESS_PRODUCT_MC760 0x6000 -#define NOVATELWIRELESS_PRODUCT_OVMC760 0x6002 - -/* FUTURE NOVATEL PRODUCTS */ -#define NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED 0X6001 -#define NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED 0X7000 -#define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED 0X7001 -#define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED 0X8000 -#define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED 0X8001 -#define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED 0X9000 -#define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0X9001 -#define NOVATELWIRELESS_PRODUCT_GLOBAL 0XA001 - -/* AMOI PRODUCTS */ -#define AMOI_VENDOR_ID 0x1614 -#define AMOI_PRODUCT_H01 0x0800 -#define AMOI_PRODUCT_H01A 0x7002 -#define AMOI_PRODUCT_H02 0x0802 -#define AMOI_PRODUCT_SKYPEPHONE_S2 0x0407 - -#define DELL_VENDOR_ID 0x413C - -/* Dell modems */ -#define DELL_PRODUCT_5700_MINICARD 0x8114 -#define DELL_PRODUCT_5500_MINICARD 0x8115 -#define DELL_PRODUCT_5505_MINICARD 0x8116 -#define DELL_PRODUCT_5700_EXPRESSCARD 0x8117 -#define DELL_PRODUCT_5510_EXPRESSCARD 0x8118 - -#define DELL_PRODUCT_5700_MINICARD_SPRINT 0x8128 -#define DELL_PRODUCT_5700_MINICARD_TELUS 0x8129 - -#define DELL_PRODUCT_5720_MINICARD_VZW 0x8133 -#define DELL_PRODUCT_5720_MINICARD_SPRINT 0x8134 -#define DELL_PRODUCT_5720_MINICARD_TELUS 0x8135 -#define DELL_PRODUCT_5520_MINICARD_CINGULAR 0x8136 -#define DELL_PRODUCT_5520_MINICARD_GENERIC_L 0x8137 -#define DELL_PRODUCT_5520_MINICARD_GENERIC_I 0x8138 - -#define DELL_PRODUCT_5730_MINICARD_SPRINT 0x8180 -#define DELL_PRODUCT_5730_MINICARD_TELUS 0x8181 -#define DELL_PRODUCT_5730_MINICARD_VZW 0x8182 - -#define KYOCERA_VENDOR_ID 0x0c88 -#define KYOCERA_PRODUCT_KPC650 0x17da -#define KYOCERA_PRODUCT_KPC680 0x180a - -#define ANYDATA_VENDOR_ID 0x16d5 -#define ANYDATA_PRODUCT_ADU_620UW 0x6202 -#define ANYDATA_PRODUCT_ADU_E100A 0x6501 -#define ANYDATA_PRODUCT_ADU_500A 0x6502 - -#define AXESSTEL_VENDOR_ID 0x1726 -#define AXESSTEL_PRODUCT_MV110H 0x1000 - -#define BANDRICH_VENDOR_ID 0x1A8D -#define BANDRICH_PRODUCT_C100_1 0x1002 -#define BANDRICH_PRODUCT_C100_2 0x1003 -#define BANDRICH_PRODUCT_1004 0x1004 -#define BANDRICH_PRODUCT_1005 0x1005 -#define BANDRICH_PRODUCT_1006 0x1006 -#define BANDRICH_PRODUCT_1007 0x1007 -#define BANDRICH_PRODUCT_1008 0x1008 -#define BANDRICH_PRODUCT_1009 0x1009 -#define BANDRICH_PRODUCT_100A 0x100a - -#define BANDRICH_PRODUCT_100B 0x100b -#define BANDRICH_PRODUCT_100C 0x100c -#define BANDRICH_PRODUCT_100D 0x100d -#define BANDRICH_PRODUCT_100E 0x100e - -#define BANDRICH_PRODUCT_100F 0x100f -#define BANDRICH_PRODUCT_1010 0x1010 -#define BANDRICH_PRODUCT_1011 0x1011 -#define BANDRICH_PRODUCT_1012 0x1012 - -#define AMOI_VENDOR_ID 0x1614 -#define AMOI_PRODUCT_9508 0x0800 - -#define QUALCOMM_VENDOR_ID 0x05C6 - -#define CMOTECH_VENDOR_ID 0x16d8 -#define CMOTECH_PRODUCT_6008 0x6008 -#define CMOTECH_PRODUCT_6280 0x6280 - -#define TELIT_VENDOR_ID 0x1bc7 -#define TELIT_PRODUCT_UC864E 0x1003 -#define TELIT_PRODUCT_UC864G 0x1004 - -/* ZTE PRODUCTS */ -#define ZTE_VENDOR_ID 0x19d2 -#define ZTE_PRODUCT_MF622 0x0001 -#define ZTE_PRODUCT_MF628 0x0015 -#define ZTE_PRODUCT_MF626 0x0031 -#define ZTE_PRODUCT_CDMA_TECH 0xfffe -#define ZTE_PRODUCT_AC8710 0xfff1 -#define ZTE_PRODUCT_AC2726 0xfff5 -#define ZTE_PRODUCT_AC8710T 0xffff - -/* ZTE PRODUCTS -- alternate vendor ID */ -#define ZTE_VENDOR_ID2 0x1d6b -#define ZTE_PRODUCT_MF_330 0x0002 - -#define BENQ_VENDOR_ID 0x04a5 -#define BENQ_PRODUCT_H10 0x4068 - -#define DLINK_VENDOR_ID 0x1186 -#define DLINK_PRODUCT_DWM_652 0x3e04 -#define DLINK_PRODUCT_DWM_652_U5 0xce16 -#define DLINK_PRODUCT_DWM_652_U5A 0xce1e - -#define QISDA_VENDOR_ID 0x1da5 -#define QISDA_PRODUCT_H21_4512 0x4512 -#define QISDA_PRODUCT_H21_4523 0x4523 -#define QISDA_PRODUCT_H20_4515 0x4515 -#define QISDA_PRODUCT_H20_4518 0x4518 -#define QISDA_PRODUCT_H20_4519 0x4519 - -/* TLAYTECH PRODUCTS */ -#define TLAYTECH_VENDOR_ID 0x20B9 -#define TLAYTECH_PRODUCT_TEU800 0x1682 - -/* TOSHIBA PRODUCTS */ -#define TOSHIBA_VENDOR_ID 0x0930 -#define TOSHIBA_PRODUCT_HSDPA_MINICARD 0x1302 -#define TOSHIBA_PRODUCT_G450 0x0d45 - -#define ALINK_VENDOR_ID 0x1e0e -#define ALINK_PRODUCT_3GU 0x9200 - -/* ALCATEL PRODUCTS */ -#define ALCATEL_VENDOR_ID 0x1bbb -#define ALCATEL_PRODUCT_X060S 0x0000 - -#define PIRELLI_VENDOR_ID 0x1266 -#define PIRELLI_PRODUCT_C100_1 0x1002 -#define PIRELLI_PRODUCT_C100_2 0x1003 -#define PIRELLI_PRODUCT_1004 0x1004 -#define PIRELLI_PRODUCT_1005 0x1005 -#define PIRELLI_PRODUCT_1006 0x1006 -#define PIRELLI_PRODUCT_1007 0x1007 -#define PIRELLI_PRODUCT_1008 0x1008 -#define PIRELLI_PRODUCT_1009 0x1009 -#define PIRELLI_PRODUCT_100A 0x100a -#define PIRELLI_PRODUCT_100B 0x100b -#define PIRELLI_PRODUCT_100C 0x100c -#define PIRELLI_PRODUCT_100D 0x100d -#define PIRELLI_PRODUCT_100E 0x100e -#define PIRELLI_PRODUCT_100F 0x100f -#define PIRELLI_PRODUCT_1011 0x1011 -#define PIRELLI_PRODUCT_1012 0x1012 - -/* Airplus products */ -#define AIRPLUS_VENDOR_ID 0x1011 -#define AIRPLUS_PRODUCT_MCD650 0x3198 - -/* Longcheer/Longsung vendor ID; makes whitelabel devices that - * many other vendors like 4G Systems, Alcatel, ChinaBird, - * Mobidata, etc sell under their own brand names. - */ -#define LONGCHEER_VENDOR_ID 0x1c9e - -/* 4G Systems products */ -/* This is the 4G XS Stick W14 a.k.a. Mobilcom Debitel Surf-Stick * - * It seems to contain a Qualcomm QSC6240/6290 chipset */ -#define FOUR_G_SYSTEMS_PRODUCT_W14 0x9603 - -/* Haier products */ -#define HAIER_VENDOR_ID 0x201e -#define HAIER_PRODUCT_CE100 0x2009 - -/* Cinterion (formerly Siemens) products */ -#define SIEMENS_VENDOR_ID 0x0681 -#define CINTERION_VENDOR_ID 0x1e2d -#define CINTERION_PRODUCT_HC25_MDM 0x0047 -#define CINTERION_PRODUCT_HC25_MDMNET 0x0040 -#define CINTERION_PRODUCT_HC28_MDM 0x004C -#define CINTERION_PRODUCT_HC28_MDMNET 0x004A /* same for HC28J */ -#define CINTERION_PRODUCT_EU3_E 0x0051 -#define CINTERION_PRODUCT_EU3_P 0x0052 -#define CINTERION_PRODUCT_PH8 0x0053 - -/* Olivetti products */ -#define OLIVETTI_VENDOR_ID 0x0b3c -#define OLIVETTI_PRODUCT_OLICARD100 0xc000 - -/* Celot products */ -#define CELOT_VENDOR_ID 0x211f -#define CELOT_PRODUCT_CT680M 0x6801 - -/* ONDA Communication vendor id */ -#define ONDA_VENDOR_ID 0x1ee8 - -/* ONDA MT825UP HSDPA 14.2 modem */ -#define ONDA_MT825UP 0x000b - -/* Samsung products */ -#define SAMSUNG_VENDOR_ID 0x04e8 -#define SAMSUNG_PRODUCT_GT_B3730 0x6889 - -/* some devices interfaces need special handling due to a number of reasons */ -enum option_blacklist_reason { - OPTION_BLACKLIST_NONE = 0, - OPTION_BLACKLIST_SENDSETUP = 1, - OPTION_BLACKLIST_RESERVED_IF = 2 -}; - -struct option_blacklist_info { - const u32 infolen; /* number of interface numbers on blacklist */ - const u8 *ifaceinfo; /* pointer to the array holding the numbers */ - enum option_blacklist_reason reason; -}; - -static const u8 four_g_w14_no_sendsetup[] = { 0, 1 }; -static const struct option_blacklist_info four_g_w14_blacklist = { - .infolen = ARRAY_SIZE(four_g_w14_no_sendsetup), - .ifaceinfo = four_g_w14_no_sendsetup, - .reason = OPTION_BLACKLIST_SENDSETUP -}; - -static const struct usb_device_id option_ids[] = { - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_QUAD) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_QUAD_LIGHT) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_NDIS) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_NDIS_LIGHT) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_NDIS_QUAD) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_NDIS_QUAD_LIGHT) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA_BUS) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_VIPER) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_VIPER_BUS) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GT_MAX_READY) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUJI_MODEM_LIGHT) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUJI_MODEM_GT) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUJI_MODEM_EX) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_KOI_MODEM) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_SCORPION_MODEM) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_LITE) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_GT) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_EX) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_MODEM) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GTM380_MODEM) }, - { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_Q101) }, - { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_Q111) }, - { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLX) }, - { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GKE) }, - { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLE) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220BIS, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1401, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1402, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1403, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1404, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1405, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1406, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1407, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1408, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1409, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E140A, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E140B, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E140C, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E140D, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E140E, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E140F, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1410, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1411, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1412, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1413, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1414, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1415, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1416, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1417, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1418, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1419, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E141A, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E141B, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E141C, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E141D, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E141E, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E141F, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1420, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1421, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1422, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1423, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1424, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1425, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1426, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1427, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1428, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1429, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E142A, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E142B, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E142C, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E142D, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E142E, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E142F, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1430, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1431, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1432, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1433, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1434, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1435, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1436, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1437, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1438, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1439, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143A, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143B, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143C, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143D, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143E, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143F, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4505, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_ETS1220, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E14AC, 0xff, 0xff, 0xff) }, - { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_9508) }, - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) }, /* Novatel Merlin V640/XV620 */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) }, /* Novatel Merlin V620/S620 */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V740) }, /* Novatel Merlin EX720/V740/X720 */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V720) }, /* Novatel Merlin V720/S720/PC720 */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U730) }, /* Novatel U730/U740 (VF version) */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U740) }, /* Novatel U740 */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U870) }, /* Novatel U870 */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_XU870) }, /* Novatel Merlin XU870 HSDPA/3G */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_X950D) }, /* Novatel X950D */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EV620) }, /* Novatel EV620/ES620 CDMA/EV-DO */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_ES720) }, /* Novatel ES620/ES720/U720/USB720 */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E725) }, /* Novatel E725/E726 */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_ES620) }, /* Novatel Merlin ES620 SM Bus */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU730) }, /* Novatel EU730 and Vodafone EU740 */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU740) }, /* Novatel non-Vodafone EU740 */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU870D) }, /* Novatel EU850D/EU860D/EU870D */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC950D) }, /* Novatel MC930D/MC950D */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, /* Novatel MC727/U727/USB727 */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727_NEW) }, /* Novatel MC727/U727/USB727 refresh */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U727) }, /* Novatel MC727/U727/USB727 */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC760) }, /* Novatel MC760/U760/USB760 */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_OVMC760) }, /* Novatel Ovation MC760 */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED) }, /* Novatel HSPA product */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) }, /* Novatel EVDO Embedded product */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) }, /* Novatel HSPA Embedded product */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED) }, /* Novatel EVDO product */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED) }, /* Novatel HSPA product */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED) }, /* Novatel EVDO Embedded product */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED) }, /* Novatel HSPA Embedded product */ - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_GLOBAL) }, /* Novatel Global product */ - - { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, - { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, - { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H02) }, - { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_SKYPEPHONE_S2) }, - - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */ - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5500_MINICARD) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5505_MINICARD) }, /* Dell Wireless 5505 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_EXPRESSCARD) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO ExpressCard == Novatel Merlin XV620 CDMA/EV-DO */ - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5510_EXPRESSCARD) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard == Novatel Merlin XU870 HSDPA/3G */ - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD_SPRINT) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite E720 CDMA/EV-DO */ - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD_TELUS) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite ET620 CDMA/EV-DO */ - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5720_MINICARD_VZW) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */ - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5720_MINICARD_SPRINT) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */ - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5720_MINICARD_TELUS) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */ - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5520_MINICARD_CINGULAR) }, /* Dell Wireless HSDPA 5520 == Novatel Expedite EU860D */ - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5520_MINICARD_GENERIC_L) }, /* Dell Wireless HSDPA 5520 */ - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5520_MINICARD_GENERIC_I) }, /* Dell Wireless 5520 Voda I Mobile Broadband (3G HSDPA) Minicard */ - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_SPRINT) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_TELUS) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_VZW) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ - { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */ - { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, - { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) }, - { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) }, - { USB_DEVICE(YISO_VENDOR_ID, YISO_PRODUCT_U893) }, - { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, - { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, - { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1004) }, - { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1005) }, - { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1006) }, - { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1007) }, - { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1008) }, - { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1009) }, - { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_100A) }, - { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_100B) }, - { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_100C) }, - { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_100D) }, - { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_100E) }, - { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_100F) }, - { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1010) }, - { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1011) }, - { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1012) }, - { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) }, - { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, - { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */ - { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ - { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ - { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */ - { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6008) }, - { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, - { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864G) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */ - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0002, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0003, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0004, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0005, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0006, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0007, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0008, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0009, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000a, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000b, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000c, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000d, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000e, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000f, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0010, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0011, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0012, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0013, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0016, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0017, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0018, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0019, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0020, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0021, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0022, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0023, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0024, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0025, 0xff, 0xff, 0xff) }, - /* { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0026, 0xff, 0xff, 0xff) }, */ - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0028, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0029, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0030, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0032, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0033, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0034, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0037, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0038, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0039, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0040, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0042, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0043, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0044, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0048, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0049, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0050, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0051, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0052, 0xff, 0xff, 0xff) }, - /* { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0053, 0xff, 0xff, 0xff) }, */ - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0054, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0055, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0056, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0057, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0058, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0061, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0062, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0063, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0064, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0065, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0066, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0067, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0069, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0076, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0077, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0078, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0079, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0082, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0083, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0086, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0087, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0104, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0105, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0106, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0108, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0113, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0117, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0118, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0121, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0122, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0123, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0124, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0125, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0126, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0128, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0142, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0143, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0144, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0145, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0146, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0147, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0148, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0149, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0150, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0151, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0152, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0153, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0154, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0155, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0156, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0157, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0158, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0159, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0160, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0161, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0162, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1057, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1058, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1059, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1060, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1061, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1062, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1063, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1064, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1065, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1066, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1067, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1068, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1069, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1070, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1071, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1072, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1073, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1074, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1075, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1076, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1077, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1078, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1079, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1080, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1081, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1082, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1083, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1084, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1085, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1086, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1087, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1088, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1089, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1090, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1091, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1092, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1093, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1094, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1095, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1096, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1097, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1098, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1099, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1100, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1101, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1102, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1103, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1104, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1105, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1106, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1107, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1108, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1109, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1110, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1111, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1112, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1113, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1114, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1115, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1116, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1117, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1118, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1119, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1120, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1121, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1122, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1123, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1124, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1125, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1126, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1127, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1128, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1129, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1130, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1131, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1132, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1133, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1134, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1135, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1136, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1137, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1138, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1139, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1140, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1141, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1142, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1143, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1144, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1145, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1146, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1147, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1148, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1149, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1150, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1151, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1152, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1153, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1154, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1155, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1156, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1157, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1158, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1159, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1160, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1161, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1162, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1163, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1164, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1165, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1166, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1167, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1168, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1169, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1170, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1244, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1245, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1246, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1247, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1248, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1249, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1250, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1251, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1252, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1253, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1254, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1255, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1256, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1257, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1258, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1259, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1260, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1261, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1262, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1263, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1264, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1265, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1266, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1267, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1268, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1269, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1270, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1271, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1272, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1273, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1274, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1275, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1276, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1277, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1278, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1279, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1280, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1281, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1282, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1283, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1284, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1285, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1286, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1287, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1288, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1289, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1290, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1291, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1292, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1293, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1294, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1295, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1296, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1297, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) }, /* ZTE CDMA products */ - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0027, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0060, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0141, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710T, 0xff, 0xff, 0xff) }, - { USB_DEVICE(ZTE_VENDOR_ID2, ZTE_PRODUCT_MF_330) }, - { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, - { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, - { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */ - { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5A) }, - { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) }, - { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) }, - { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) }, - { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4518) }, - { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4519) }, - { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_G450) }, - { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */ - { USB_DEVICE(ALINK_VENDOR_ID, 0x9000) }, - { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) }, - { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) }, - { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, - { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, - { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), - .driver_info = (kernel_ulong_t)&four_g_w14_blacklist - }, - { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) }, - /* Pirelli */ - { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_1)}, - { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_2)}, - { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1004)}, - { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1005)}, - { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1006)}, - { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1007)}, - { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1008)}, - { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1009)}, - { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100A)}, - { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100B) }, - { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100C) }, - { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100D) }, - { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100E) }, - { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100F) }, - { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)}, - { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)}, - /* Cinterion */ - { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_E) }, - { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) }, - { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8) }, - { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, - { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, - { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDM) }, - { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDMNET) }, - { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, /* HC28 enumerates with Siemens or Cinterion VID depending on FW revision */ - { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, - - { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) }, - { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ - { USB_DEVICE(ONDA_VENDOR_ID, ONDA_MT825UP) }, /* ONDA MT825UP modem */ - { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730/GT-B3710 LTE USB modem.*/ - { } /* Terminating entry */ -}; -MODULE_DEVICE_TABLE(usb, option_ids); - -static struct usb_driver option_driver = { - .name = "option", - .probe = usb_serial_probe, - .disconnect = usb_serial_disconnect, -#ifdef CONFIG_PM - .suspend = usb_serial_suspend, - .resume = usb_serial_resume, - .supports_autosuspend = 1, -#endif - .id_table = option_ids, - .no_dynamic_id = 1, -}; - -/* The card has three separate interfaces, which the serial driver - * recognizes separately, thus num_port=1. - */ - -static struct usb_serial_driver option_1port_device = { - .driver = { - .owner = THIS_MODULE, - .name = "option1", - }, - .description = "GSM modem (1-port)", - .usb_driver = &option_driver, - .id_table = option_ids, - .num_ports = 1, - .probe = option_probe, - .open = option_open, - .close = option_close, - .dtr_rts = option_dtr_rts, - .write = option_write, - .write_room = option_write_room, - .chars_in_buffer = option_chars_in_buffer, - .set_termios = option_set_termios, - .tiocmget = option_tiocmget, - .tiocmset = option_tiocmset, - .attach = option_startup, - .disconnect = option_disconnect, - .release = option_release, - .read_int_callback = option_instat_callback, -#ifdef CONFIG_PM - .suspend = option_suspend, - .resume = option_resume, -#endif -}; - -static int debug; - -/* per port private data */ - -#define N_IN_URB 4 -#define N_OUT_URB 4 -#define IN_BUFLEN 4096 -#define OUT_BUFLEN 4096 - -struct option_intf_private { - spinlock_t susp_lock; - unsigned int suspended:1; - int in_flight; - struct option_blacklist_info *blacklist_info; -}; - -struct option_port_private { - /* Input endpoints and buffer for this port */ - struct urb *in_urbs[N_IN_URB]; - u8 *in_buffer[N_IN_URB]; - /* Output endpoints and buffer for this port */ - struct urb *out_urbs[N_OUT_URB]; - u8 *out_buffer[N_OUT_URB]; - unsigned long out_busy; /* Bit vector of URBs in use */ - int opened; - struct usb_anchor delayed; - - /* Settings for the port */ - int rts_state; /* Handshaking pins (outputs) */ - int dtr_state; - int cts_state; /* Handshaking pins (inputs) */ - int dsr_state; - int dcd_state; - int ri_state; - - unsigned long tx_start_time[N_OUT_URB]; -}; - -/* Functions used by new usb-serial code. */ -static int __init option_init(void) -{ - int retval; - retval = usb_serial_register(&option_1port_device); - if (retval) - goto failed_1port_device_register; - retval = usb_register(&option_driver); - if (retval) - goto failed_driver_register; - - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" - DRIVER_DESC "\n"); - - return 0; - -failed_driver_register: - usb_serial_deregister(&option_1port_device); -failed_1port_device_register: - return retval; -} - -static void __exit option_exit(void) -{ - usb_deregister(&option_driver); - usb_serial_deregister(&option_1port_device); -} - -module_init(option_init); -module_exit(option_exit); - -static int option_probe(struct usb_serial *serial, - const struct usb_device_id *id) -{ - struct option_intf_private *data; - - /* D-Link DWM 652 still exposes CD-Rom emulation interface in modem mode */ - if (serial->dev->descriptor.idVendor == DLINK_VENDOR_ID && - serial->dev->descriptor.idProduct == DLINK_PRODUCT_DWM_652 && - serial->interface->cur_altsetting->desc.bInterfaceClass == 0x8) - return -ENODEV; - - /* Bandrich modem and AT command interface is 0xff */ - if ((serial->dev->descriptor.idVendor == BANDRICH_VENDOR_ID || - serial->dev->descriptor.idVendor == PIRELLI_VENDOR_ID) && - serial->interface->cur_altsetting->desc.bInterfaceClass != 0xff) - return -ENODEV; - - /* Don't bind network interfaces on Huawei K3765 & K4505 */ - if (serial->dev->descriptor.idVendor == HUAWEI_VENDOR_ID && - (serial->dev->descriptor.idProduct == HUAWEI_PRODUCT_K3765 || - serial->dev->descriptor.idProduct == HUAWEI_PRODUCT_K4505) && - serial->interface->cur_altsetting->desc.bInterfaceNumber == 1) - return -ENODEV; - - data = serial->private = kzalloc(sizeof(struct option_intf_private), GFP_KERNEL); - if (!data) - return -ENOMEM; - spin_lock_init(&data->susp_lock); - data->blacklist_info = (struct option_blacklist_info*) id->driver_info; - return 0; -} - -static enum option_blacklist_reason is_blacklisted(const u8 ifnum, - const struct option_blacklist_info *blacklist) -{ - const u8 *info; - int i; - - if (blacklist) { - info = blacklist->ifaceinfo; - - for (i = 0; i < blacklist->infolen; i++) { - if (info[i] == ifnum) - return blacklist->reason; - } - } - return OPTION_BLACKLIST_NONE; -} - -static void option_set_termios(struct tty_struct *tty, - struct usb_serial_port *port, struct ktermios *old_termios) -{ - dbg("%s", __func__); - /* Doesn't support option setting */ - tty_termios_copy_hw(tty->termios, old_termios); - option_send_setup(port); -} - -static int option_tiocmget(struct tty_struct *tty, struct file *file) -{ - struct usb_serial_port *port = tty->driver_data; - unsigned int value; - struct option_port_private *portdata; - - portdata = usb_get_serial_port_data(port); - - value = ((portdata->rts_state) ? TIOCM_RTS : 0) | - ((portdata->dtr_state) ? TIOCM_DTR : 0) | - ((portdata->cts_state) ? TIOCM_CTS : 0) | - ((portdata->dsr_state) ? TIOCM_DSR : 0) | - ((portdata->dcd_state) ? TIOCM_CAR : 0) | - ((portdata->ri_state) ? TIOCM_RNG : 0); - - return value; -} - -static int option_tiocmset(struct tty_struct *tty, struct file *file, - unsigned int set, unsigned int clear) -{ - struct usb_serial_port *port = tty->driver_data; - struct option_port_private *portdata; - - portdata = usb_get_serial_port_data(port); - - /* FIXME: what locks portdata fields ? */ - if (set & TIOCM_RTS) - portdata->rts_state = 1; - if (set & TIOCM_DTR) - portdata->dtr_state = 1; - - if (clear & TIOCM_RTS) - portdata->rts_state = 0; - if (clear & TIOCM_DTR) - portdata->dtr_state = 0; - return option_send_setup(port); -} - -/* Write */ -static int option_write(struct tty_struct *tty, struct usb_serial_port *port, - const unsigned char *buf, int count) -{ - struct option_port_private *portdata; - struct option_intf_private *intfdata; - int i; - int left, todo; - struct urb *this_urb = NULL; /* spurious */ - int err; - unsigned long flags; - - portdata = usb_get_serial_port_data(port); - intfdata = port->serial->private; - - dbg("%s: write (%d chars)", __func__, count); - - i = 0; - left = count; - for (i = 0; left > 0 && i < N_OUT_URB; i++) { - todo = left; - if (todo > OUT_BUFLEN) - todo = OUT_BUFLEN; - - this_urb = portdata->out_urbs[i]; - if (test_and_set_bit(i, &portdata->out_busy)) { - if (time_before(jiffies, - portdata->tx_start_time[i] + 10 * HZ)) - continue; - usb_unlink_urb(this_urb); - continue; - } - dbg("%s: endpoint %d buf %d", __func__, - usb_pipeendpoint(this_urb->pipe), i); - - err = usb_autopm_get_interface_async(port->serial->interface); - if (err < 0) - break; - - /* send the data */ - memcpy(this_urb->transfer_buffer, buf, todo); - this_urb->transfer_buffer_length = todo; - - spin_lock_irqsave(&intfdata->susp_lock, flags); - if (intfdata->suspended) { - usb_anchor_urb(this_urb, &portdata->delayed); - spin_unlock_irqrestore(&intfdata->susp_lock, flags); - } else { - intfdata->in_flight++; - spin_unlock_irqrestore(&intfdata->susp_lock, flags); - err = usb_submit_urb(this_urb, GFP_ATOMIC); - if (err) { - dbg("usb_submit_urb %p (write bulk) failed " - "(%d)", this_urb, err); - clear_bit(i, &portdata->out_busy); - spin_lock_irqsave(&intfdata->susp_lock, flags); - intfdata->in_flight--; - spin_unlock_irqrestore(&intfdata->susp_lock, flags); - continue; - } - } - - portdata->tx_start_time[i] = jiffies; - buf += todo; - left -= todo; - } - - count -= left; - dbg("%s: wrote (did %d)", __func__, count); - return count; -} - -static void option_indat_callback(struct urb *urb) -{ - int err; - int endpoint; - struct usb_serial_port *port; - struct tty_struct *tty; - unsigned char *data = urb->transfer_buffer; - int status = urb->status; - - dbg("%s: %p", __func__, urb); - - endpoint = usb_pipeendpoint(urb->pipe); - port = urb->context; - - if (status) { - dbg("%s: nonzero status: %d on endpoint %02x.", - __func__, status, endpoint); - } else { - tty = tty_port_tty_get(&port->port); - if (urb->actual_length) { - tty_insert_flip_string(tty, data, urb->actual_length); - tty_flip_buffer_push(tty); - } else - dbg("%s: empty read urb received", __func__); - tty_kref_put(tty); - - /* Resubmit urb so we continue receiving */ - if (status != -ESHUTDOWN) { - err = usb_submit_urb(urb, GFP_ATOMIC); - if (err && err != -EPERM) - printk(KERN_ERR "%s: resubmit read urb failed. " - "(%d)", __func__, err); - else - usb_mark_last_busy(port->serial->dev); - } - - } - return; -} - -static void option_outdat_callback(struct urb *urb) -{ - struct usb_serial_port *port; - struct option_port_private *portdata; - struct option_intf_private *intfdata; - int i; - - dbg("%s", __func__); - - port = urb->context; - intfdata = port->serial->private; - - usb_serial_port_softint(port); - usb_autopm_put_interface_async(port->serial->interface); - portdata = usb_get_serial_port_data(port); - spin_lock(&intfdata->susp_lock); - intfdata->in_flight--; - spin_unlock(&intfdata->susp_lock); - - for (i = 0; i < N_OUT_URB; ++i) { - if (portdata->out_urbs[i] == urb) { - smp_mb__before_clear_bit(); - clear_bit(i, &portdata->out_busy); - break; - } - } -} - -static void option_instat_callback(struct urb *urb) -{ - int err; - int status = urb->status; - struct usb_serial_port *port = urb->context; - struct option_port_private *portdata = usb_get_serial_port_data(port); - - dbg("%s", __func__); - dbg("%s: urb %p port %p has data %p", __func__, urb, port, portdata); - - if (status == 0) { - struct usb_ctrlrequest *req_pkt = - (struct usb_ctrlrequest *)urb->transfer_buffer; - - if (!req_pkt) { - dbg("%s: NULL req_pkt", __func__); - return; - } - if ((req_pkt->bRequestType == 0xA1) && - (req_pkt->bRequest == 0x20)) { - int old_dcd_state; - unsigned char signals = *((unsigned char *) - urb->transfer_buffer + - sizeof(struct usb_ctrlrequest)); - - dbg("%s: signal x%x", __func__, signals); - - old_dcd_state = portdata->dcd_state; - portdata->cts_state = 1; - portdata->dcd_state = ((signals & 0x01) ? 1 : 0); - portdata->dsr_state = ((signals & 0x02) ? 1 : 0); - portdata->ri_state = ((signals & 0x08) ? 1 : 0); - - if (old_dcd_state && !portdata->dcd_state) { - struct tty_struct *tty = - tty_port_tty_get(&port->port); - if (tty && !C_CLOCAL(tty)) - tty_hangup(tty); - tty_kref_put(tty); - } - } else { - dbg("%s: type %x req %x", __func__, - req_pkt->bRequestType, req_pkt->bRequest); - } - } else - err("%s: error %d", __func__, status); - - /* Resubmit urb so we continue receiving IRQ data */ - if (status != -ESHUTDOWN && status != -ENOENT) { - err = usb_submit_urb(urb, GFP_ATOMIC); - if (err) - dbg("%s: resubmit intr urb failed. (%d)", - __func__, err); - } -} - -static int option_write_room(struct tty_struct *tty) -{ - struct usb_serial_port *port = tty->driver_data; - struct option_port_private *portdata; - int i; - int data_len = 0; - struct urb *this_urb; - - portdata = usb_get_serial_port_data(port); - - for (i = 0; i < N_OUT_URB; i++) { - this_urb = portdata->out_urbs[i]; - if (this_urb && !test_bit(i, &portdata->out_busy)) - data_len += OUT_BUFLEN; - } - - dbg("%s: %d", __func__, data_len); - return data_len; -} - -static int option_chars_in_buffer(struct tty_struct *tty) -{ - struct usb_serial_port *port = tty->driver_data; - struct option_port_private *portdata; - int i; - int data_len = 0; - struct urb *this_urb; - - portdata = usb_get_serial_port_data(port); - - for (i = 0; i < N_OUT_URB; i++) { - this_urb = portdata->out_urbs[i]; - /* FIXME: This locking is insufficient as this_urb may - go unused during the test */ - if (this_urb && test_bit(i, &portdata->out_busy)) - data_len += this_urb->transfer_buffer_length; - } - dbg("%s: %d", __func__, data_len); - return data_len; -} - -static int option_open(struct tty_struct *tty, struct usb_serial_port *port) -{ - struct option_port_private *portdata; - struct option_intf_private *intfdata; - struct usb_serial *serial = port->serial; - int i, err; - struct urb *urb; - - portdata = usb_get_serial_port_data(port); - intfdata = serial->private; - - dbg("%s", __func__); - - /* Start reading from the IN endpoint */ - for (i = 0; i < N_IN_URB; i++) { - urb = portdata->in_urbs[i]; - if (!urb) - continue; - err = usb_submit_urb(urb, GFP_KERNEL); - if (err) { - dbg("%s: submit urb %d failed (%d) %d", - __func__, i, err, - urb->transfer_buffer_length); - } - } - - option_send_setup(port); - - serial->interface->needs_remote_wakeup = 1; - spin_lock_irq(&intfdata->susp_lock); - portdata->opened = 1; - spin_unlock_irq(&intfdata->susp_lock); - usb_autopm_put_interface(serial->interface); - - return 0; -} - -static void option_dtr_rts(struct usb_serial_port *port, int on) -{ - struct usb_serial *serial = port->serial; - struct option_port_private *portdata; - - dbg("%s", __func__); - portdata = usb_get_serial_port_data(port); - mutex_lock(&serial->disc_mutex); - portdata->rts_state = on; - portdata->dtr_state = on; - if (serial->dev) - option_send_setup(port); - mutex_unlock(&serial->disc_mutex); -} - - -static void option_close(struct usb_serial_port *port) -{ - int i; - struct usb_serial *serial = port->serial; - struct option_port_private *portdata; - struct option_intf_private *intfdata = port->serial->private; - - dbg("%s", __func__); - portdata = usb_get_serial_port_data(port); - - if (serial->dev) { - /* Stop reading/writing urbs */ - spin_lock_irq(&intfdata->susp_lock); - portdata->opened = 0; - spin_unlock_irq(&intfdata->susp_lock); - - for (i = 0; i < N_IN_URB; i++) - usb_kill_urb(portdata->in_urbs[i]); - for (i = 0; i < N_OUT_URB; i++) - usb_kill_urb(portdata->out_urbs[i]); - usb_autopm_get_interface(serial->interface); - serial->interface->needs_remote_wakeup = 0; - } -} - -/* Helper functions used by option_setup_urbs */ -static struct urb *option_setup_urb(struct usb_serial *serial, int endpoint, - int dir, void *ctx, char *buf, int len, - void (*callback)(struct urb *)) -{ - struct urb *urb; - - if (endpoint == -1) - return NULL; /* endpoint not needed */ - - urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */ - if (urb == NULL) { - dbg("%s: alloc for endpoint %d failed.", __func__, endpoint); - return NULL; - } - - /* Fill URB using supplied data. */ - usb_fill_bulk_urb(urb, serial->dev, - usb_sndbulkpipe(serial->dev, endpoint) | dir, - buf, len, callback, ctx); - - return urb; -} - -/* Setup urbs */ -static void option_setup_urbs(struct usb_serial *serial) -{ - int i, j; - struct usb_serial_port *port; - struct option_port_private *portdata; - - dbg("%s", __func__); - - for (i = 0; i < serial->num_ports; i++) { - port = serial->port[i]; - portdata = usb_get_serial_port_data(port); - - /* Do indat endpoints first */ - for (j = 0; j < N_IN_URB; ++j) { - portdata->in_urbs[j] = option_setup_urb(serial, - port->bulk_in_endpointAddress, - USB_DIR_IN, port, - portdata->in_buffer[j], - IN_BUFLEN, option_indat_callback); - } - - /* outdat endpoints */ - for (j = 0; j < N_OUT_URB; ++j) { - portdata->out_urbs[j] = option_setup_urb(serial, - port->bulk_out_endpointAddress, - USB_DIR_OUT, port, - portdata->out_buffer[j], - OUT_BUFLEN, option_outdat_callback); - } - } -} - - -/** send RTS/DTR state to the port. - * - * This is exactly the same as SET_CONTROL_LINE_STATE from the PSTN - * CDC. -*/ -static int option_send_setup(struct usb_serial_port *port) -{ - struct usb_serial *serial = port->serial; - struct option_intf_private *intfdata = - (struct option_intf_private *) serial->private; - struct option_port_private *portdata; - int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber; - int val = 0; - dbg("%s", __func__); - - if (is_blacklisted(ifNum, intfdata->blacklist_info) == - OPTION_BLACKLIST_SENDSETUP) { - dbg("No send_setup on blacklisted interface #%d\n", ifNum); - return -EIO; - } - - portdata = usb_get_serial_port_data(port); - - if (portdata->dtr_state) - val |= 0x01; - if (portdata->rts_state) - val |= 0x02; - - return usb_control_msg(serial->dev, - usb_rcvctrlpipe(serial->dev, 0), - 0x22, 0x21, val, ifNum, NULL, 0, USB_CTRL_SET_TIMEOUT); -} - -static int option_startup(struct usb_serial *serial) -{ - int i, j, err; - struct usb_serial_port *port; - struct option_port_private *portdata; - u8 *buffer; - - dbg("%s", __func__); - - /* Now setup per port private data */ - for (i = 0; i < serial->num_ports; i++) { - port = serial->port[i]; - portdata = kzalloc(sizeof(*portdata), GFP_KERNEL); - if (!portdata) { - dbg("%s: kmalloc for option_port_private (%d) failed!.", - __func__, i); - return 1; - } - init_usb_anchor(&portdata->delayed); - - for (j = 0; j < N_IN_URB; j++) { - buffer = (u8 *)__get_free_page(GFP_KERNEL); - if (!buffer) - goto bail_out_error; - portdata->in_buffer[j] = buffer; - } - - for (j = 0; j < N_OUT_URB; j++) { - buffer = kmalloc(OUT_BUFLEN, GFP_KERNEL); - if (!buffer) - goto bail_out_error2; - portdata->out_buffer[j] = buffer; - } - - usb_set_serial_port_data(port, portdata); - - if (!port->interrupt_in_urb) - continue; - err = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); - if (err) - dbg("%s: submit irq_in urb failed %d", - __func__, err); - } - option_setup_urbs(serial); - return 0; - -bail_out_error2: - for (j = 0; j < N_OUT_URB; j++) - kfree(portdata->out_buffer[j]); -bail_out_error: - for (j = 0; j < N_IN_URB; j++) - if (portdata->in_buffer[j]) - free_page((unsigned long)portdata->in_buffer[j]); - kfree(portdata); - return 1; -} - -static void stop_read_write_urbs(struct usb_serial *serial) -{ - int i, j; - struct usb_serial_port *port; - struct option_port_private *portdata; - - /* Stop reading/writing urbs */ - for (i = 0; i < serial->num_ports; ++i) { - port = serial->port[i]; - portdata = usb_get_serial_port_data(port); - for (j = 0; j < N_IN_URB; j++) - usb_kill_urb(portdata->in_urbs[j]); - for (j = 0; j < N_OUT_URB; j++) - usb_kill_urb(portdata->out_urbs[j]); - } -} - -static void option_disconnect(struct usb_serial *serial) -{ - dbg("%s", __func__); - - stop_read_write_urbs(serial); -} - -static void option_release(struct usb_serial *serial) -{ - int i, j; - struct usb_serial_port *port; - struct option_port_private *portdata; - - dbg("%s", __func__); - - /* Now free them */ - for (i = 0; i < serial->num_ports; ++i) { - port = serial->port[i]; - portdata = usb_get_serial_port_data(port); - - for (j = 0; j < N_IN_URB; j++) { - if (portdata->in_urbs[j]) { - usb_free_urb(portdata->in_urbs[j]); - free_page((unsigned long) - portdata->in_buffer[j]); - portdata->in_urbs[j] = NULL; - } - } - for (j = 0; j < N_OUT_URB; j++) { - if (portdata->out_urbs[j]) { - usb_free_urb(portdata->out_urbs[j]); - kfree(portdata->out_buffer[j]); - portdata->out_urbs[j] = NULL; - } - } - } - - /* Now free per port private data */ - for (i = 0; i < serial->num_ports; i++) { - port = serial->port[i]; - kfree(usb_get_serial_port_data(port)); - } -} - -#ifdef CONFIG_PM -static int option_suspend(struct usb_serial *serial, pm_message_t message) -{ - struct option_intf_private *intfdata = serial->private; - int b; - - dbg("%s entered", __func__); - - if (message.event & PM_EVENT_AUTO) { - spin_lock_irq(&intfdata->susp_lock); - b = intfdata->in_flight; - spin_unlock_irq(&intfdata->susp_lock); - - if (b) - return -EBUSY; - } - - spin_lock_irq(&intfdata->susp_lock); - intfdata->suspended = 1; - spin_unlock_irq(&intfdata->susp_lock); - stop_read_write_urbs(serial); - - return 0; -} - -static void play_delayed(struct usb_serial_port *port) -{ - struct option_intf_private *data; - struct option_port_private *portdata; - struct urb *urb; - int err; - - portdata = usb_get_serial_port_data(port); - data = port->serial->private; - while ((urb = usb_get_from_anchor(&portdata->delayed))) { - err = usb_submit_urb(urb, GFP_ATOMIC); - if (!err) - data->in_flight++; - } -} - -static int option_resume(struct usb_serial *serial) -{ - int i, j; - struct usb_serial_port *port; - struct option_intf_private *intfdata = serial->private; - struct option_port_private *portdata; - struct urb *urb; - int err = 0; - - dbg("%s entered", __func__); - /* get the interrupt URBs resubmitted unconditionally */ - for (i = 0; i < serial->num_ports; i++) { - port = serial->port[i]; - if (!port->interrupt_in_urb) { - dbg("%s: No interrupt URB for port %d", __func__, i); - continue; - } - err = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO); - dbg("Submitted interrupt URB for port %d (result %d)", i, err); - if (err < 0) { - err("%s: Error %d for interrupt URB of port%d", - __func__, err, i); - goto err_out; - } - } - - for (i = 0; i < serial->num_ports; i++) { - /* walk all ports */ - port = serial->port[i]; - portdata = usb_get_serial_port_data(port); - - /* skip closed ports */ - spin_lock_irq(&intfdata->susp_lock); - if (!portdata->opened) { - spin_unlock_irq(&intfdata->susp_lock); - continue; - } - - for (j = 0; j < N_IN_URB; j++) { - urb = portdata->in_urbs[j]; - err = usb_submit_urb(urb, GFP_ATOMIC); - if (err < 0) { - err("%s: Error %d for bulk URB %d", - __func__, err, i); - spin_unlock_irq(&intfdata->susp_lock); - goto err_out; - } - } - play_delayed(port); - spin_unlock_irq(&intfdata->susp_lock); - } - spin_lock_irq(&intfdata->susp_lock); - intfdata->suspended = 0; - spin_unlock_irq(&intfdata->susp_lock); -err_out: - return err; -} -#endif - -MODULE_AUTHOR(DRIVER_AUTHOR); -MODULE_DESCRIPTION(DRIVER_DESC); -MODULE_VERSION(DRIVER_VERSION); -MODULE_LICENSE("GPL"); - -module_param(debug, bool, S_IRUGO | S_IWUSR); -MODULE_PARM_DESC(debug, "Debug messages"); diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/README b/src/mod/endpoints/mod_gsmopen/gsmlib/README deleted file mode 100644 index 9dbb65daa8..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/README +++ /dev/null @@ -1,8 +0,0 @@ -For Linux distros without gsmlib (eg: CentOS): - -In the directory gsmlib-1.10-patched-13ubuntu is the source for gsmlib -as patched by Ubuntu for modern compilers: - - ./configure - make - make install diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ABOUT-NLS b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ABOUT-NLS deleted file mode 100644 index 28d38c76fd..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ABOUT-NLS +++ /dev/null @@ -1,226 +0,0 @@ -Notes on the Free Translation Project -************************************* - - Free software is going international! The Free Translation Project -is a way to get maintainers of free software, translators, and users all -together, so that will gradually become able to speak many languages. -A few packages already provide translations for their messages. - - If you found this `ABOUT-NLS' file inside a distribution, you may -assume that the distributed package does use GNU `gettext' internally, -itself available at your nearest GNU archive site. But you do *not* -need to install GNU `gettext' prior to configuring, installing or using -this package with messages translated. - - Installers will find here some useful hints. These notes also -explain how users should proceed for getting the programs to use the -available translations. They tell how people wanting to contribute and -work at translations should contact the appropriate team. - - When reporting bugs in the `intl/' directory or bugs which may be -related to internationalization, you should tell about the version of -`gettext' which is used. The information can be found in the -`intl/VERSION' file, in internationalized packages. - -One advise in advance -===================== - - If you want to exploit the full power of internationalization, you -should configure it using - - ./configure --with-included-gettext - -to force usage of internationalizing routines provided within this -package, despite the existence of internationalizing capabilities in the -operating system where this package is being installed. So far, only -the `gettext' implementation in the GNU C library version 2 provides as -many features (such as locale alias or message inheritance) as the -implementation here. It is also not possible to offer this additional -functionality on top of a `catgets' implementation. Future versions of -GNU `gettext' will very likely convey even more functionality. So it -might be a good idea to change to GNU `gettext' as soon as possible. - - So you need not provide this option if you are using GNU libc 2 or -you have installed a recent copy of the GNU gettext package with the -included `libintl'. - -INSTALL Matters -=============== - - Some packages are "localizable" when properly installed; the -programs they contain can be made to speak your own native language. -Most such packages use GNU `gettext'. Other packages have their own -ways to internationalization, predating GNU `gettext'. - - By default, this package will be installed to allow translation of -messages. It will automatically detect whether the system provides -usable `catgets' (if using this is selected by the installer) or -`gettext' functions. If neither is available, the GNU `gettext' own -library will be used. This library is wholly contained within this -package, usually in the `intl/' subdirectory, so prior installation of -the GNU `gettext' package is *not* required. Installers may use -special options at configuration time for changing the default -behaviour. The commands: - - ./configure --with-included-gettext - ./configure --with-catgets - ./configure --disable-nls - -will respectively bypass any pre-existing `catgets' or `gettext' to use -the internationalizing routines provided within this package, enable -the use of the `catgets' functions (if found on the locale system), or -else, *totally* disable translation of messages. - - When you already have GNU `gettext' installed on your system and run -configure without an option for your new package, `configure' will -probably detect the previously built and installed `libintl.a' file and -will decide to use this. This might be not what is desirable. You -should use the more recent version of the GNU `gettext' library. I.e. -if the file `intl/VERSION' shows that the library which comes with this -package is more recent, you should use - - ./configure --with-included-gettext - -to prevent auto-detection. - - By default the configuration process will not test for the `catgets' -function and therefore they will not be used. The reasons are already -given above: the emulation on top of `catgets' cannot provide all the -extensions provided by the GNU `gettext' library. If you nevertheless -want to use the `catgets' functions use - - ./configure --with-catgets - -to enable the test for `catgets' (this causes no harm if `catgets' is -not available on your system). If you really select this option we -would like to hear about the reasons because we cannot think of any -good one ourself. - - Internationalized packages have usually many `po/LL.po' files, where -LL gives an ISO 639 two-letter code identifying the language. Unless -translations have been forbidden at `configure' time by using the -`--disable-nls' switch, all available translations are installed -together with the package. However, the environment variable `LINGUAS' -may be set, prior to configuration, to limit the installed set. -`LINGUAS' should then contain a space separated list of two-letter -codes, stating which languages are allowed. - -Using This Package -================== - - As a user, if your language has been installed for this package, you -only have to set the `LANG' environment variable to the appropriate -ISO 639 `LL' two-letter code prior to using the programs in the -package. For example, let's suppose that you speak German. At the -shell prompt, merely execute `setenv LANG de' (in `csh'), -`export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash'). This -can be done from your `.login' or `.profile' file, once and for all. - - An operating system might already offer message localization for -many of its programs, while other programs have been installed locally -with the full capabilities of GNU `gettext'. Just using `gettext' -extended syntax for `LANG' would break proper localization of already -available operating system programs. In this case, users should set -both `LANGUAGE' and `LANG' variables in their environment, as programs -using GNU `gettext' give preference to `LANGUAGE'. For example, some -Swedish users would rather read translations in German than English for -when Swedish is not available. This is easily accomplished by setting -`LANGUAGE' to `sv:de' while leaving `LANG' to `sv'. - -Translating Teams -================= - - For the Free Translation Project to be a success, we need interested -people who like their own language and write it well, and who are also -able to synergize with other translators speaking the same language. -Each translation team has its own mailing list, courtesy of Linux -International. You may reach your translation team at the address -`LL@li.org', replacing LL by the two-letter ISO 639 code for your -language. Language codes are *not* the same as the country codes given -in ISO 3166. The following translation teams exist, as of December -1997: - - Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en', - Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian - `hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja', - Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish - `pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es', - Swedish `sv', and Turkish `tr'. - -For example, you may reach the Chinese translation team by writing to -`zh@li.org'. - - If you'd like to volunteer to *work* at translating messages, you -should become a member of the translating team for your own language. -The subscribing address is *not* the same as the list itself, it has -`-request' appended. For example, speakers of Swedish can send a -message to `sv-request@li.org', having this message body: - - subscribe - - Keep in mind that team members are expected to participate -*actively* in translations, or at solving translational difficulties, -rather than merely lurking around. If your team does not exist yet and -you want to start one, or if you are unsure about what to do or how to -get started, please write to `translation@iro.umontreal.ca' to reach the -coordinator for all translator teams. - - The English team is special. It works at improving and uniformizing -the terminology in use. Proven linguistic skill are praised more than -programming skill, here. - -Available Packages -================== - - Languages are not equally supported in all packages. The following -matrix shows the current state of internationalization, as of December -1997. The matrix shows, in regard of each package, for which languages -PO files have been submitted to translation coordination. - - Ready PO files cs da de en es fi fr it ja ko nl no pl pt ru sl sv - .----------------------------------------------------. - bash | [] [] [] | 3 - bison | [] [] [] | 3 - clisp | [] [] [] [] | 4 - cpio | [] [] [] [] [] [] | 6 - diffutils | [] [] [] [] [] | 5 - enscript | [] [] [] [] [] [] | 6 - fileutils | [] [] [] [] [] [] [] [] [] [] | 10 - findutils | [] [] [] [] [] [] [] [] [] | 9 - flex | [] [] [] [] | 4 - gcal | [] [] [] [] [] | 5 - gettext | [] [] [] [] [] [] [] [] [] [] [] | 12 - grep | [] [] [] [] [] [] [] [] [] [] | 10 - hello | [] [] [] [] [] [] [] [] [] [] [] | 11 - id-utils | [] [] [] | 3 - indent | [] [] [] [] [] | 5 - libc | [] [] [] [] [] [] [] | 7 - m4 | [] [] [] [] [] [] | 6 - make | [] [] [] [] [] [] | 6 - music | [] [] | 2 - ptx | [] [] [] [] [] [] [] [] | 8 - recode | [] [] [] [] [] [] [] [] [] | 9 - sh-utils | [] [] [] [] [] [] [] [] | 8 - sharutils | [] [] [] [] [] [] | 6 - tar | [] [] [] [] [] [] [] [] [] [] [] | 11 - texinfo | [] [] [] | 3 - textutils | [] [] [] [] [] [] [] [] [] | 9 - wdiff | [] [] [] [] [] [] [] [] | 8 - `----------------------------------------------------' - 17 languages cs da de en es fi fr it ja ko nl no pl pt ru sl sv - 27 packages 6 4 25 1 18 1 26 2 1 12 20 9 19 7 4 7 17 179 - - Some counters in the preceding matrix are higher than the number of -visible blocks let us expect. This is because a few extra PO files are -used for implementing regional variants of languages, or language -dialects. - - For a PO file in the matrix above to be effective, the package to -which it applies should also have been internationalized and -distributed as such by its maintainer. There might be an observable -lag between the mere existence a PO file and its wide availability in a -distribution. - - If December 1997 seems to be old, you may fetch a more recent copy -of this `ABOUT-NLS' file on most GNU archive sites. - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/AUTHORS b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/AUTHORS deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/COPYING b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/COPYING deleted file mode 100644 index bf50f20de6..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/COPYING +++ /dev/null @@ -1,482 +0,0 @@ - GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307 USA. - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ChangeLog b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ChangeLog deleted file mode 100644 index bdd64ab61c..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ChangeLog +++ /dev/null @@ -1,386 +0,0 @@ -gsmlib-1.10 - - reactivated code in gsm_at to retry sending PDU after - unsolicited result code - - - added description of unicode handling to FAQ - - - compilation fixes for gcc-3.0.4 - - - added quick exit for ATZ in UnixSerialPort constructor - if phone gives ERROR - - - added fix for phones that return +CLIP: "Number not available." - instead of giving caller ID - - - added get/setCLIRPresentation() functions to MeTa (contribution by - ivan) - - - added "NO CARRIER" event to the event mechanism (contribution by - clock) - - - added Win32 port of gsmsmsd (thanks to Konstantin Forostyan) - - - further extented Win32 port of gsmsmsd to handle outgoing messages - - - fixed problem with Ericsson T39m SMS sending (zero bytes in handshake) - - - added capability to send concatenated SMSs in gsmsmsd and gsmsendsms - - - fixed unsigned/signed char problems in Unix/Win32 serial port - implementations - - - added capability to send multiple SMSs to gsmsendsms/gsmsmsd - -gsmlib-1.9 - - fixed decoding of alphanumeric addresses in gsm_sms_codec. - - - fixed bug in gsm_event when checking whether to send an - acknowledgment for a received SMS - - - More Siemens-specific patches, some extensions to the AT - command parser - - - New code to print PIN status and set the PIN in gsmctl, setPIN - function in MeTa class (Andreas Roedl ) - - - Missing virtual destructor in Port class caused destructors of - UnixSerialPort and Win32SerialPort not to be called - fixed - - - Added new code to set functionality level on or off (thanks to - David Woodhouse) - - - found bug in SMS store implementation that caused the now - obsolete _capacity member to be set to a too low value - - - Added changes contributed by Frediano Ziglio to enable compilation - on Windows - - - Added call waiting functions contributed by Ivan - -gsmlib-1.8 - - added workaround for Nokia Cellular Card Phone RPE-1 GSM900 - that reports a CDS event that actually is an CDSI and sends a spurious - CR when waiting for a PDU - - - SMS are stored without index in files now - - - tested compilation with gcc-3.0.2 - - - added workaround for gsmlib getting confused when receiving SMS - and echo cannot be switched off - echos of the AT command are - filtered out in chat() now - - - extended gsm_phonebook preload mechanism to batch-load phonebooks - where the index does not start with 1 - - - Added workaround for Motorola Timeport 260 to write back - deliver messages to the ME - - - added workaround for compilation with libstdc++-v2 - - - private members of MeTa made protected - - - new ext directory for phone-specific extensions - -gsmlib-1.7 - - fixed bug with calculation of userData length if userDataHeader - is present (octet count was subtracted, not septet count) - - - fixed problem with string erase() at end of PDU for Falcom A2-1 - - - -t/--charset option of gsmpb did not work due to missing parameter - of getopt_long, fixed - - - The SMS decoder/encoder can now handle alphanumeric addresses - in the GSM default alphabet - - - set only those SMS stores that are actually needed to perform - SMS store operation - - - Fixed signalling error 321 (Invalid memory index) when trying to - read from empty SMS store entry - - - Fixed parsing error when reading current network operator if no - network connection - - - Added capability to parse cell broadcast messages to gsmlib and - the gsmsmsd program - - - Added workaround for Motorola Timeport 260 bug that doesn't correctly - report the message status when retrieving SMS messages from the - store - - - Added workaround for Motorola Timeport 260 that allocates index - numbers to SMS messages linearly so that index number can be - be larger than capacity reported by AT command - -gsmlib-1.6 - - more fixes for the COPS=? return format - - - fixed putBack() behaviour in gsm_parser (don't put back if end-of- - stream is reached) - - - added toString() function to gsm_sms_codec's Address class - - - SMS dates and times are now output in a locale-specific manner - - - fixed bug in Parser::getEol() (_eos was accidentally set to true) - - - added gsm_win32_serial module, Win32 project (VC++), and - Option FirstFone changes contributed by Frediano Ziglio - - - - fix in COM port recognition for Win32 (gsm_util) - - - renamed library files libgsm.* to libgsmme.* (now starting with - version 1.0) because of conflict with another Debian package - - - in gsm_phonebook and gsm_store the caching of entries can now - be disabled - - - added facilities to use other character sets for phonebooks - - - fixed workaround for Ericcson SH888 (missing service centre address) - - - fixed bug in gsm_phonebook that prevented texts with the - character '@' to be written to to the phonebook - - - fixed nasty memory allocation bug in gsmpb/gsmsmsstore - (automatic MeTa variable went out of scope even though used - later) - - - fixed Y2K problem in timestamp printing - - - fixed "make dist" to include win32 files - - - added workarounds for Falcom A2-1 (autodetection and enabling by - "export GSMLIB_FALCOM_A2_1_FIX=1", zero after PDU) - - - fixed bug that caused gsmlib to abort with an assert if a malformed - PDU was read - -gsmlib-1.5 - - adapted MeTa::getCurrentOPInfo() and MeTa::getAvailableOPInfo() - to handle Nokia 8290 quirks - - - code to set line speed in gsm_unix_serial reinserted (it was - accidentally removed in previous version) - - - minor changes to initialization sequence in gsm_unix_serial - - - bugfix in gsm_unix_serial.cc: readByte() == 0 does not mean no - more bytes, but is legal value - - - additionally allowed characters "*#pwPW" and '+' at any - position in telephone numbers - - - added environment variable GSMLIB_SH888_FIX that (if set) - enables the gsmlib workaround for Ericsson SH888's broken SMS TPDUs - - - fixed command line parameter handling bug in gsmsmsstore - - - fixed %files section .spec file to correctly include manual pages - - - fixed some bugs in terminal line setup (gsm_unix_serial) regarding - software/hardware handshake - - - added new "--sca" option to SMS-related apps to set the SMS - service centre address on the command line (useful if default is not - set correctly in the phone) - - - removed tcflush() call in UnixSerialPort::putLine that broke - the event system needed for gsmsmsd - -gsmlib-1.4 - - more attempts to fix UNIX serial port access - - - allow custom backends for sorted phonebooks to be integrated - into gsmlib (eg. for RDBMS or LDAP storage). Introduced a new - module gsm_sorted_phonebook_base that contains the infrastructure for - this. - - - Now gsmlib needs at least gcc-2.95.2 to compile correctly. - - - Implemented option to open device with software handshaking (XON/XOFF). - The applications now have an -X option to turn this on. - - - gsmlib now contains a facility to interrupt ongoing activity in a - controlled way. gsm_unix_serial now blocks for one second - maximum until it checks whether it was interrupted. - - - various small bugfixes - - - added workaround for phones that omit ':' in AT command responses - - - all debugging output is now printed to stderr - - - gsm_unix_serial: new attempt to initialize modem in a more - robust way (contributed) - - - gsm_sms: fixed handling of user data header (contributed) - -gsmlib-1.3 - - fixed bug that caused gsmlib to hang if TAs don't respond - to AT inquiries for serial number etc. - - - fixed bug with handling of CB mode AT command construction in - gsm_me_ta.cc, setSMSRoutingToTA() - - - allow '+' as the first character of phonenumbers - - - implemented reading and writing from/to stdin/stdout in - gsm_sorted_[sms_store|phonebook] and gsmpb/gsmsmsstore - - - fixed (hopefully) the intermittent hangup problem in - gsm_unix_serial_port - - - Some mobile phones cannot report the status of some facility - locks. The gsmctl program now prints out "unknown" in the - corresponding result line from the FLSTAT - operation if this problem occurs (instead of terminating). - - - switched off non-blocking access to serial device - -gsmlib-1.2 - - gsmlib now also works with TAs that can not switch off echo - - - fixed bug that prevented gsmlib from copying SMS_DELIVER and - SMS_STATUS_REPORT back to the ME - - - introduced -I (--init) parameter to all command line apps to - allow for device-specific initialization - - - made SMS decoding routines more robust against bad SMS (especially - premature end of PDU) - - - New debugging feature: If compiled without NDEBUG, the - environment variable GSMLIB_DEBUG determines the verbosity of - debugging messages (0 = none, 1 = many, 2 = extreme) - -gsmlib-1.1 - - - Parse multiple COPS (operator info) lines returned by some phones - - - accept string as numeric value when interpreting COPS=? response - (Ericsson phone + GSM12 GSM module) - - - accept string as numeric value when interpreting COPS? response - (Ericsson phone + GSM12 GSM module) - - - retry when initializing TA (ATZ/ATE0 sequences) - - - Set SMS routing: - allow mode 3 (special in-band technique) when setting routing - to TA (gsmlib should not be active when phone is switched to data mode - anyway) - - - Set SMS routing: - handle buffer mode but only if it was reported by the +CNMI=? command - (the Ericsson GM12 GSM modem does not like it otherwise) - - - Determine CPMS number of parameters for CPMS command (better - compability with some mobile phones / GSM modems) - - - handle missing service centre address in incoming SMS for Ericsson - model 6050102 - - - add new RING event to gsm_event.h/.cc, gsmsmsd now handles RING - indications properly - - - defined default event handler mostly to handle unexpected RING - indications that might otherwise confuse gsmlib - - - gsmsmsd: can now be cleanly terminated using the SIGINT or SIGTERM - signals - - - gsmsmsd: now handles multiple incoming SMS messages cleanly, before - there was a chance that some SMS messages coming in rapid succession - might have been lost - - - gsmsmsd: flush option implemented that dispatches and erases - existing messages in SMS store - - - gsmsmsd: added sending of SMS messages. gsmsmsd now accepts a - spool directory options where it expects to find SMS message file in a - simple format, these are dispatched every 5 seconds - -gsmlib-1.0 - - - RPM support (spec file) - - - the "+" is at least for the Siemens S10 and S25 a valid char in - telephone numbers (inserts a pause of 3 seconds), therefore it is now - allowed as part of telephone numbers - - - fixed incorrect analysis of facility class parameters in gsmctl.cc - - - restricted call forward time to 0..30 seconds in gsm_me_ta.cc - -gsmlib-0.3 - - - implemented timeout for accessing the mobile phone in order - to avoid hangs - - - upgraded to BETA status - - - written glossary for abbreviations (gsminfo(7)) - - - implemented NLS support, added German translations - - - implemented preserving the index position of phonebook entries in - gsmpb.cc and gsm_sorted_phonebook - - - cleaned up manual pages (alphabetic ordering of options etc.) - - - gsmsmstore program and gsm_sorted_sms_store./.cc completed and - tested - - - gsmpb and gsmsmsstore now have --verbose (-V) options for detailed - progress reporting - - - now check for getopt_long in configure (can be compiled on non-GNU - systems) - - - removed asserts regarding lengths of numeric data types, put them - into configure script - - - sorted options in apps/*.cc alphabetically (--help option) - - - in gsm_sorted_sms_store compare telephone numbers more sensibly - - - introduced -v option to gsmpb and gsmsmsstore to report execution - statistics - - - tested new synchronization function in gsmpb program - - - implemented operations in the gsmctl program - - - rewrote test cases (compare output) - - - completed gsmsmsstore program - - - first changes for compilation with VC++ 6.0 on WIN32 - -gsmlib-0.2 - - - gsmsmstore program and gsm_sorted_sms_store./.cc mostly - completed but not yet much tested - - - Fixed problem with some mobiles/TAs not giving prefixes after - certain AT sequences (reported for SIEMENS S25/IrDA, Nokia - 8810/IrDA) - - - Fixed problem with Xircom REM56G.100/Nokia 6150 that give - "CABLE: GSM" instead of "OK" after ATZ - - - Mobiles that return nothing when empty phonebook entries are - requested are now handled correctly (reported for SIEMENS S25/IrDA) - - - optimizations in gsm_*_phonebook modules (less AT commands necessary) - - - new synchronization function in gsmpb program that is (hopefully) - more sensible (see man page for details) - -gsmlib-0.1 - - - Initial release diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/INSTALL b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/INSTALL deleted file mode 100644 index 6242d6f388..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/INSTALL +++ /dev/null @@ -1,198 +0,0 @@ -GSMLIB Installation -=================== - - This distribution uses autoconf/automake/libtool. See below - for generic installation instructions. The default commands would be: - - ./configure - make - make install - - See also the section INSTALLATION in the README file in this - directory. For questions regarding the internationalization of this - package refer to doc/README.NLS and ./ABOUT-NLS. - - Developers: See also the file doc/README.developers. - -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If at some point `config.cache' -contains results you don't want to keep, you may remove or edit it. - - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need `configure.in' if you want to change -it or regenerate `configure' using a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: - CPU-COMPANY-SYSTEM - -See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the host type. - - If you are building compiler tools for cross-compiling, you can also -use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Operation Controls -================== - - `configure' recognizes the following options to control how it -operates. - -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. - -`--help' - Print a summary of the options to `configure', and exit. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`configure' also accepts some other, not widely useful, options. diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/Makefile.am b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/Makefile.am deleted file mode 100644 index daf1ea0047..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -## Process this file with automake to produce Makefile.in -# ************************************************************************* -# * GSM TA/ME library -# * -# * File: Makefile.am -# * -# * Purpose: Toplevel Makefile -# * -# * Author: Peter Hofmann (software@pxh.de) -# * -# * Created: 21.5.1999 -# ************************************************************************* - -SUBDIRS_ = po gsmlib apps tests doc scripts win32 ext - -EXTRA_DIST = gsmlib.spec - -if COMPILE_INTL -SUBDIRS = intl $(SUBDIRS_) # po - make automake happy -else -SUBDIRS = $(SUBDIRS_) # po intl - make automake happy -endif - -all: diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/Makefile.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/Makefile.in deleted file mode 100644 index e9676cc981..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/Makefile.in +++ /dev/null @@ -1,423 +0,0 @@ -# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am - -# 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# ************************************************************************* -# * GSM TA/ME library -# * -# * File: Makefile.am -# * -# * Purpose: Toplevel Makefile -# * -# * Author: Peter Hofmann (software@pxh.de) -# * -# * Created: 21.5.1999 -# ************************************************************************* - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = . - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ -AR = @AR@ -AS = @AS@ -BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ -CATOBJEXT = @CATOBJEXT@ -CC = @CC@ -CPP = @CPP@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -DATADIRNAME = @DATADIRNAME@ -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@ -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@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -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@ - -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 -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs -CONFIG_HEADER = gsm_config.h -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 - - -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 - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -$(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) - cd $(srcdir) && $(AUTOCONF) - -gsm_config.h: stamp-h - @if test ! -f $@; then \ - rm -f stamp-h; \ - $(MAKE) stamp-h; \ - else :; fi -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) - @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null - -mostlyclean-hdr: - -clean-hdr: - -distclean-hdr: - -rm -f gsm_config.h - -maintainer-clean-hdr: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (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. - -@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 \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ - dot_seen=no; \ - rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ - rev="$$subdir $$rev"; \ - test "$$subdir" != "." || dot_seen=yes; \ - done; \ - test "$$dot_seen" = "no" && rev=". $$rev"; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done - -tags: TAGS - -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; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(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 \ - test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ - fi; \ - done; \ - 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)gsm_config.h.in$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags gsm_config.h.in $$unique $(LISP)) - -mostlyclean-tags: - -clean-tags: - -distclean-tags: - -rm -f TAGS ID - -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) - -rm -rf $(distdir) - mkdir $(distdir) - -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 \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done - for subdir in $(DIST_SUBDIRS); do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - chmod 777 $(distdir)/$$subdir; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ - || exit 1; \ - fi; \ - done -info-am: -info: info-recursive -dvi-am: -dvi: dvi-recursive -check-am: all-am -check: check-recursive -installcheck-am: -installcheck: installcheck-recursive -all-recursive-am: gsm_config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -install-exec-am: -install-exec: install-exec-recursive - -install-data-am: -install-data: install-data-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-recursive -uninstall-am: -uninstall: uninstall-recursive -all-am: Makefile gsm_config.h -all-redirect: all-recursive-am -install-strip: - $(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: -mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic - -mostlyclean: mostlyclean-recursive - -clean-am: clean-hdr clean-tags clean-generic mostlyclean-am - -clean: clean-recursive - -distclean-am: distclean-hdr distclean-tags distclean-generic clean-am - -rm -f libtool - -distclean: distclean-recursive - -rm -f config.status - -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 config.status - -.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: diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/NEWS b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/NEWS deleted file mode 100644 index 1efffa7d86..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/NEWS +++ /dev/null @@ -1,11 +0,0 @@ -NEWS - 9.1.2000 - - Version 1.0 - first release with RPM support and binary packages - -NEWS - 15.11.1999 - - BETA version (details see ChangeLog) - -NEWS - 16.7.1999 - - initial release diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/README b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/README deleted file mode 100644 index 2f5db9eb27..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/README +++ /dev/null @@ -1,166 +0,0 @@ -INTRODUCTION - - This distribution contains a library to access GSM mobile phones - through GSM modems or IrDA devices. Features include: - - * modification of phonebooks 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 - - Additionally, some simple command line programs are provided to - use these functionalities. - - -REQUIREMENTS - - You need a mobile phone that conforms to the GSM - standards ETSI GSM 07.07, ETSI GSM 07.05, and others. - Non-GSM mobile phones will not work! Additionally, - to access the mobile phone from the computer you will probably need an - GSM modem (that would be a PC-CARD, usually). There might be some - mobile phones, however, that incorporate directly terminal - adapter (TA) functionality. Access via IrDA interfaces is also - reported to work. - - If you want to compile the library yourself please also read - doc/README.developers. - - -INSTALLATION - - This distribution uses autoconf/automake/libtool. See the file - INSTALL for generic installation instructions. The default - commands for installation under /usr/local would be: - - ./configure - make - make install - - If there are any problems you can generate a debug version. See - doc/README.developers for details. - - -AVAILABLE DOCUMENTATION - - For the command line tools UNIX manual pages are available in the - doc subdirectory of this distribution. These are installed by - default in the directories /usr/local/man1, man7, and man8. - - See also the files doc/README.developers, doc/README.NLS and doc/FAQ. - - -HARDWARE - - The following mobile phone/GSM modem combinations are reported to - be compatible in varying degrees with the current release: - - - Nokia 6150/Xircom REM56G.100 - - Nokia 6150/Options "GSM-Ready(R) Cellular-Only" modem - from Option International - - Nokia 6210/- (Linux IrDA serial device) - - Nokia 8810/- (Linux IrDA serial device) - - Siemens S10D/Dr Neuhaus Gipsy Card GSM - - Siemens S25/- (Linux IrDA serial device) - - Siemens S35i/- (Linux IrDA serial device) - - Siemens S45 - - Ericcson SH888/- (Linux IrDA serial device) - - Ericsson 6050102/GM 12 GSM module - - Ericsson T28s (firmware 000809 1106) - - Ericsson T20e (firmware R3A007) - - -/Siemens M20T (stand-alone GSM module) - - -/Wavecom WM02 GSM (stand-alone GSM module) - - Nokia 7110 (firware rev 4.80)/- (Linux IrDA serial device) - - Nokia 8290 (USA GSM 1900MHz)/- (Linux IrDA serial device) - - Falcom A2-1/- (stand-alone GSM module) - - Ericsson R320s/- (Linux IrDA serial device) - - Motorola Timeport 260/- (Serial cable and Linux IrDA serial device) - - Motorola Timeport 250/- (Linux IrDA serial device) - - Motorola Timeport P7389/- (Linux IrDA serial device) - - Nokia Cellular Card Phone RPE-1 GSM900 and - - Nokia Card Phone RPM-1 GSM900/1800 - - Nokia Cardphone/Compaq iPAQ - - Omnipoint technologies Redhawk 2000 GSM modem - - Ericsson T28 (but one firmware revision is reported to have problems) - - Ericcson T65 - - Ericcson T39m/Bluetooth - - Option International GlobeTrotter PCMCIA - - Note 1: Some of the mobile phones have an integrated GSM modem - that can be accessed via the Linux IrDA drivers. - - Note 2: Some of the abovementioned phones have still some glitches - with gsmlib (and I haven't tested them myself). - - For the following phones I receive a lot of errors reports: - - - Ericcson SH888: SMS function don't work with many firmware releases - - This list is not exhaustive, there are probably many other types of - phone or GSM modem that work with gsmlib. Just try it and report back - to me! - - -DISCLAIMER - - Even though care has been taken in the design and implementation - of this software it can not be excluded that this software could - destroy data in your mobile phone or may even render your mobile - phone useless (by erroneous PIN settings, for example). The - author will not be held responsible legally, financially, or in any - other form for any kind of damage that might occur from using - this software. - - This software is provided "as is" and without any expressed or implied - warranties, including, without limitation, the implied warranties of - merchantibility and fitness for any particular purpose. - - If you are not ready to accept these conditions please don't use - this software. - - -COPYING - - This software is available on the LGPL (GNU LIBRARY GENERAL - PUBLIC LICENSE), ie. it is allowed to link - the library to commercial programs. - - See the file COPYING for details on the license. - - -BUGS - - There still seem to be some problems with IrDA devices under - Linux. There have been reports of gsmlib-based applications - (eg. gsmctl) hanging upon startup after initializing the serial port - /dev/ircomm. I would be thankful for any input on this problem. - - If something does not work with your OS platform or the mobile/TA - combination please send a complete trace of the compilation or the - program execution that did fail. Make sure to compile with debugging - information enabled. Otherwise it will not be possible for me to do - much about the problem. Send bug reports to the mailing list or - to software@pxh.de. I promise not to publish telephone numbers or other - private information that might be contained in the execution traces - that you send me. - - -MAILING LISTS - - There are now two mailings lists available for announcements and - discussion of gsmlib-related issues (hosted on lists.over.net). - Refer to these pages for information on subscription procedures - and an archive of previous postings: - - http://lists.over.net/mailman/listinfo/gsmlib-announce/ - for announcements regarding GSMLIB - - http://lists.over.net/mailman/listinfo/gsmlib-devel/ - the GSMLIB development list - - -AUTHOR - - Peter Hofmann . diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/TODO b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/TODO deleted file mode 100644 index 3ea3aa3fd5..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/TODO +++ /dev/null @@ -1,289 +0,0 @@ -This is my list of TODOs for development of this software (not -necessarily in order of importance): - -("+" = DONE) - -+ handle: - > --> AT+COPS=? - > <-- - > <-- +COPS: (1,"AMENA",,"21403"),(3,"MOVISTAR",,"21407"), - > <-- (3,"E VODAFONE",,"21401"),,(0,1),(2) - > <-- - > <-- OK - > gsmctl[ERROR]: expected comma (at position 45 of string '(1,"AMENA",,"21403"),(3,"MOVISTAR",,"21407"),') - -+ extend README and web site with names of working phones (Siemens S45,...) - -+ add workaround: - > Manufacturer: Nokia Mobile Phones - > Model: 8290 - > Revision: SW5.22 - > Serial Number: 010070303406434 - > Functionality Level: 1 - > gsmctl[ERROR]: expected number, got '(2)' - -- add fork to gsmsmsd - -+ document "on" and "off" operations of gsmctl - -- Just assume full functionality and issue AT+CGMF=0 if we haven't already - done so for this MeTa. - -+ make update po - -+ add find function - -+ specify exact location of manual files in /usr/man/man* in spec - file, so that erase does not try to delete these directories - -+ update PO - -+ add option to gsmsendsms/gsmsmsd to request delivery reports - -+ Fix CBM reception in gsmsmsd, see testcb.cc program - -+ fix gsmsmsd: - --> AT+CNMI=? - <-- - <-- +CNMI: (1),(1),(0),(0),(0) - <-- - <-- OK - --> AT+CNMI=1,0,0,0,0 - <-- - <-- +CME ERROR: 003 - ./gsmsmsd[ERROR]: ME/TA error 'operation not allowed' (code 003) - -+ Wenn ich den SMS-Speicher auslesen mchte, bricht gsmlib ab, weil der - Speicherplatz 1 auf der SIM-Karte nicht belegt ist. Das kann z.B. - passieren, wenn man Nachrichten im Handy lscht. Es kommt der Fehlercode - 321 (Invalid memory index). Wie wre es, in der Leseroutine alle - ungltigen Pltze zu ignorieren und solange zu lesen, bis die Anzahl der - vorhandenen Nachrichten im Speicher eingelesen ist? - -+ document --charset option of gsmpb - -+ Problems with PDUs with alphanumeric SCA, e.g.: - 07911497941902F00414D0E474989D769F5DE4320839001040122151820000 - -+ > 2. Ich kann mit meinem Nokia 6210 nicht den Telefon-SMS-Speicher - auslesen. Dies liegt an der Speicherwahl, die vor dem Auslesen - an das Telefon bermittelt wird. Von der gsmlib wird anscheinend - immer die Anzahl der Speicher aus dem "CPMS=?"-Befehl genommen - (z.B. "SM","SM","SM"). Notwendig ist es aber nur, die erste - Position (zum Lesen und Lschen) bzw. die ersten beiden - Positionen (zum Schreiben) zu benutzen. - Das Nokia 6210 untersttzt aber an der ritten Stelle nur "SM", - nicht "ME". So kann ich die SMS im Telefon leider nicht - auslesen :-( - -- add option to gsmpb/gsmssmstore deletion to delete ALL entries - -- recheck Solaris port - -+ cache character set settings in MeTa - -+ add documentation for new gsmctl and gsmpb charset parameters - -+ support characters sets other than GSM default alphabet for phone books - -+ create non-existent files (gsmpb and gsmsmsstore) - -+ rename libgsm to libgsmme, new major version 1 - -+ document sca/setsca operations/parameters in gsmctl - -+ document option to set SCA in SMS-related apps - -+ implement option to set SCA in SMS-related apps - -+ convert NDEBUG test output from cout to cerr - -+ test new gsm_unix_serial behaviour - -+ apply checks for telephone number in gsm_sorted_phonebook - -+ add interrupted() checks - -+ check for gcc-2.95.2 in configure - -- document custom backend options of gsmpb (and gsmsmsstore) - -- /var/lock/LCK..modem - -+ make gsmctl all continue even if there are some failures - -+ CPIN thing - -+ bring German translations up-to-date - -+ document -I parameter - -+ make chat routines robust against TAs that insist on echoing AT commands - -+ ericsson sh 888: - <-- AT+CLCK="P2",2,,1 - <-- - +CME ERROR: 4 - gsmctl[ERROR]: ME/TA error 'operation not supported' (code 4) - -+ put README etc. into gsmlib package (not only devel) - -+ make SMS decoding routines more robust against bad SMS (especially - premature end of PDU) - -+ stop gsm_sorted_sms_store.cc from copying back SMS that came from - the SC (SMS_DELIVER, SMS_STATUS_REPORT, SMS_SUBMIT_REPORT). Their - message type is ambiguous and the ME may misinterpret them. - -+ gsmsmsd: reinitialize modem every hour or so (signal termination implemented) - -+ implement store, flush and spool options of gsmsmsd, - document them in man pages - -+ test case for COPS answer numeric operator name in quotation marks - (testparser.cc) - -+ retry when initializing TA (ATZ/ATE0 sequences) - -+ correctly parse malformed SMS PDUs without SCA with Ericsson phone, - introduce Capability object for that. Ericsson ID: - Manufacturer: ERICSSON - Model: 6050102 - Revision: 990225 1852 CXC112143 - Serial Number: 520001690279310 - -+ Determine CPMS number of parameters for CPMS command (Ericsson - phone/GM12 GSM modem): - AT+CPMS? - +CPMS: "ME",0,10,"ME",0,10 - AT+CPMS=? - +CPMS: ("ME","SM"),("ME","SM") - -+ accept string as numeric value when interpreting COPS=? response - (Ericsson phone + GSM12 GSM module) - -+ accept string as numeric value when interpreting COPS? response - (Ericsson phone + GSM12 GSM module) - -+ It would be nice if it was possible to send sms:es - via gsmsmsd as well, via a spool directory or a socket (or stdin, in which - case one can put another program in front of this program and then - feed it with outgoing messages any way one wants). That way the program - could be the gateway between programs and the sms network. Now one has - to stop gsmsmsd to send an sms and that's not so elegant or write - ones own program. - -+ gsmsmsd geht davon aus, das ein platz frei ist und benutzt nur diesen.... - Wenn also eine SMS kommt, dann zieht es Sie raus, und lscht den - Speicherplatz. - Wenn aber die Karte voll ist, passiert gar nichts. Fr eine automatisierte - umgebung ist das schlecht. besser wre es, bei startup von gsmsmsd alle - Speicherpltze abzufrhstcken, und die Action aufzurufen. - -+ Ein RING bringt den gsmsmsd ziemlich heftig aus dem Tritt. Hab jetzt ne - Rufumleitung eingebaut. - -+ Links section in homepage - -+ AT+CNMI=? liefert bei mir folgendes zurck: - +CNMI: (0-3),(0-3),(0-2),0,(0-1) - Parameter 4 () liefert also keine Liste sondern nur ein Int zurck, du - versuchts aber ein ( zu parsen. - Was sagt die ETSI-spec. dazu ?? Ist das konform ?? - -+ give name of command at beginning of synopsis in man pages - -+ list combinations of mobiles phones/GSM modems in the README - -+ test ALARM in case of timeout when writing or reading to TA - -+ install headers in gsmlib subdirectory - -+ RPM spec file - -+ test index changes for sorted phonebook -> write second test case - -+ sort phone numbers the same way in gsm_sorted_sms_store and - gsm_sorted_phonebook - -+ write glossary for all these nice abbreviations (TA, ME, SC, SME, TE) - -+ HAVE_VSNPRINTF instead of HAVE_VPRINTF - -+ internationalization of messages with GNU gettext. Files: - +gsm_at.cc +gsm_parser.cc +gsm_sorted_phonebook.cc - +gsm_error.cc +gsm_phonebook.cc +gsm_sorted_sms_store.cc - +gsm_event.cc +gsm_sms.cc +gsm_unix_serial.cc - +gsm_me_ta.cc +gsm_sms_codec.cc +gsm_util.cc - +gsm_nls.cc +gsm_sms_store.cc - +gsmctl.cc +gsmpb.cc +gsmsendsms.cc - +gsmsmsd.cc +gsmsmsstore.cc - -+ implement indexed phonebook ops in gsmpb.cc - -+ describe phonebook file format in gsmpb.man - -+ update list of compatible hardware in README - -+ all #include must be enclosed in #ifdef's - -+ check for getopt_long in configure - -+ remove asserts regarding lengths of numeric data types, put them -into configure script -(string) - -+ sort options in apps/*.cc alphabetically - -+ in gsm_sorted_sms_store compare telephone numbers numerically - -+ introduce -v option to gsmpb and gsmsmsstore to report execution -statistics (gives a nicer feeling to users) - -+ test new synchronization function in gsmpb program - -+ implement equality operator for SMSSToreEntry - -+ test 'make install' - -+ implement operations in the gsmctl program - -+ test operations in the gsmctl program - -+ document operations in the gsmctl program - -+ rewrite test cases (compare output) - -+ write gsm_sorted_sms_store module (along the lines of gsm_sorted_phonebook) - -+ complete gsmsmsstore program (using abovementioned modules) - -TODO low priority: - -- implement SMS text mode - -- The action command of gsmsmsd would be easier to make, if the program - sent the values in environment variables instead (except the user data - which could be sent on stdin). - -+ Upgrade to latest autoheader, autoconf, libtool - -- provide German translations for manual pages - -- organize doc subdirectory for translated READMEs, manual pages - -+ Win32 port - -- test: optimization when accessing phonebooks: use size information -available via AT command to stop reading entries known to be empty (I -cannot test this with my hardware since CPBS? is not fully supported) - -- make apps accept stdin or stdout - -+ maybe strip leading and trailing whitespace from phonebook entries -when reading them from ME/TA or file? (not done, perhaps users want to -achieve special effects with white space) - -- support international character sets (8-bit, 16-bit) in phonebook -operations (I'd like to have input from users who need this) - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/acconfig.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/acconfig.h deleted file mode 100644 index 14ce58fbc3..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/acconfig.h +++ /dev/null @@ -1,33 +0,0 @@ -/* used by libtool*/ -#define PACKAGE 0 - -/* used by libtool*/ -#define VERSION 0 - -/* Define if getopt_long() available */ -#undef HAVE_GETOPT_LONG - -/* Define if alarm() available */ -#undef HAVE_ALARM - -/* Define if netinet/in.h header available */ -#undef HAVE_NETINET_IN_H - -/* Define if string.h header available */ -#undef HAVE_STRING_H - -/* Define for NLS */ -#undef ENABLE_NLS -#undef HAVE_CATGETS -#undef HAVE_GETTEXT -#undef HAVE_LC_MESSAGES -#undef HAVE_STPCPY - -/* Define LOCALEDIR */ -#define LOCALEDIR "/usr/share/locale" - -/* Define if libintl.h header available */ -#undef HAVE_LIBINTL_H - -/* Define if vsnprintf() function available */ -#undef HAVE_VSNPRINTF diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/acinclude.m4 b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/acinclude.m4 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/aclocal.m4 b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/aclocal.m4 deleted file mode 100644 index 8d27d03353..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/aclocal.m4 +++ /dev/null @@ -1,9704 +0,0 @@ -# generated automatically by aclocal 1.9.6 -*- Autoconf -*- - -# 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# 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. - -dnl From Bruno Haible. - -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 -]) - -# 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. - -dnl Authors: -dnl Ulrich Drepper , 1995-2000. -dnl Bruno Haible , 2000-2003. - -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]) - ]) - - dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. - gt_INTL_MACOSX - - dnl Set USE_NLS. - AM_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 * 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)]) - - 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 - - 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 - - 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. - 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 - ]) - - 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 - - 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 - - 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 - - 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-runtime || test "$PACKAGE" = gettext-tools; 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) - - 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 For backward compatibility. Some Makefiles may be using this. - INTLOBJS= - if test "$USE_INCLUDED_LIBINTL" = yes; then - INTLOBJS="\$(GETTOBJS)" - fi - AC_SUBST(INTLOBJS) - - 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 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 - - 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_ICONV - AM_LANGINFO_CODESET - if test $ac_cv_header_locale_h = yes; then - gt_LC_MESSAGES - fi - - if test -n "$INTL_MACOSX_LIBS"; then - CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" - 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 -]) - - -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]) -]) - - -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.]) -]) - - -dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) -AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) - -# 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. - -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" - ] -) - -# 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. - -# Test for the GNU C Library, version 2.1 or newer. -# From Bruno Haible. - -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" - ] -) - -# 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. - -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]) - - dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV - dnl accordingly. - AC_LIB_LINKFLAGS_BODY([iconv]) -]) - -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). - - dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV - dnl accordingly. - AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) - - 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_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) -]) - -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 -]) - -# 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. - -dnl From Bruno Haible. - -AC_DEFUN([gt_INTDIV0], -[ - AC_REQUIRE([AC_PROG_CC])dnl - AC_REQUIRE([AC_CANONICAL_HOST])dnl - - AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], - gt_cv_int_divbyzero_sigfpe, - [ - AC_TRY_RUN([ -#include -#include - -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); -} - -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); -} -], 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.]) -]) - -# 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. - -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. - -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 -]) - -# 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. - -dnl From Bruno Haible. - -# Define PRI_MACROS_BROKEN if exists and defines the PRI* -# macros to non-string values. This is the case on AIX 4.3.3. - -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. - -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 -]) - -# 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. - -dnl From Paul Eggert. - -# Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, -# doesn't clash with , and declares uintmax_t. - -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 -]) - -# 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. - -dnl Authors: -dnl Ulrich Drepper , 1995. - -# Check whether LC_MESSAGES is available in . - -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 -]) - -# 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. - -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 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 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. - 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. - 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 -]) - -# 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. - -dnl From Bruno Haible. - -AC_PREREQ(2.50) - -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. -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 - ]) - 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) -]) - -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 - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi -]) - dnl Search the library and its dependencies in $additional_libdir and - dnl $LDFLAGS. Using breadth-first-seach. - LIB[]NAME= - LTLIB[]NAME= - INC[]NAME= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='$1 $2' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - dnl See if it was already located by an earlier AC_LIB_LINKFLAGS - dnl or AC_LIB_HAVE_LINKFLAGS call. - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" - else - dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined - dnl that this library doesn't exist. So just drop it. - : - fi - else - dnl Search the library lib$name in $additional_libdir and $LDFLAGS - dnl and the already constructed $LIBNAME/$LTLIBNAME. - found_dir= - found_la= - found_so= - found_a= - if test $use_additional = yes; then - if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then - found_dir="$additional_libdir" - found_so="$additional_libdir/lib$name.$shlibext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - else - if test -f "$additional_libdir/lib$name.$libext"; then - found_dir="$additional_libdir" - found_a="$additional_libdir/lib$name.$libext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then - found_dir="$dir" - found_so="$dir/lib$name.$shlibext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - else - if test -f "$dir/lib$name.$libext"; then - found_dir="$dir" - found_a="$dir/lib$name.$libext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - dnl Found the library. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - dnl Linking with a shared library. We attempt to hardcode its - dnl directory into the executable's runpath, unless it's the - dnl standard /usr/lib. - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then - dnl No hardcoding is needed. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - dnl The hardcoding into $LIBNAME is system dependent. - if test "$hardcode_direct" = yes; then - dnl Using DIR/libNAME.so during linking hardcodes DIR into the - dnl resulting binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - dnl Rely on "-L$found_dir". - dnl But don't add it if it's already contained in the LDFLAGS - dnl or the already constructed $LIBNAME - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" - fi - if test "$hardcode_minus_L" != no; then - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH - dnl here, because this doesn't fit in flags passed to the - dnl compiler. So give up. No hardcoding. This affects only - dnl very old systems. - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - dnl Linking with a static library. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" - else - dnl We shouldn't come here, but anyway it's good to have a - dnl fallback. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" - fi - fi - dnl Assume the include files are nearby. - additional_includedir= - case "$found_dir" in - */lib | */lib/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - dnl Potentially add $additional_includedir to $INCNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's /usr/local/include and we are using GCC on Linux, - dnl 3. if it's already present in $CPPFLAGS or the already - dnl constructed $INCNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - 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 - for x in $CPPFLAGS $INC[]NAME; 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 -d "$additional_includedir"; then - dnl Really add $additional_includedir to $INCNAME. - INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - dnl Look for dependencies. - if test -n "$found_la"; then - dnl Read the .la file. It defines the variables - dnl dlname, library_names, old_library, dependency_libs, current, - dnl age, revision, installed, dlopen, dlpreopen, libdir. - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - dnl We use only dependency_libs. - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/lib, - dnl 2. if it's /usr/local/lib and we are using GCC on Linux, - dnl 3. if it's already present in $LDFLAGS or the already - dnl constructed $LIBNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/lib"; 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 - haveit= - for x in $LDFLAGS $LIB[]NAME; 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 -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LIBNAME. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIB[]NAME; 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 -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LTLIBNAME. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - dnl Handle this in the next round. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - dnl Handle this in the next round. Throw away the .la's - dnl directory; it is already contained in a preceding -L - dnl option. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - dnl Most likely an immediate library name. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" - ;; - esac - 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" - 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 - ;; - 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 - 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 -]) - -# 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], -[ - 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 - else - dnl Shouldn't happen, but who knows... - result='~(size_t)0' - fi - 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 -]) - -# 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 From Paul Eggert. - -# 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` -]) - -# 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 - 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 - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -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]) -]) - - -# 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 -]) - - -# 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]) -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# 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 3 - -# _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 - continue - fi - # 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 - - -# 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 (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 - -# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. -AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) - -# Do all the work for Automake. -*- Autoconf -*- - -# 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. - -# serial 12 - -# 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. - -# 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 - -# 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]) - -# 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 - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl - -# 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 -]) -]) - - -# 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. - -# 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]) - -# 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. - -# 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)]) - -# 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. - -# serial 2 - -# 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])]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# 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. - -# serial 3 - -# 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 -]) - -# 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 - -# 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)]) - - -# 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 -]) - -# 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. - -# 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])]) - -# Helper functions for option handling. -*- Autoconf -*- - -# 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. - -# serial 3 - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _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_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)])]) - -# _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])]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# 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 4 - -# 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)]) - -# 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. - -# 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])]) - -# Check how to create a tarball. -*- Autoconf -*- - -# 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. - -# serial 2 - -# _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 - - # 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]) diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/Makefile.am b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/Makefile.am deleted file mode 100644 index eff2f893fc..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -## Process this file with automake to produce Makefile.in -# ************************************************************************* -# * GSM TA/ME library -# * -# * File: Makefile.am -# * -# * Purpose: apps Makefile -# * -# * Author: Peter Hofmann (software@pxh.de) -# * -# * Created: 5.6.1999 -# ************************************************************************* - -INCLUDES = -I.. - -bin_PROGRAMS = gsmsmsstore gsmctl gsmsmsd gsmpb gsmsendsms - -# build gsmsmsd from gsmsmsd.cc and libgsmme.la -gsmsmsd_SOURCES = gsmsmsd.cc -gsmsmsd_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build gsmpb from gsmpb.cc and libgsmme.la -gsmpb_SOURCES = gsmpb.cc -gsmpb_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build gsmctl from gsmctl.cc and libgsmme.la -gsmctl_SOURCES = gsmctl.cc -gsmctl_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build gsmsendsms from gsmsendsms.cc and libgsmme.la -gsmsendsms_SOURCES = gsmsendsms.cc -gsmsendsms_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build gsmsmsstore from gsmsmsstore.cc and libgsmme.la -gsmsmsstore_SOURCES = gsmsmsstore.cc -gsmsmsstore_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/Makefile.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/Makefile.in deleted file mode 100644 index c18e2df06b..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/Makefile.in +++ /dev/null @@ -1,442 +0,0 @@ -# Makefile.in generated by automake 1.6.3 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# ************************************************************************* -# * GSM TA/ME library -# * -# * File: Makefile.am -# * -# * Purpose: apps Makefile -# * -# * Author: Peter Hofmann (software@pxh.de) -# * -# * Created: 5.6.1999 -# ************************************************************************* -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -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 = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ - -EXEEXT = @EXEEXT@ -OBJEXT = @OBJEXT@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -AMTAR = @AMTAR@ -AS = @AS@ -AWK = @AWK@ -BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ -CATOBJEXT = @CATOBJEXT@ -CC = @CC@ -CPP = @CPP@ -CXX = @CXX@ -DATADIRNAME = @DATADIRNAME@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -ECHO = @ECHO@ -GENCAT = @GENCAT@ -GLIBC21 = @GLIBC21@ -GMSGFMT = @GMSGFMT@ -GSM_VERSION = @GSM_VERSION@ -HAVE_LIB = @HAVE_LIB@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INSTOBJEXT = @INSTOBJEXT@ -INTLBISON = @INTLBISON@ -INTLLIBS = @INTLLIBS@ -INTLOBJS = @INTLOBJS@ -INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ -LIB = @LIB@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIB = @LTLIB@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -MKINSTALLDIRS = @MKINSTALLDIRS@ -OBJDUMP = @OBJDUMP@ -PACKAGE = @PACKAGE@ -POSUB = @POSUB@ -RANLIB = @RANLIB@ -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@ - -INCLUDES = -I.. - -bin_PROGRAMS = gsmsmsstore gsmctl gsmsmsd gsmpb gsmsendsms - -# build gsmsmsd from gsmsmsd.cc and libgsmme.la -gsmsmsd_SOURCES = gsmsmsd.cc -gsmsmsd_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build gsmpb from gsmpb.cc and libgsmme.la -gsmpb_SOURCES = gsmpb.cc -gsmpb_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build gsmctl from gsmctl.cc and libgsmme.la -gsmctl_SOURCES = gsmctl.cc -gsmctl_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build gsmsendsms from gsmsendsms.cc and libgsmme.la -gsmsendsms_SOURCES = gsmsendsms.cc -gsmsendsms_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build gsmsmsstore from gsmsmsstore.cc and libgsmme.la -gsmsmsstore_SOURCES = gsmsmsstore.cc -gsmsmsstore_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) -subdir = apps -mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/gsm_config.h -CONFIG_CLEAN_FILES = -bin_PROGRAMS = gsmsmsstore$(EXEEXT) gsmctl$(EXEEXT) gsmsmsd$(EXEEXT) \ - gsmpb$(EXEEXT) gsmsendsms$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) - -am_gsmctl_OBJECTS = gsmctl.$(OBJEXT) -gsmctl_OBJECTS = $(am_gsmctl_OBJECTS) -gsmctl_DEPENDENCIES = ../gsmlib/libgsmme.la -gsmctl_LDFLAGS = -am_gsmpb_OBJECTS = gsmpb.$(OBJEXT) -gsmpb_OBJECTS = $(am_gsmpb_OBJECTS) -gsmpb_DEPENDENCIES = ../gsmlib/libgsmme.la -gsmpb_LDFLAGS = -am_gsmsendsms_OBJECTS = gsmsendsms.$(OBJEXT) -gsmsendsms_OBJECTS = $(am_gsmsendsms_OBJECTS) -gsmsendsms_DEPENDENCIES = ../gsmlib/libgsmme.la -gsmsendsms_LDFLAGS = -am_gsmsmsd_OBJECTS = gsmsmsd.$(OBJEXT) -gsmsmsd_OBJECTS = $(am_gsmsmsd_OBJECTS) -gsmsmsd_DEPENDENCIES = ../gsmlib/libgsmme.la -gsmsmsd_LDFLAGS = -am_gsmsmsstore_OBJECTS = gsmsmsstore.$(OBJEXT) -gsmsmsstore_OBJECTS = $(am_gsmsmsstore_OBJECTS) -gsmsmsstore_DEPENDENCIES = ../gsmlib/libgsmme.la -gsmsmsstore_LDFLAGS = - -DEFS = @DEFS@ -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/gsmctl.Po ./$(DEPDIR)/gsmpb.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/gsmsendsms.Po ./$(DEPDIR)/gsmsmsd.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/gsmsmsstore.Po -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -CXXFLAGS = @CXXFLAGS@ -DIST_SOURCES = $(gsmctl_SOURCES) $(gsmpb_SOURCES) $(gsmsendsms_SOURCES) \ - $(gsmsmsd_SOURCES) $(gsmsmsstore_SOURCES) -DIST_COMMON = Makefile.am Makefile.in -SOURCES = $(gsmctl_SOURCES) $(gsmpb_SOURCES) $(gsmsendsms_SOURCES) $(gsmsmsd_SOURCES) $(gsmsmsstore_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .cc .lo .o .obj -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu apps/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - || test -f $$p1 \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \ - else :; fi; \ - done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ - rm -f $(DESTDIR)$(bindir)/$$f; \ - done - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -gsmctl$(EXEEXT): $(gsmctl_OBJECTS) $(gsmctl_DEPENDENCIES) - @rm -f gsmctl$(EXEEXT) - $(CXXLINK) $(gsmctl_LDFLAGS) $(gsmctl_OBJECTS) $(gsmctl_LDADD) $(LIBS) -gsmpb$(EXEEXT): $(gsmpb_OBJECTS) $(gsmpb_DEPENDENCIES) - @rm -f gsmpb$(EXEEXT) - $(CXXLINK) $(gsmpb_LDFLAGS) $(gsmpb_OBJECTS) $(gsmpb_LDADD) $(LIBS) -gsmsendsms$(EXEEXT): $(gsmsendsms_OBJECTS) $(gsmsendsms_DEPENDENCIES) - @rm -f gsmsendsms$(EXEEXT) - $(CXXLINK) $(gsmsendsms_LDFLAGS) $(gsmsendsms_OBJECTS) $(gsmsendsms_LDADD) $(LIBS) -gsmsmsd$(EXEEXT): $(gsmsmsd_OBJECTS) $(gsmsmsd_DEPENDENCIES) - @rm -f gsmsmsd$(EXEEXT) - $(CXXLINK) $(gsmsmsd_LDFLAGS) $(gsmsmsd_OBJECTS) $(gsmsmsd_LDADD) $(LIBS) -gsmsmsstore$(EXEEXT): $(gsmsmsstore_OBJECTS) $(gsmsmsstore_DEPENDENCIES) - @rm -f gsmsmsstore$(EXEEXT) - $(CXXLINK) $(gsmsmsstore_LDFLAGS) $(gsmsmsstore_OBJECTS) $(gsmsmsstore_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsmctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsmpb.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsmsendsms.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsmsmsd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsmsmsstore.Po@am__quote@ - -distclean-depend: - -rm -rf ./$(DEPDIR) - -.cc.o: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -.cc.obj: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CXXCOMPILE) -c -o $@ `cygpath -w $<` - -.cc.lo: -@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< -CXXDEPMODE = @CXXDEPMODE@ - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -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; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - 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; } \ - 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 - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @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; \ - 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; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) - -installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) - -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-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 -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -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-am - -clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -distclean-am: clean-am distclean-compile distclean-depend \ - distclean-generic distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: install-binPROGRAMS - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -uninstall-am: uninstall-binPROGRAMS uninstall-info-am - -.PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libtool distclean distclean-compile \ - distclean-depend distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-binPROGRAMS install-data install-data-am \ - install-exec install-exec-am install-info install-info-am \ - install-man install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool tags uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-info-am - -# 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: diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmctl.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmctl.cc deleted file mode 100644 index df6fd28e1d..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmctl.cc +++ /dev/null @@ -1,635 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsmctl.cc -// * -// * Purpose: GSM mobile phone control program -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 11.7.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#if defined(HAVE_GETOPT_LONG) || defined(WIN32) -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#ifdef WIN32 -#include -#else -#include -#include -#endif -#include - -using namespace std; -using namespace gsmlib; - -// my ME - -static MeTa *m; - -// information parameters - -enum InfoParameter {AllInfo, // print all info - MeInfo, // MeInfo must be first! - FunctionalityInfo, - OperatorInfo, - CurrentOperatorInfo, - FacilityLockStateInfo, - FacilityLockCapabilityInfo, - PasswordInfo, - PINInfo, - CLIPInfo, - CallForwardingInfo, - BatteryInfo, - BitErrorInfo, - SCAInfo, - CharSetInfo, - SignalInfo}; // SignalInfo must be last! - -// operation parameters - -// FIXME operations not implemented yet - -// options - -#ifdef HAVE_GETOPT_LONG -static struct option longOpts[] = -{ - {"xonxoff", no_argument, (int*)NULL, 'X'}, - {"operation", required_argument, (int*)NULL, 'o'}, - {"device", required_argument, (int*)NULL, 'd'}, - {"baudrate", required_argument, (int*)NULL, 'b'}, - {"init", required_argument, (int*)NULL, 'I'}, - {"help", no_argument, (int*)NULL, 'h'}, - {"version", no_argument, (int*)NULL, 'v'}, - {(char*)NULL, 0, (int*)NULL, 0} -}; -#else -#define getopt_long(argc, argv, options, longopts, indexptr) \ - getopt(argc, argv, options) -#endif - -// helper function, prints forwarding info - -void printForwardReason(string s, ForwardInfo &info) -{ - cout << s << " " - << (info._active ? _("active ") : _("inactive ")) - << _("number: ") << info._number - << _(" subaddr: ") << info._subAddr - << _(" time: ") << info._time << endl; -} - -// print information - -static void printInfo(InfoParameter ip) -{ - switch (ip) - { - case MeInfo: - { - MEInfo mei = m->getMEInfo(); - cout << _(" Manufacturer: ") << mei._manufacturer << endl - << _(" Model: ") << mei._model << endl - << _(" Revision: ") << mei._revision << endl - << _(" Serial Number: ") << mei._serialNumber << endl; - break; - } - case FunctionalityInfo: - { - try { - int fun; - fun = m->getFunctionalityLevel(); - cout << _(" Functionality Level: ") << fun << endl; - } catch (GsmException &x) { - cout << _(" Functionality Level: ") << _("unsupported") << endl; - } - break; - } - case OperatorInfo: - { - int count = 0; - vector opis = m->getAvailableOPInfo(); - for (vector::iterator i = opis.begin(); i != opis.end(); ++i) - { - cout << " Status: "); - switch (i->_status) - { - case UnknownOPStatus: cout << _("unknown"); break; - case CurrentOPStatus: cout << _("current"); break; - case AvailableOPStatus: cout << _("available"); break; - case ForbiddenOPStatus: cout << _("forbidden"); break; - } - cout << _(" Long name: '") << i->_longName << "' " - << _(" Short name: '") << i->_shortName << "' " - << _(" Numeric name: ") << i->_numericName << endl; - ++count; - } - break; - } - case CurrentOperatorInfo: - { - OPInfo opi = m->getCurrentOPInfo(); - cout << "" - << _(" Long name: '") << opi._longName << "' " - << _(" Short name: '") << opi._shortName << "' " - << _(" Numeric name: ") << opi._numericName - << _(" Mode: "); - switch (opi._mode) - { - case AutomaticOPMode: cout << _("automatic"); break; - case ManualOPMode: cout << _("manual"); break; - case DeregisterOPMode: cout << _("deregister"); break; - case ManualAutomaticOPMode: cout << _("manual/automatic"); break; - } - cout << endl; - break; - } - case FacilityLockStateInfo: - { - int count = 0; - vector fclc = m->getFacilityLockCapabilities(); - for (vector::iterator i = fclc.begin(); i != fclc.end(); ++i) - if (*i != "AB" && *i != "AG" && *i != "AC") - { - cout << " '" << *i << "'"; - try - { - if (m->getFacilityLockStatus(*i, VoiceFacility)) - cout << _(" Voice"); - } - catch (GsmException &e) - { - cout << _(" unknown"); - } - try - { - if (m->getFacilityLockStatus(*i, DataFacility)) - cout << _(" Data"); - } - catch (GsmException &e) - { - cout << _(" unknown"); - } - try - { - if (m->getFacilityLockStatus(*i, FaxFacility)) - cout << _(" Fax"); - } - catch (GsmException &e) - { - cout << _(" unknown"); - } - cout << endl; - ++count; - } - break; - } - case FacilityLockCapabilityInfo: - { - cout << " "; - vector fclc = m->getFacilityLockCapabilities(); - for (vector::iterator i = fclc.begin(); i != fclc.end(); ++i) - cout << "'" << *i << "' "; - cout << endl; - break; - } - case PasswordInfo: - { - vector pwi = m->getPasswords(); - int count = 0; - for (vector::iterator i = pwi.begin(); i != pwi.end(); ++i) - { - cout << " '" - << i->_facility << "' " << i->_maxPasswdLen << endl; - ++count; - } - break; - } - case PINInfo: - { - cout << " " << m->getPINStatus() << endl; - break; - } - case CLIPInfo: - { - cout << " " << (m->getNetworkCLIP() ? _("on") : _("off")) << endl; - break; - } - case CallForwardingInfo: - { - for (int r = 0; r < 4; ++r) - { - string text; - switch (r) - { - case 0: text = _("UnconditionalReason"); break; - case 1: text = _("MobileBusyReason"); break; - case 2: text = _("NoReplyReason"); break; - case 3: text = _("NotReachableReason"); break; - } - ForwardInfo voice, fax, data; - m->getCallForwardInfo((ForwardReason)r, voice, fax, data); - cout << " " + text + _(" Voice"), voice); - cout << " " + text + _(" Data"), data); - cout << " " + text + _(" Fax"), fax); - } - break; - } - case BatteryInfo: - { - cout << " "; - int bcs = m->getBatteryChargeStatus(); - switch (bcs) - { - case 0: cout << _("0 ME is powered by the battery") << endl; break; - case 1: cout << _("1 ME has a battery connected, but is not powered by it") - << endl; break; - case 2: cout << _("2 ME does not have a battery connected") << endl; break; - case 3: - cout << _("3 Recognized power fault, calls inhibited") << endl; - break; - } - cout << " " << m->getBatteryCharge() << endl; - break; - } - case BitErrorInfo: - { - cout << " " << m->getBitErrorRate() << endl; - break; - } - case SCAInfo: - { - cout << " " << m->getServiceCentreAddress() << endl; - break; - } - case CharSetInfo: - { - cout << " "; - vector cs = m->getSupportedCharSets(); - for (vector::iterator i = cs.begin(); i != cs.end(); ++i) - cout << "'" << *i << "' "; - cout << endl; - cout << " '" << m->getCurrentCharSet() << "'" << endl; - break; - } - case SignalInfo: - { - cout << " " << m->getSignalStrength() << endl; - break; - } - default: - assert(0); - break; - } -} - -// convert facility class string of the form "", "all", or any combination -// of "v" (voice), "d" (data), or "f" (fax) to numeric form - -FacilityClass strToFacilityClass(string facilityClassS) -{ - facilityClassS = lowercase(facilityClassS); - FacilityClass facilityClass = (FacilityClass)0; - if (facilityClassS == "all" || facilityClassS == "") - return (FacilityClass)ALL_FACILITIES; - - // OR in facility class bits - for (unsigned int i = 0; i < facilityClassS.length(); ++i) - if (facilityClassS[i] == 'v') - facilityClass = (FacilityClass)(facilityClass | VoiceFacility); - else if (facilityClassS[i] == 'd') - facilityClass = (FacilityClass)(facilityClass | DataFacility); - else if (facilityClassS[i] == 'f') - facilityClass = (FacilityClass)(facilityClass | FaxFacility); - else - throw GsmException( - stringPrintf(_("unknown facility class parameter '%c'"), - facilityClassS[i]), ParameterError); - - return facilityClass; -} - -// check if argc - optind is in range min..max -// throw exception otherwise - -void checkParamCount(int optind, int argc, int min, int max) -{ - int paramCount = argc - optind; - if (paramCount < min) - throw GsmException(stringPrintf(_("not enough parameters, minimum number " - "of parameters is %d"), min), - ParameterError); - else if (paramCount > max) - throw GsmException(stringPrintf(_("too many parameters, maximum number " - "of parameters is %d"), max), - ParameterError); -} - -// *** main program - -int main(int argc, char *argv[]) -{ - try - { - // handle command line options - string device = "/dev/mobilephone"; - string operation; - string baudrate; - string initString = DEFAULT_INIT_STRING; - bool swHandshake = false; - - int opt; - int dummy; - while((opt = getopt_long(argc, argv, "I:o:d:b:hvX", longOpts, &dummy)) - != -1) - switch (opt) - { - case 'X': - swHandshake = true; - break; - case 'I': - initString = optarg; - break; - case 'd': - device = optarg; - break; - case 'o': - operation = optarg; - break; - case 'b': - baudrate = optarg; - break; - case 'v': - cerr << argv[0] << stringPrintf(_(": version %s [compiled %s]"), - VERSION, __DATE__) << endl; - exit(0); - break; - case 'h': - cerr << argv[0] << _(": [-b baudrate][-d device][-h]" - "[-I init string][-o operation]\n" - " [-v][-X]{parameters}") << endl - << endl - << _(" -b, --baudrate baudrate to use for device " - "(default: 38400)") - << endl - << _(" -d, --device sets the destination device to " - "connect to") << endl - << _(" -h, --help prints this message") << endl - << _(" -I, --init device AT init sequence") << endl - << _(" -o, --operation operation to perform on the mobile \n" - " phone with the specified parameters") - << endl - << _(" -v, --version prints version and exits") << endl - << _(" -X, --xonxoff switch on software handshake") << endl - << endl - << _(" 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") - << endl << endl - << _("Refer to gsmctl(1) for details on the available parameters" - " and operations.") - << endl << endl; - exit(0); - break; - case '?': - throw GsmException(_("unknown option"), ParameterError); - break; - } - - // open the port and ME/TA - m = new MeTa(new -#ifdef WIN32 - Win32SerialPort -#else - UnixSerialPort -#endif - (device, - baudrate == "" ? - DEFAULT_BAUD_RATE : - baudRateStrToSpeed(baudrate), - initString, swHandshake)); - - if (operation == "") - { // process info parameters - for (int i = optind; i < argc; ++i) - { - string param = lowercase(argv[i]); - if (param == "all") - for (int ip = MeInfo; ip <= SignalInfo; ++ip) - printInfo((InfoParameter)ip); - else if (param == "me") - printInfo(MeInfo); - else if (param == "fun") - printInfo(FunctionalityInfo); - else if (param == "op") - printInfo(OperatorInfo); - else if (param == "currop") - printInfo(CurrentOperatorInfo); - else if (param == "flstat") - printInfo(FacilityLockStateInfo); - else if (param == "flcap") - printInfo(FacilityLockCapabilityInfo); - else if (param == "pw") - printInfo(PasswordInfo); - else if (param == "pin") - printInfo(PINInfo); - else if (param == "clip") - printInfo(CLIPInfo); - else if (param == "forw") - printInfo(CallForwardingInfo); - else if (param == "batt") - printInfo(BatteryInfo); - else if (param == "biterr") - printInfo(BitErrorInfo); - else if (param == "sig") - printInfo(SignalInfo); - else if (param == "sca") - printInfo(SCAInfo); - else if (param == "cset") - printInfo(CharSetInfo); - else - throw GsmException( - stringPrintf(_("unknown information parameter '%s'"), - param.c_str()), - ParameterError); - } - } - else - { // process operation - operation = lowercase(operation); - if (operation == "dial") - { - // dial: number - checkParamCount(optind, argc, 1, 1); - - m->dial(argv[optind]); - - // wait for keypress from stdin - char c; - read(1, &c, 1); - } - else if (operation == "on") - { - m->setFunctionalityLevel(1); - } - else if (operation == "off") - { - m->setFunctionalityLevel(0); - } - else if (operation == "pin") - { - // pin: PIN - checkParamCount(optind, argc, 1, 1); - - m->setPIN(argv[optind]); - } - else if (operation == "setop") - { - // setop: opmode numeric FIXME allow long and numeric too - checkParamCount(optind, argc, 2, 2); - string opmodeS = lowercase(argv[optind]); - OPModes opmode; - if (opmodeS == "automatic") - opmode = AutomaticOPMode; - else if (opmodeS == "manual") - opmode = ManualOPMode; - else if (opmodeS == "deregister") - opmode = DeregisterOPMode; - else if (opmodeS == "manualautomatic") - opmode = ManualAutomaticOPMode; - else - throw GsmException(stringPrintf(_("unknown opmode parameter '%s'"), - opmodeS.c_str()), ParameterError); - - m->setCurrentOPInfo(opmode, "" , "", checkNumber(argv[optind + 1])); - } - else if (operation == "lock") - { - // lock: facility [facilityclass] [passwd] - checkParamCount(optind, argc, 1, 3); - string passwd = (argc - optind == 3) ? - (string)argv[optind + 2] : (string)""; - - m->lockFacility(argv[optind], - (argc - optind >= 2) ? - strToFacilityClass(argv[optind + 1]) : - (FacilityClass)ALL_FACILITIES, - passwd); - } - else if (operation == "unlock") - { - // unlock: facility [facilityclass] [passwd] - checkParamCount(optind, argc, 1, 3); - string passwd = argc - optind == 3 ? argv[optind + 2] : ""; - - m->unlockFacility(argv[optind], - (argc - optind >= 2) ? - strToFacilityClass(argv[optind + 1]) : - (FacilityClass)ALL_FACILITIES, - passwd); - } - else if (operation == "setpw") - { - // set password: facility oldpasswd newpasswd - checkParamCount(optind, argc, 1, 3); - string oldPasswd = argc - optind >= 2 ? argv[optind + 1] : ""; - string newPasswd = argc - optind == 3 ? argv[optind + 2] : ""; - - m->setPassword(argv[optind], oldPasswd, newPasswd); - } - else if (operation == "forw") - { - // call forwarding: mode reason number [facilityclass] [forwardtime] - checkParamCount(optind, argc, 2, 5); - - // get optional parameters facility class and forwardtime - int forwardTime = argc - optind == 5 ? checkNumber(argv[optind + 4]) : - NOT_SET; - FacilityClass facilityClass = - argc - optind >= 4 ? strToFacilityClass(argv[optind + 3]) : - (FacilityClass)ALL_FACILITIES; - - // get forward reason - string reasonS = lowercase(argv[optind + 1]); - ForwardReason reason; - if (reasonS == "unconditional") - reason = UnconditionalReason; - else if (reasonS == "mobilebusy") - reason = MobileBusyReason; - else if (reasonS == "noreply") - reason = NoReplyReason; - else if (reasonS == "notreachable") - reason = NotReachableReason; - else if (reasonS == "all") - reason = AllReasons; - else if (reasonS == "allconditional") - reason = AllConditionalReasons; - else - throw GsmException( - stringPrintf(_("unknown forward reason parameter '%s'"), - reasonS.c_str()), ParameterError); - - // get mode - string modeS = lowercase(argv[optind]); - ForwardMode mode; - if (modeS == "disable") - mode = DisableMode; - else if (modeS == "enable") - mode = EnableMode; - else if (modeS == "register") - mode = RegistrationMode; - else if (modeS == "erase") - mode = ErasureMode; - else - throw GsmException( - stringPrintf(_("unknown forward mode parameter '%s'"), - modeS.c_str()), ParameterError); - - m->setCallForwarding(reason, mode, - (argc - optind >= 3) ? argv[optind + 2] : "", - "", // subaddr - facilityClass, forwardTime); - } - else if (operation == "setsca") - { - // set sca: number - checkParamCount(optind, argc, 1, 1); - m->setServiceCentreAddress(argv[optind]); - } - else if (operation == "cset") - { - // set charset: string - checkParamCount(optind, argc, 1, 1); - m->setCharSet(argv[optind]); - } - else - throw GsmException(stringPrintf(_("unknown operation '%s'"), - operation.c_str()), ParameterError); - } - } - catch (GsmException &ge) - { - cerr << argv[0] << _("[ERROR]: ") << ge.what() << endl; - return 1; - } - return 0; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmpb.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmpb.cc deleted file mode 100644 index 6196b717c2..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmpb.cc +++ /dev/null @@ -1,507 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsmpb.cc -// * -// * Purpose: phonebook management program -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 24.6.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#ifdef WIN32 -#include -#else -#include -#include -#endif -#if defined(HAVE_GETOPT_LONG) || defined(WIN32) -#include -#endif -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -#ifdef HAVE_GETOPT_LONG -static struct option longOpts[] = -{ - {"xonxoff", no_argument, (int*)NULL, 'X'}, - {"phonebook", required_argument, (int*)NULL, 'p'}, - {"init", required_argument, (int*)NULL, 'I'}, - {"destination", required_argument, (int*)NULL, 'd'}, - {"source", required_argument, (int*)NULL, 's'}, - {"destination-backend", required_argument, (int*)NULL, 'D'}, - {"source-backend", required_argument, (int*)NULL, 'S'}, - {"baudrate", required_argument, (int*)NULL, 'b'}, - {"charset", required_argument, (int*)NULL, 't'}, - {"copy", no_argument, (int*)NULL, 'c'}, - {"synchronize", no_argument, (int*)NULL, 'y'}, - {"help", no_argument, (int*)NULL, 'h'}, - {"version", no_argument, (int*)NULL, 'v'}, - {"verbose", no_argument, (int*)NULL, 'V'}, - {"indexed", no_argument, (int*)NULL, 'i'}, - {(char*)NULL, 0, (int*)NULL, 0} -}; -#else -#define getopt_long(argc, argv, options, longopts, indexptr) \ - getopt(argc, argv, options) -#endif - -// insert those entries from sourcePhonebook into destPhonebook -// that are not already present in destPhonebook - -void insertNotPresent(SortedPhonebookRef sourcePhonebook, - SortedPhonebookRef destPhonebook, - bool indexed, bool verbose) -{ - for (SortedPhonebookBase::iterator i = sourcePhonebook->begin(); - i != sourcePhonebook->end(); ++i) - { - pair range; - if (indexed) - { - int index = i->index(); - range = destPhonebook->equal_range(index); - } - else - { - string text = i->text(); - range = destPhonebook->equal_range(text); - } - - // do nothing if the entry is already present in the destination - bool alreadyPresent = false; - for (SortedPhonebookBase::iterator j = range.first; - j != range.second; ++j) - { - i->setUseIndex(indexed); - if (i->telephone() == j->telephone()) - { - alreadyPresent = true; - break; - } - } - // ... else insert it - if (! alreadyPresent) - { - if (verbose) - { - cout << stringPrintf(_("inserting '%s' tel# %s"), - i->text().c_str(), i->telephone().c_str()); - if (indexed) - cout << stringPrintf(_(" (index #%d)"), i->index()); - cout << endl; - } - i->setUseIndex(indexed); - destPhonebook->insert(*i); // insert - } - } -} - -// update those entries in destPhonebook, that -// - have the same name as one entry in destPhonebook -// - but have a different telephone number -// this is only done if the name in question is unique in the destPhonebook -// the case of several entries having the same in the sourcePhonebook -// is handled - only the first is considered for updating - -void updateEntries(SortedPhonebookRef sourcePhonebook, - SortedPhonebookRef destPhonebook, - bool verbose) -{ - bool firstLoop = true; - string lastText; - - for (SortedPhonebookBase::iterator i = sourcePhonebook->begin(); - i != sourcePhonebook->end(); ++i) - { - string text = i->text(); - if (! firstLoop && text != lastText) - { - pair range = - destPhonebook->equal_range(text); - - SortedPhonebookBase::iterator first = range.first; - if (first != destPhonebook->end() && range.second == ++first) - { // just one text in the destPhonebook - if (! (*range.first == *i)) // overwrite if different in destination - { - if (verbose) - cout << stringPrintf(_("updating '%s' tel# %s to new tel# %s"), - range.first->text().c_str(), - range.first->telephone().c_str(), - i->telephone().c_str()) - << endl; - - *range.first = *i; - } - } - lastText = text; - } - firstLoop = false; - } -} - -// the same but for indexed phonebooks - -void updateEntriesIndexed(SortedPhonebookRef sourcePhonebook, - SortedPhonebookRef destPhonebook, - bool verbose) -{ - for (SortedPhonebookBase::iterator i = sourcePhonebook->begin(); - i != sourcePhonebook->end(); ++i) - { - int index = i->index(); - - SortedPhonebookBase::iterator j = destPhonebook->find(index); - - if (j != destPhonebook->end()) - { // index present in the destPhonebook - if (! (*j == *i)) // overwrite if different in destination - { - if (verbose) - cout << stringPrintf(_("updating '%s' tel# %s to new tel# %s" - "(index %d)"), - j->text().c_str(), - j->telephone().c_str(), - i->telephone().c_str(), i->index()) - << endl; - - *j = *i; - } - } - } -} - -// delete those entries from destPhonebook, that are not present -// in sourcePhonebook - -void deleteNotPresent(SortedPhonebookRef sourcePhonebook, - SortedPhonebookRef destPhonebook, - bool indexed, bool verbose) -{ - for (SortedPhonebookBase::iterator i = destPhonebook->begin(); - i != destPhonebook->end(); ++i) - { - pair range; - if (indexed) - { - int index = i->index(); - range = sourcePhonebook->equal_range(index); - } - else - { - string text = i->text(); - range = sourcePhonebook->equal_range(text); - } - - bool found = false; - for (SortedPhonebookBase::iterator j = range.first; - j != range.second; ++j) - { - i->setUseIndex(indexed); - if (j->telephone() == i->telephone()) - { - found = true; - break; - } - } - if (! found) - { - if (verbose) - { - cout << stringPrintf(_("deleting '%s' tel# %s"), - i->text().c_str(), i->telephone().c_str()); - if (indexed) - cout << stringPrintf(_(" (index #%d)"), i->index()); - cout << endl; - } - destPhonebook->erase(i); -#ifdef BUGGY_MAP_ERASE - deleteNotPresent(sourcePhonebook, destPhonebook, indexed, verbose); - return; -#endif - } - } -} - -// *** main program - -int main(int argc, char *argv[]) -{ - try - { - // handle command line options - string destination; - string source; - string destinationBackend; - string sourceBackend; - string baudrate; - bool doSynchronize = true; - string phonebook; - SortedPhonebookRef sourcePhonebook, destPhonebook; - bool verbose = false; - bool indexed = false; - string initString = DEFAULT_INIT_STRING; - bool swHandshake = false; - string charSet; - Ref sourceMeTa, destMeTa; - - int opt; - int dummy; - while((opt = getopt_long(argc, argv, "I:p:s:d:b:cyhvViD:S:Xt:", longOpts, - &dummy)) - != -1) - switch (opt) - { - case 'X': - swHandshake = true; - break; - case 'I': - initString = optarg; - break; - case 'V': - verbose = true; - break; - case 'p': - phonebook = optarg; - break; - case 'd': - destination = optarg; - break; - case 's': - source = optarg; - break; - case 'D': - destinationBackend = optarg; - break; - case 'S': - sourceBackend = optarg; - break; - case 'b': - baudrate = optarg; - break; - case 't': - charSet = optarg; - break; - case 'c': - doSynchronize = false; - break; - case 'i': - indexed = true; - break; - case 'y': - doSynchronize = true; - break; - case 'v': - cerr << argv[0] << stringPrintf(_(": version %s [compiled %s]"), - VERSION, __DATE__) << endl; - exit(0); - break; - case 'h': - cerr << argv[0] << _(": [-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]") << endl - << endl - << _(" -b, --baudrate baudrate to use for device " - "(default: 38400)") - << endl - << _(" -c, --copy copy source entries to destination") - << endl - << _(" -d, --destination sets the destination device to " - "connect \n" - " to, or the file to write") << endl - << _(" -D, --destination-backend sets the destination backend") - << endl - << _(" -h, --help prints this message") << endl - << _(" -i, --index takes index positions into account") - << endl - << _(" -I, --init device AT init sequence") << endl - << _(" -p, --phonebook name of phonebook to use") << endl - << _(" -s, --source sets the source device to connect to,\n" - " or the file to read") << endl - << _(" -t, --charset sets the character set to use for\n" - " phonebook entries") << endl - << _(" -S, --source-backend sets the source backend") - << endl - << _(" -v, --version prints version and exits") << endl - << _(" -V, --verbose print detailed progress messages") - << endl - << _(" -X, --xonxoff switch on software handshake") << endl - << _(" -y, --synchronize synchronize destination with source\n" - " entries (destination is overwritten)\n" - " (see gsmpb(1) for details)") - << endl << endl; - exit(0); - break; - case '?': - throw GsmException(_("unknown option"), ParameterError); - break; - } - - // check if all parameters all present - if (destination == "" || source == "") - throw GsmException(_("both source and destination must be given"), - ParameterError); - - // start accessing source mobile phone or file - if (sourceBackend != "") - sourcePhonebook = - CustomPhonebookRegistry::createPhonebook(sourceBackend, source); - else if (source == "-") - sourcePhonebook = new SortedPhonebook(true, indexed); - else if (isFile(source)) - sourcePhonebook = new SortedPhonebook(source, indexed); - else - { - if (phonebook == "") - throw GsmException(_("phonebook name must be given"), ParameterError); - - sourceMeTa = new MeTa(new -#ifdef WIN32 - Win32SerialPort -#else - UnixSerialPort -#endif - (source, - baudrate == "" ? DEFAULT_BAUD_RATE : - baudRateStrToSpeed(baudrate), initString, - swHandshake)); - if (charSet != "") - sourceMeTa->setCharSet(charSet); - sourcePhonebook = - new SortedPhonebook(sourceMeTa->getPhonebook(phonebook)); - } - - // make sure destination.c_str file exists - if (destination != "") - { - try - { - ofstream f(destination.c_str(), ios::out | ios::app); - } - catch (exception) - { - } - } - - // start accessing destination mobile phone or file - if (destinationBackend != "") - destPhonebook = - CustomPhonebookRegistry::createPhonebook(destinationBackend, - destination); - else if (destination == "-") - destPhonebook = new SortedPhonebook(false, indexed); - else if (isFile(destination)) - destPhonebook = new SortedPhonebook(destination, indexed); - else - { - if (phonebook == "") - throw GsmException(_("phonebook name must be given"), ParameterError); - - destMeTa = new MeTa(new -#ifdef WIN32 - Win32SerialPort -#else - UnixSerialPort -#endif - (destination, - baudrate == "" ? DEFAULT_BAUD_RATE : - baudRateStrToSpeed(baudrate), initString, - swHandshake)); - if (charSet != "") - destMeTa->setCharSet(charSet); - PhonebookRef destPb = destMeTa->getPhonebook(phonebook); - - // check maximum lengths of source text and phonenumber when writing to - // mobile phone - unsigned int maxTextLen = destPb->getMaxTextLen(); - unsigned int maxTelLen = destPb->getMaxTelephoneLen(); - - for (SortedPhonebookBase::iterator i = sourcePhonebook->begin(); - i != sourcePhonebook->end(); ++i) - if (i->text().length() > maxTextLen) - throw GsmException( - stringPrintf(_("text '%s' is too large to fit into destination " - "(maximum size %d characters)"), - i->text().c_str(), maxTextLen), - ParameterError); - else if (i->telephone().length() > maxTelLen) - throw GsmException( - stringPrintf(_("phone number '%s' is too large to fit into " - "destination (maximum size %d characters)"), - i->telephone().c_str(), maxTelLen), - ParameterError); - - // read phonebook - destPhonebook = new SortedPhonebook(destPb); - } - - // now do the actual work - if (doSynchronize) - { // synchronizing - if (indexed) - { - sourcePhonebook->setSortOrder(ByIndex); - destPhonebook->setSortOrder(ByIndex); - // for an explanation see below - updateEntriesIndexed(sourcePhonebook, destPhonebook, verbose); - deleteNotPresent(sourcePhonebook, destPhonebook, true, verbose); - insertNotPresent(sourcePhonebook, destPhonebook, true, verbose); - } - else - { - sourcePhonebook->setSortOrder(ByText); - destPhonebook->setSortOrder(ByText); - // the following is done to avoid superfluous writes to the TA - // (that takes time) and keep updated (ie. telephone number changed) - // entries at the same place - // 1. update entries in place where just the number changed - updateEntries(sourcePhonebook, destPhonebook, verbose); - // 2. delete those that are not present anymore - deleteNotPresent(sourcePhonebook, destPhonebook, false, verbose); - // 3. insert the new ones - insertNotPresent(sourcePhonebook, destPhonebook, false, verbose); - } - } - else - { // copying - destPhonebook->clear(); - for (SortedPhonebookBase::iterator i = sourcePhonebook->begin(); - i != sourcePhonebook->end(); ++i) - { - if (verbose) - { - cout << stringPrintf(_("inserting '%s' tel# %s"), - i->text().c_str(), i->telephone().c_str()); - if (indexed) - cout << stringPrintf(_(" (index #%d)"), i->index()); - cout << endl; - } - destPhonebook->insert(*i); - } - } - } - catch (GsmException &ge) - { - cerr << argv[0] << _("[ERROR]: ") << ge.what() << endl; - return 1; - } - return 0; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmsendsms.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmsendsms.cc deleted file mode 100644 index f6418842ac..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmsendsms.cc +++ /dev/null @@ -1,257 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsmsendsms.cc -// * -// * Purpose: GSM sms send program -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 16.7.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#ifdef WIN32 -#include -#else -#include -#include -#endif -#if defined(HAVE_GETOPT_LONG) || defined(WIN32) -#include -#endif -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -// options - -#ifdef HAVE_GETOPT_LONG -static struct option longOpts[] = -{ - {"requeststat", no_argument, (int*)NULL, 'r'}, - {"xonxoff", no_argument, (int*)NULL, 'X'}, - {"sca", required_argument, (int*)NULL, 'C'}, - {"device", required_argument, (int*)NULL, 'd'}, - {"init", required_argument, (int*)NULL, 'I'}, - {"concatenate", required_argument, (int*)NULL, 'c'}, - {"baudrate", required_argument, (int*)NULL, 'b'}, - {"test", no_argument, (int*)NULL, 't'}, - {"help", no_argument, (int*)NULL, 'h'}, - {"version", no_argument, (int*)NULL, 'v'}, - {(char*)NULL, 0, (int*)NULL, 0} -}; -#else -#define getopt_long(argc, argv, options, longopts, indexptr) \ - getopt(argc, argv, options) -#endif - -// convert /r and /n to CR and LF - -static string unescapeString(char *line) -{ - string result; - bool escaped = false; - int index = 0; - - while (line[index] != 0 && - line[index] != CR && line[index] != LF) - { - if (escaped) - { - escaped = false; - if (line[index] == 'r') - result += CR; - else if (line[index] == 'n') - result += LF; - else if (line[index] == '\\') - result += '\\'; - else - result += line[index]; - } - else - if (line[index] == '\\') - escaped = true; - else - result += line[index]; - - ++index; - } - return result; -} - -// *** main program - -int main(int argc, char *argv[]) -{ - try - { - // handle command line options - string device = "/dev/mobilephone"; - bool test = false; - string baudrate; - Ref at; - string initString = DEFAULT_INIT_STRING; - bool swHandshake = false; - bool requestStatusReport = false; - // service centre address (set on command line) - string serviceCentreAddress; - MeTa *m = NULL; - string concatenatedMessageIdStr; - int concatenatedMessageId = -1; - - int opt; - int dummy; - while((opt = getopt_long(argc, argv, "c:C:I:d:b:thvXr", longOpts, &dummy)) - != -1) - switch (opt) - { - case 'c': - concatenatedMessageIdStr = optarg; - break; - case 'C': - serviceCentreAddress = optarg; - break; - case 'X': - swHandshake = true; - break; - case 'I': - initString = optarg; - break; - case 'd': - device = optarg; - break; - case 'b': - baudrate = optarg; - break; - case 't': - test = true; - break; - case 'r': - requestStatusReport = true; - break; - case 'v': - cerr << argv[0] << stringPrintf(_(": version %s [compiled %s]"), - VERSION, __DATE__) << endl; - exit(0); - break; - case 'h': - cerr << argv[0] << _(": [-b baudrate][-c concatenatedID]" - "[-C sca][-d device][-h][-I init string]\n" - " [-t][-v][-X] phonenumber [text]") << endl - << endl - << _(" -b, --baudrate baudrate to use for device " - "(default: 38400)") - << endl - << _(" -c, --concatenate ID for concatenated SMS messages") - << endl - << _(" -C, --sca SMS service centre address") << endl - << _(" -d, --device sets the destination device to connect " - "to") << endl - << _(" -h, --help prints this message") << endl - << _(" -I, --init device AT init sequence") << endl - << _(" -r, --requeststat request SMS status report") << endl - << _(" -t, --test convert text to GSM alphabet and " - "vice\n" - " versa, no SMS message is sent") << endl - << _(" -v, --version prints version and exits") - << endl - << _(" -X, --xonxoff switch on software handshake") << endl - << endl - << _(" phonenumber recipient's phone number") << endl - << _(" text optional text of the SMS message\n" - " if omitted: read from stdin") - << endl << endl; - exit(0); - break; - case '?': - throw GsmException(_("unknown option"), ParameterError); - break; - } - - if (! test) - { - // open the port and ME/TA - Ref port = new -#ifdef WIN32 - Win32SerialPort -#else - UnixSerialPort -#endif - (device, - baudrate == "" ? DEFAULT_BAUD_RATE : - baudRateStrToSpeed(baudrate), - initString, swHandshake); - // switch message service level to 1 - // this enables acknowledgement PDUs - m = new MeTa(port); - m->setMessageService(1); - - at = new GsmAt(*m); - } - - // check parameters - if (optind == argc) - throw GsmException(_("phone number and text missing"), ParameterError); - - if (optind + 2 < argc) - throw GsmException(_("more than two parameters given"), ParameterError); - - if (concatenatedMessageIdStr != "") - concatenatedMessageId = checkNumber(concatenatedMessageIdStr); - - // get phone number - string phoneNumber = argv[optind]; - - // get text - string text; - if (optind + 1 == argc) - { // read from stdin - char s[1000]; - cin.get(s, 1000); - text = unescapeString(s); - if (text.length() > 160) - throw GsmException(_("text is larger than 160 characters"), - ParameterError); - } - else - text = argv[optind + 1]; - - if (test) - cout << gsmToLatin1(latin1ToGsm(text)) << endl; - else - { - // send SMS - Ref submitSMS = new SMSSubmitMessage(); - // set service centre address in new submit PDU if requested by user - if (serviceCentreAddress != "") - { - Address sca(serviceCentreAddress); - submitSMS->setServiceCentreAddress(sca); - } - submitSMS->setStatusReportRequest(requestStatusReport); - Address destAddr(phoneNumber); - submitSMS->setDestinationAddress(destAddr); - if (concatenatedMessageId == -1) - m->sendSMSs(submitSMS, text, true); - else - m->sendSMSs(submitSMS, text, false, concatenatedMessageId); - } - } - catch (GsmException &ge) - { - cerr << argv[0] << _("[ERROR]: ") << ge.what() << endl; - return 1; - } - return 0; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmsmsd.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmsmsd.cc deleted file mode 100644 index ffb2db0739..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmsmsd.cc +++ /dev/null @@ -1,723 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsmsmsd.cc -// * -// * Purpose: SMS receiver daemon -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 5.6.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include - -#ifdef WIN32 -#include -#include -#include -#define popen _popen -#define pclose _pclose -#else -#include -#include -#include -#include -#endif -#if defined(HAVE_GETOPT_LONG) || defined(WIN32) -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -#ifdef HAVE_GETOPT_LONG -static struct option longOpts[] = -{ - {"requeststat", no_argument, (int*)NULL, 'r'}, - {"direct", no_argument, (int*)NULL, 'D'}, - {"xonxoff", no_argument, (int*)NULL, 'X'}, - {"init", required_argument, (int*)NULL, 'I'}, - {"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'}, - {"action", required_argument, (int*)NULL, 'a'}, - {"baudrate", required_argument, (int*)NULL, 'b'}, - {"help", no_argument, (int*)NULL, 'h'}, - {"version", no_argument, (int*)NULL, 'v'}, - {(char*)NULL, 0, (int*)NULL, 0} -}; -#else -#define getopt_long(argc, argv, options, longopts, indexptr) \ - getopt(argc, argv, options) -#endif - -// my ME - -static MeTa *me = NULL; -string receiveStoreName; // store name for received SMSs - -// service centre address (set on command line) - -static string serviceCentreAddress; - -// ID if concatenated messages should be sent - -static int concatenatedMessageId = -1; - -// signal handler for terminate signal - -bool terminateSent = false; - -void terminateHandler(int signum) -{ - terminateSent = true; -} - -// local class to handle SMS events - -struct IncomingMessage -{ - // used if new message is put into store - int _index; // -1 means message want send directly - string _storeName; - // used if SMS message was sent directly to TA - SMSMessageRef _newSMSMessage; - // used if CB message was sent directly to TA - CBMessageRef _newCBMessage; - // used in both cases - GsmEvent::SMSMessageType _messageType; - - IncomingMessage() : _index(-1) {} -}; - -vector newMessages; - -class EventHandler : public GsmEvent -{ -public: - // inherited from GsmEvent - void SMSReception(SMSMessageRef newMessage, - SMSMessageType messageType); - void CBReception(CBMessageRef newMessage); - void SMSReceptionIndication(string storeName, unsigned int index, - SMSMessageType messageType); - - virtual ~EventHandler() {} -}; - -void EventHandler::SMSReception(SMSMessageRef newMessage, - SMSMessageType messageType) -{ - IncomingMessage m; - m._messageType = messageType; - m._newSMSMessage = newMessage; - newMessages.push_back(m); -} - -void EventHandler::CBReception(CBMessageRef newMessage) -{ - IncomingMessage m; - m._messageType = GsmEvent::CellBroadcastSMS; - m._newCBMessage = newMessage; - newMessages.push_back(m); -} - -void EventHandler::SMSReceptionIndication(string storeName, unsigned int index, - SMSMessageType messageType) -{ - IncomingMessage m; - m._index = index; - - if (receiveStoreName != "" && ( storeName == "MT" || storeName == "mt")) - m._storeName = receiveStoreName; - else - m._storeName = storeName; - - m._messageType = messageType; - newMessages.push_back(m); -} - -// execute action on string - -void doAction(string action, string result) -{ - if (action != "") - { - FILE *fd = popen(action.c_str(), "w"); - if (fd == NULL) - throw GsmException(stringPrintf(_("could not execute '%s'"), - action.c_str()), OSError); - fputs(result.c_str(), fd); - if (ferror(fd)) - throw GsmException(stringPrintf(_("error writing to '%s'"), - action.c_str()), OSError); - pclose(fd); - } - else - // default if no action: output on stdout - cout << result << endl; -} - -// send all SMS messages in spool dir - -bool requestStatusReport = false; - -void sendSMS(string spoolDirBase, string sentDirBase, string failedDirBase, - unsigned int priority, bool enableSyslog, Ref at) -{ - 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 - struct _finddata_t fileInfo; - long fileHandle; - string pattern = spoolDir + "\\*"; - fileHandle = _findfirst(pattern.c_str(), &fileInfo); - bool moreFiles = fileHandle != -1L; -#else - DIR *dir = opendir(spoolDir.c_str()); - if (dir == (DIR*)NULL) - throw GsmException( - stringPrintf(_("error when calling opendir('%s')" - "(errno: %d/%s)"), - spoolDir.c_str(), errno, strerror(errno)), - OSError); -#endif - -#ifdef WIN32 - while (moreFiles) - { - if (strcmp(fileInfo.name, ".") != 0 && - strcmp(fileInfo.name, "..") != 0) -#else - struct dirent *entry; - while ((entry = readdir(dir)) != (struct dirent*)NULL) - if (strcmp(entry->d_name, ".") != 0 && - 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 -#ifdef WIN32 - string filename = spoolDir + "\\" + fileInfo.name; -#else - string filename = spoolDir + "/" + entry->d_name; -#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()) - { - char c; - ifs.get(c); - text += c; - } - ifs.close(); - - // remove trailing newline/linefeed - while (text[text.length() - 1] == '\n' || - text[text.length() - 1] == '\r') - text = text.substr(0, text.length() - 1); - - // send the message - string phoneNumber(phoneBuf); - Ref submitSMS = new SMSSubmitMessage(); - // set service centre address in new submit PDU if requested by user - if (serviceCentreAddress != "") - { - Address sca(serviceCentreAddress); - submitSMS->setServiceCentreAddress(sca); - } - submitSMS->setStatusReportRequest(requestStatusReport); - Address destAddr(phoneNumber); - submitSMS->setDestinationAddress(destAddr); - try - { - 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()); - } - } -#ifdef WIN32 - } - moreFiles = _findnext(fileHandle, &fileInfo) == 0; -#endif - } -#ifdef WIN32 - _findclose(fileHandle); -#else - closedir(dir); -#endif - } -} - -#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"; - string action; - string baudrate; - bool enableSMS = true; - bool enableCB = true; - bool enableStat = true; - 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:S:F:P:LXDr", - longOpts, &dummy)) != -1) - switch (opt) - { - case 'c': - concatenatedMessageIdStr = optarg; - break; - case 'r': - requestStatusReport = true; - break; - case 'D': - onlyReceptionIndication = false; - break; - case 'X': - swHandshake = true; - break; - case 'I': - initString = optarg; - break; - case 't': - receiveStoreName = optarg; - break; - case 'd': - device = optarg; - break; - case 'C': - serviceCentreAddress = optarg; - break; - 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; - case 'a': - action = optarg; - break; - case 'b': - baudrate = optarg; - break; - case 'v': - cerr << argv[0] << stringPrintf(_(": version %s [compiled %s]"), - VERSION, __DATE__) << endl; - exit(0); - break; - case 'h': - cerr << argv[0] << _(": [-a action][-b baudrate][-C sca][-d device]" - "[-f][-h][-I init string]\n" - " [-s spool dir][-t][-v]{sms_type}") - << endl << endl - << _(" -a, --action the action to execute when an SMS " - "arrives\n" - " (SMS is send to stdin of action)") - << endl - << _(" -b, --baudrate baudrate to use for device " - "(default: 38400)") - << endl - << _(" -c, --concatenate start ID for concatenated SMS messages") - << endl - << _(" -C, --sca SMS service centre address") << endl - << _(" -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 - << _(" -v, --version prints version and exits") << endl - << _(" -X, --xonxoff switch on software handshake") << endl - << endl - << _(" sms_type may be any combination of") << endl << endl - << _(" sms, no_sms controls reception of normal SMS") - << endl - << _(" cb, no_cb controls reception of cell broadcast" - " messages") << endl - << _(" stat, no_stat controls reception of status reports") - << 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") <getSMSStore(receiveStoreName); - - for (SMSStore::iterator s = store->begin(); s != store->end(); ++s) - if (! s->empty()) - { - string result = _("Type of message: "); - switch (s->message()->messageType()) - { - case SMSMessage::SMS_DELIVER: - result += _("SMS message\n"); - break; - case SMSMessage::SMS_SUBMIT_REPORT: - result += _("submit report message\n"); - break; - case SMSMessage::SMS_STATUS_REPORT: - result += _("status report message\n"); - break; - } - result += s->message()->toString(); - doAction(action, result); - store->erase(s); - } - } - - // set default SMS store if -t option was given or - // read from ME otherwise - if (receiveStoreName == "") - { - string dummy1, dummy2; - me->getSMSStore(dummy1, dummy2, receiveStoreName ); - } - else - me->setSMSStore(receiveStoreName, 3); - - // switch message service level to 1 - // this enables SMS routing to TA - me->setMessageService(1); - - // switch on SMS routing - me->setSMSRoutingToTA(enableSMS, enableCB, enableStat, - onlyReceptionIndication); - - // register event handler to handle routed SMSs, CBMs, and status reports - me->setEventHandler(new EventHandler()); - - // wait for new messages - bool exitScheduled = false; - while (1) - { -#ifdef WIN32 - ::timeval timeoutVal; - timeoutVal.tv_sec = 5; - timeoutVal.tv_usec = 0; - me->waitEvent((gsmlib::timeval *)&timeoutVal); -#else - struct timeval timeoutVal; - timeoutVal.tv_sec = 5; - timeoutVal.tv_usec = 0; - me->waitEvent(&timeoutVal); -#endif - // if it returns, there was an event or a timeout - while (newMessages.size() > 0) - { - // get first new message and remove it from the vector - SMSMessageRef newSMSMessage = newMessages.begin()->_newSMSMessage; - CBMessageRef newCBMessage = newMessages.begin()->_newCBMessage; - GsmEvent::SMSMessageType messageType = - newMessages.begin()->_messageType; - int index = newMessages.begin()->_index; - string storeName = newMessages.begin()->_storeName; - newMessages.erase(newMessages.begin()); - - // process the new message - string result = _("Type of message: "); - switch (messageType) - { - case GsmEvent::NormalSMS: - result += _("SMS message\n"); - break; - case GsmEvent::CellBroadcastSMS: - result += _("cell broadcast message\n"); - break; - case GsmEvent::StatusReportSMS: - result += _("status report message\n"); - break; - } - if (! newSMSMessage.isnull()) - result += newSMSMessage->toString(); - else if (! newCBMessage.isnull()) - result += newCBMessage->toString(); - else - { - SMSStoreRef store = me->getSMSStore(storeName); - store->setCaching(false); - - if (messageType == GsmEvent::CellBroadcastSMS) - result += (*store.getptr())[index].cbMessage()->toString(); - else - result += (*store.getptr())[index].message()->toString(); - - store->erase(store->begin() + index); - } - - // call the action - doAction(action, result); - } - - // if no new SMS came in and program exit was scheduled, then exit - if (exitScheduled) - exit(0); - - // handle terminate signal - if (terminateSent) - { - exitScheduled = true; - // switch off SMS routing - try - { - me->setSMSRoutingToTA(false, false, false); - } - catch (GsmException &ge) - { - // some phones (e.g. Motorola Timeport 260) don't allow to switch - // off SMS routing which results in an error. Just ignore this. - } - // the AT sequences involved in switching of SMS routing - // may yield more SMS events, so go round the loop one more time - } - - // send spooled SMS - if (! terminateSent) - sendSMS(spoolDir, sentDir, failedDir, priorities, enableSyslog, me->getAt()); - } - } - catch (GsmException &ge) - { - cerr << argv[0] << _("[ERROR]: ") << ge.what() << endl; - if (ge.getErrorClass() == MeTaCapabilityError) - cerr << argv[0] << _("[ERROR]: ") - << _("(try setting sms_type, please refer to gsmsmsd manpage)") - << endl; - // switch off message routing, so that following invocations of gsmsmd - // are not swamped with message deliveries while they start up - if (me != NULL) - { - try - { - me->setSMSRoutingToTA(false, false, false); - } - catch (GsmException &ge) - { - // some phones (e.g. Motorola Timeport 260) don't allow to switch - // off SMS routing which results in an error. Just ignore this. - } - } - return 1; - } - return 0; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmsmsstore.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmsmsstore.cc deleted file mode 100644 index 2bb50a0c76..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/apps/gsmsmsstore.cc +++ /dev/null @@ -1,434 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsmsmsstore.cc -// * -// * Purpose: SMS store management program -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 4.8.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#ifdef WIN32 -#include -#else -#include -#include -#endif -#if defined(HAVE_GETOPT_LONG) || defined(WIN32) -#include -#endif -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -#ifdef HAVE_GETOPT_LONG -static struct option longOpts[] = -{ - {"xonxoff", no_argument, (int*)NULL, 'X'}, - {"init", required_argument, (int*)NULL, 'I'}, - {"store", required_argument, (int*)NULL, 't'}, - {"erase", no_argument, (int*)NULL, 'e'}, - {"add", no_argument, (int*)NULL, 'a'}, - {"list", no_argument, (int*)NULL, 'l'}, - {"destination", required_argument, (int*)NULL, 'd'}, - {"source", required_argument, (int*)NULL, 's'}, - {"baudrate", required_argument, (int*)NULL, 'b'}, - {"sca", required_argument, (int*)NULL, 'C'}, - {"copy", no_argument, (int*)NULL, 'c'}, - {"delete", no_argument, (int*)NULL, 'x'}, - {"backup", no_argument, (int*)NULL, 'k'}, - {"help", no_argument, (int*)NULL, 'h'}, - {"version", no_argument, (int*)NULL, 'v'}, - {"verbose", no_argument, (int*)NULL, 'V'}, - {(char*)NULL, 0, (int*)NULL, 0} -}; -#else -#define getopt_long(argc, argv, options, longopts, indexptr) \ - getopt(argc, argv, options) -#endif - -bool verbose = false; // true if --verbose option given - -// type of operation to perform - -enum Operation {CopyOp = 'c', BackupOp = 'k', DeleteOp = 'x', - AddOp = 'a', ListOp = 'l', NoOp = 0}; - -// aux function, insert entry only if not already present in dest - -void backup(SortedSMSStoreRef destStore, SMSStoreEntry &entry) -{ - // the following only works because we know that the default sort order - // is by date - assert(destStore->sortOrder() == ByDate); - - Timestamp date = entry.message()->serviceCentreTimestamp(); - pair range = - destStore->equal_range(date); - - for (SortedSMSStore::iterator j = range.first; - j != range.second; ++j) - if (entry == *j) - // do nothing if the entry is already present in the destination - return; - - if (verbose) - cout << stringPrintf(_("inserting entry #%d from source into destination"), - entry.index()) << endl - << entry.message()->toString(); - destStore->insert(entry); // insert -} - -// aux function, throw exception if operation != NoOp - -void checkNoOp(Operation operation, int opt) -{ - if (operation != NoOp) - throw GsmException(stringPrintf(_("incompatible options '%c' and '%c'"), - (char)operation, (char)opt), - ParameterError); -} - -// *** main program - -int main(int argc, char *argv[]) -{ - try - { - // handle command line options - string destination; - string source; - string baudrate; - string storeName; - char operation = NoOp; - SortedSMSStoreRef sourceStore, destStore; - bool useIndices = false; // use indices in delete, copy, backup op - string initString = DEFAULT_INIT_STRING; - bool swHandshake = false; - // service centre address (set on command line) - string serviceCentreAddress; - Ref sourceMeTa, destMeTa; - - int opt; - int dummy; - while((opt = getopt_long(argc, argv, "I:t:s:d:b:cxlakhvVXC:", - longOpts, &dummy)) - != -1) - switch (opt) - { - case 'C': - serviceCentreAddress = optarg; - break; - case 'X': - swHandshake = true; - break; - case 'I': - initString = optarg; - break; - case 'V': - verbose = true; - break; - case 't': - storeName = optarg; - break; - case 'd': - destination = optarg; - break; - case 's': - source = optarg; - break; - case 'b': - baudrate = optarg; - break; - case 'c': - checkNoOp((Operation)operation, opt); - operation = CopyOp; - break; - case 'x': - checkNoOp((Operation)operation, opt); - operation = DeleteOp; - break; - case 'l': - checkNoOp((Operation)operation, opt); - operation = ListOp; - break; - case 'a': - checkNoOp((Operation)operation, opt); - operation = AddOp; - break; - case 'k': - checkNoOp((Operation)operation, opt); - operation = BackupOp; - break; - case 'v': - cerr << argv[0] << stringPrintf(_(": version %s [compiled %s]"), - VERSION, __DATE__) << endl; - exit(0); - break; - case 'h': - cerr << argv[0] << _(": [-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]") << endl - << endl - << _(" -a, --add add new SMS submit message\n" - " (phonenumber and text) to destination") - << endl - << _(" -b, --baudrate baudrate to use for device " - "(default: 38400)") - << endl - << _(" -c, --copy copy source entries to destination\n" - " (if indices are given, " - "copy only these entries)") << endl - << _(" -C, --sca SMS service centre address") << endl - << _(" -d, --destination sets the destination device to\n" - " connect to, or the file to write to") - << endl - << _(" -h, --help prints this message") << endl - << _(" -I, --init device AT init sequence") << endl - << _(" -k, --backup backup new entries to destination\n" - " (if indices are given, " - "copy only these entries)") << endl - << _(" -l, --list list source to stdout") << endl - << _(" -s, --source sets the source device to connect to,\n" - " or the file to read") << endl - << _(" -t, --store name of SMS store to use") << endl - << _(" -v, --version prints version and exits") << endl - << _(" -V, --verbose print detailed progress messages") - << endl - << _(" -x, --delete delete entries denoted by indices") - << endl - << _(" -X, --xonxoff switch on software handshake") << endl - << endl; - exit(0); - break; - case '?': - throw GsmException(_("unknown option"), ParameterError); - break; - } - - // check if parameters are complete - if (operation == NoOp) - throw GsmException(_("no operation option given"), ParameterError); - if (operation == BackupOp || operation == CopyOp) - if (destination.length() == 0 || source.length() == 0) - throw GsmException(_("both source and destination required"), - ParameterError); - if (operation == ListOp) - { - if (destination.length() != 0) - throw GsmException(_("destination must not be given"), ParameterError); - if (source.length() == 0) - throw GsmException(_("source required"), ParameterError); - } - if (operation == AddOp || operation == DeleteOp) - { - if (source.length() != 0) - throw GsmException(_("source must not be given"), ParameterError); - if (destination.length() == 0) - throw GsmException(_("destination required"), ParameterError); - } - if (operation == CopyOp || operation == DeleteOp || operation == BackupOp) - { - // check if all indices are numbers - for (int i = optind; i < argc; ++i) - for (char *pp = argv[i]; *pp != 0; ++pp) - if (! isdigit(*pp)) - throw GsmException(stringPrintf(_("expected number, got '%s'"), - argv[i]), ParameterError); - useIndices = optind != argc; - } - else if (operation == AddOp) - { - if (optind + 2 < argc) - throw GsmException(_("more than two parameters given"), - ParameterError); - if (optind + 2 > argc) - throw GsmException(_("not enough parameters given"), - ParameterError); - } - else - if (optind != argc) - throw GsmException(_("unexpected parameters"), ParameterError); - - // start accessing source store or file if required by operation - if (operation == CopyOp || operation == BackupOp || operation == ListOp) - if (source == "-") - sourceStore = new SortedSMSStore(true); - else if (isFile(source)) - sourceStore = new SortedSMSStore(source); - else - { - if (storeName == "") - throw GsmException(_("store name must be given"), ParameterError); - - sourceMeTa = new MeTa(new -#ifdef WIN32 - Win32SerialPort -#else - UnixSerialPort -#endif - (source, - baudrate == "" ? DEFAULT_BAUD_RATE : - baudRateStrToSpeed(baudrate), initString, - swHandshake)); - sourceStore = new SortedSMSStore(sourceMeTa->getSMSStore(storeName)); - } - - // 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 != "") - isFile(destination); - - // start accessing destination store or file - if (operation == CopyOp || operation == BackupOp || operation == AddOp || - operation == DeleteOp) - if (destination == "-") - destStore = new SortedSMSStore(false); - else if (isFile(destination)) - destStore = new SortedSMSStore(destination); - else - { - if (storeName == "") - throw GsmException(_("store name must be given"), ParameterError); - - destMeTa = new MeTa(new -#ifdef WIN32 - Win32SerialPort -#else - UnixSerialPort -#endif - (destination, - baudrate == "" ? DEFAULT_BAUD_RATE : - baudRateStrToSpeed(baudrate), initString, - swHandshake)); - destStore = new SortedSMSStore(destMeTa->getSMSStore(storeName)); - } - - // now do the actual work - switch (operation) - { - case BackupOp: - { - sourceStore->setSortOrder(ByIndex); // needed in loop - - if (useIndices) - for (int i = optind; i < argc; ++i) - { - SortedSMSStore::iterator j = sourceStore->find(atoi(argv[i])); - if (j == sourceStore->end()) - throw GsmException(stringPrintf(_("no index '%s' in source"), - argv[i]), ParameterError); - backup(destStore, *j); - } - else - for (SortedSMSStore::iterator i = sourceStore->begin(); - i != sourceStore->end(); ++i) - backup(destStore, *i); - break; - } - case CopyOp: - { - destStore->clear(); - if (! useIndices) // copy all entries - { - for (SortedSMSStore::iterator i = sourceStore->begin(); - i != sourceStore->end(); ++i) - { - if (verbose) - cout << stringPrintf(_("inserting entry #%d from source " - "into destination"), i->index()) << endl - << i->message()->toString(); - destStore->insert(*i); - } - } - else // copy indexed entries - { - sourceStore->setSortOrder(ByIndex); // needed in loop - - for (int i = optind; i < argc; ++i) - { - SortedSMSStore::iterator j = sourceStore->find(atoi(argv[i])); - if (j == sourceStore->end()) - throw GsmException(stringPrintf(_("no index '%s' in source"), - argv[i]), ParameterError); - if (verbose) - cout << stringPrintf(_("inserting entry #%d from source into " - "destination"), j->index()) << endl - << j->message()->toString(); - destStore->insert(*j); - } - } - break; - } - case ListOp: - { - for (SortedSMSStore::iterator i = sourceStore->begin(); - i != sourceStore->end(); ++i) - cout << stringPrintf(_("index #%d"), i->index()) << endl - << i->message()->toString(); - break; - } - case AddOp: - { - SMSMessageRef sms = new SMSSubmitMessage(argv[optind + 1], argv[optind]); - // set service centre address in new submit PDU if requested by user - if (serviceCentreAddress != "") - { - Address sca(serviceCentreAddress); - sms->setServiceCentreAddress(sca); - } - if (verbose) - cout << _("inserting new entry into destination") << endl - << sms->toString(); - destStore->insert(sms); - break; - } - case DeleteOp: - { - destStore->setSortOrder(ByIndex); - for (int i = optind; i < argc; ++i) - { - int index = atoi(argv[i]); - if (verbose) - { - SortedSMSStore::iterator e = destStore->find(index); - if (e != destStore->end()) - cout << stringPrintf(_("deleting entry #%d from destination"), - index) << endl - << e->message()->toString(); - } - if (destStore->erase(index) != 1) - throw GsmException(stringPrintf(_("no index '%s' in destination"), - argv[i]), ParameterError); - } - break; - } - } - } - catch (GsmException &ge) - { - cerr << argv[0] << _("[ERROR]: ") << ge.what() << endl; - return 1; - } - return 0; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/configure b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/configure deleted file mode 100755 index 5918af81fb..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/configure +++ /dev/null @@ -1,30623 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59. -# -# 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. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -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 - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# 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=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# 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 - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - 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" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - 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+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -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="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="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - - - -# 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 - - - - -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= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -ac_prev= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_option in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # 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 || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (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 -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP -ac_env_CXX_set=${CXX+set} -ac_env_CXX_value=$CXX -ac_cv_env_CXX_set=${CXX+set} -ac_cv_env_CXX_value=$CXX -ac_env_CXXFLAGS_set=${CXXFLAGS+set} -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. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -_ACEOF - - cat <<_ACEOF -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -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 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-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-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 - --without-libintl-prefix don't search for libintl in includedir and libdir - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory - 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. - -_ACEOF -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - ac_popdir=`pwd` - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# 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. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - 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" - done -fi - -test -n "$ac_init_help" && exit 0 -if $ac_init_version; then - cat <<\_ACEOF - -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 - exit 0 -fi -exec 5>config.log -cat >&5 <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was - - $ $0 $@ - -_ACEOF -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# 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= -ac_must_keep_next=false -for ac_pass in 1 2 -do - 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 -# would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -{ - (set) 2>&1 | - 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" - ;; - *) - sed -n \ - "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 -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - 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 && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status - ' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# 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 - 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" - eval ac_new_val="\$ac_env_${ac_var}_value" - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - 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: error: \`$ac_var' has changed since the previous run:" >&2;} - { 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: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&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_aux_dir= -for ac_dir in scripts $srcdir/scripts; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f $ac_dir/shtool; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in scripts $srcdir/scripts" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in scripts $srcdir/scripts" >&2;} - { (exit 1); exit 1; }; } -fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# 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 -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -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. - # Don't use installbsd from OSF since it installs stuff as root - # 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 - done - done - ;; -esac -done - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL=$ac_install_sh - fi -fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - -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 -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; 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_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # 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_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; 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_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; 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_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # 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_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; 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_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; 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_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -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 - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # 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 - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl - 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_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # 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_CC="$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 -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl -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_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_CC" && break -done - - CC=$ac_ct_CC -fi - -fi - - -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. -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); } - -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 -ac_clean_files_save=$ac_clean_files -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 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 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# 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= -# 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 | *.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 -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 - -ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 - -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -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'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -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. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -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); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# 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 conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; - * ) break;; - esac -done -else - { { 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 - -rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 -if test "${ac_cv_objext+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 () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -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 - 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 | *.xSYM | *.bb | *.bbg ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -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 - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -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_c_compiler_gnu+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 () -{ -#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_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_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_c_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_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. */ - -int -main () -{ - - ; - 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_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cc_g=no -fi -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 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - 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 -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#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 - 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_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 -sed 's/^/| /' conftest.$ac_ext >&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); } && - { 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 -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 - -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 -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 for textdomain in -lintl" >&5 -echo $ECHO_N "checking for textdomain in -lintl... $ECHO_C" >&6 -if test "${ac_cv_lib_intl_textdomain+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $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 textdomain (); -int -main () -{ -textdomain (); - ; - 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_intl_textdomain=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_intl_textdomain=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_intl_textdomain" >&5 -echo "${ECHO_T}$ac_cv_lib_intl_textdomain" >&6 -if test $ac_cv_lib_intl_textdomain = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBINTL 1 -_ACEOF - - LIBS="-lintl $LIBS" - -fi - - - ac_config_headers="$ac_config_headers gsm_config.h" - - -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 -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". - { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&5 -echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&2;} - { (exit 1); exit 1; }; } - fi - - test "$2" = conftest.file - ) -then - # Ok. - : -else - { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! -Check your system clock" >&5 -echo "$as_me: error: newly created file is older than distributed files! -Check your system clock" >&2;} - { (exit 1); exit 1; }; } -fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -test "$program_prefix" != NONE && - program_transform_name="s,^,$program_prefix,;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s,\$,$program_suffix,;$program_transform_name" -# Double any \ or $. echo might interpret backslashes. -# By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -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` - -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= - { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 -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. -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_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # 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_AWK="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - 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_,'` -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)"' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftest.make -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - SET_MAKE= -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - -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 - -DEPDIR="${am__leading_dot}deps" - - ac_config_commands="$ac_config_commands depfiles" - - -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. -echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 -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 - - -echo "$as_me:$LINENO: result: $_am_result" >&5 -echo "${ECHO_T}$_am_result" >&6 -rm -f confinc confmf - -# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then - enableval="$enable_dependency_tracking" - -fi; -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -fi - - -if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -# 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 -echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} - { (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 - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -install_sh=${install_sh-"$am_aux_dir/install-sh"} - -# 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. -if test "$cross_compiling" != no; then - 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 - -fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" - -# 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= - -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_CC_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_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. - : > 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 - 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_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - - -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. - 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 - - - -if test x"`egrep _REENTRANT /usr/include/features.h`" != x; then - CXXFLAGS="-D_REENTRANT $CXXFLAGS" - CFLAGS="-D_REENTRANT $CFLAGS" -fi - -CXXFLAGS="-Wall $CXXFLAGS" - -# Check whether --enable-static or --disable-static was given. -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. - 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. - 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 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} - { (exit 1); exit 1; }; } - -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 -if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 -build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 -if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 -host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -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. -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 - - -echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 -if test "${lt_cv_ld_reload_flag+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_ld_reload_flag='-r' -fi -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 -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 -if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - 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 -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: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6 -fi - -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 - 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 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. - -case $host_os in -aix4* | aix5*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -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*) - # 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=pass_all - ;; - -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|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 - -fi -echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -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" - -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 -ia64-*-hpux*) - # 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.$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); }; 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 { (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* - ;; - -*-*-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 <<_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 - 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 - -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' -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 -/* 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_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 - : -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); } >/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 -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 - - done - ac_cv_prog_CPP=$CPP - -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. - # 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_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 - : -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); } >/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 -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 - : -else - { { 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 - - -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+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 -#include -#include - -int -main () -{ - - ; - 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_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -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 -/* 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 - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -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 -/* 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 - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* 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 TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (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 - : -else - 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 ) -ac_cv_header_stdc=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.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 -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 - 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 - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -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 -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_header in dlfcn.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 - -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 - -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 -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 - -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 - - test -n "$ac_ct_CXX" && break -done -test -n "$ac_ct_CXX" || ac_ct_CXX="g++" - - CXX=$ac_ct_CXX -fi - - -# 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 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -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: 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: $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. */ - -int -main () -{ - - ; - 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 - -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 -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 - -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); } && - { 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 -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 - -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 - 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 - - cd .. - rm -rf conftest.dir -else - am_cv_CXX_dependencies_compiler_type=none -fi - -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 "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 - - - - -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 - # 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 - 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); } >/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 -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 - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - 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 -/* 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 - 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); } >/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 -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 - : -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 - - -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 - - 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 - - test -n "$ac_ct_F77" && break -done - - F77=$ac_ct_F77 -fi - - -# 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 - cat >conftest.$ac_ext <<_ACEOF - program main -#ifndef __GNUC__ - choke me -#endif - - end -_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_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 - 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_f77_compiler_gnu=$ac_compiler_gnu - -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 - FFLAGS=-g -cat >conftest.$ac_ext <<_ACEOF - program main - - end -_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_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 - ac_cv_prog_f77_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_f77_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -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 - FFLAGS= - fi -fi - -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 - - - -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! - -# 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 - ;; - - 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 - -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 - - - - -# 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 - -# 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 <&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 - - # 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_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 - 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 - -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 - echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6 -fi - -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 - 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 - - - - - -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" - -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" - ;; - 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"/'` - ;; - 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 - -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 - -# 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_RC - -# 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_RC - -# 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 - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC - -# 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 -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" - - ;; - - *) - { { 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 - 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 -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 - - - - - - - - - - - - - - - - - - - - - -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 -/* 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_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 - : -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); } >/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 -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 - - done - ac_cv_prog_CPP=$CPP - -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. - # 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_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 - : -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); } >/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 -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 - : -else - { { 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 - 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 - -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 -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 - -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 - - test -n "$ac_ct_CXX" && break -done -test -n "$ac_ct_CXX" || ac_ct_CXX="g++" - - CXX=$ac_ct_CXX -fi - - -# 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 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -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: 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: $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. */ - -int -main () -{ - - ; - 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 - -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 -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 - -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); } && - { 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 -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 - 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 - - cd .. - rm -rf conftest.dir -else - am_cv_CXX_dependencies_compiler_type=none -fi - -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 "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 - - - -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. */ - -#include -main() -{ -#if defined(__GNUC__) && \ - ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) - return 1; -#endif - 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 - : -else - 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 "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 - -# 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 - -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 - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 -_ACEOF - -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 -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 - -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 - -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 - -if test $ac_cv_func_alloca_works = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF - -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 -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 - -_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* - -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 - -/* 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 CRAY_STACKSEG_END $ac_func -_ACEOF - - break -fi - - done -fi - -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; -} - -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 - -( 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 - -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF - - -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 -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. */ - -/* 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 - -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 - -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 -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. */ - -/* 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 - -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 - -fi - - - -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 - -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_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 - -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_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 - -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 - - -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. */ - -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 - - ; - 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 - -ac_cv_c_const=no -fi -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 - -_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* - - -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 - 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 ((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=$? - 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_unsigned_short_int=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_unsigned_short_int=no -fi -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: 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 -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=$? - 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 () -{ -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 -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 -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. */ -$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=$? - 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 () -{ -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_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.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 -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 () -{ -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 -else - echo "$as_me: failed program was:" >&5 -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_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 -/* 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 () -{ - - 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_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_short_int=`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 - -( 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 -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 -/* 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>conftest.er1 - ac_status=$? - 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_unsigned_long_int=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_unsigned_long_int=no -fi -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: 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 "$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 () -{ -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>conftest.er1 - ac_status=$? - 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 () -{ -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>conftest.er1 - ac_status=$? - 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 - -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. */ -$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_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 () -{ -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>conftest.er1 - ac_status=$? - 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.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 -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 () -{ -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>conftest.er1 - ac_status=$? - 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 - echo "$as_me: failed program was:" >&5 -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 - 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 -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 -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 - 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 -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_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 - - -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 () -{ -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>conftest.er1 - ac_status=$? - 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_unsigned_int=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_unsigned_int=no -fi -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 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 - # 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 () -{ -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 () -{ -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>conftest.er1 - ac_status=$? - 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 - -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. */ -$ac_includes_default -int -main () -{ -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_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 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_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.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 -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 () -{ -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>conftest.er1 - ac_status=$? - 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 - echo "$as_me: failed program was:" >&5 -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_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 - 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 -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_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_int=`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 - -( 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 - - - -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 - 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 - -# 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 "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 - 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 -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 -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 - - - -# 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 "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. - ;; - *) - 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:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - 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 - 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 "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. - ;; - *) - 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 -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 "$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" - - - - 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 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -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 - ac_cv_gnu_library_2=no -fi -rm -f conftest* - - - -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 - 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 - -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_func_search_save_LIBS=$LIBS -ac_cv_search_strerror=no -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 strerror (); -int -main () -{ -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="none required" -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 "$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. */ - -/* 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 () -{ -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>conftest.er1 - ac_status=$? - 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 - bh_cv_c_signed=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -bh_cv_c_signed=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -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 signed -_ACEOF - - 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 -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.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 - - -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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((off_t *) 0) - return 0; -if (sizeof (off_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_off_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_off_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -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 - : -else - -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 - 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 ((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>conftest.er1 - ac_status=$? - 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_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 () -{ -long long llmax = (long long) -1; - return ll << i | ll >> i | llmax / ll | llmax % ll; - ; - 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_type_long_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_long_long=no -fi -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 - 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 () -{ - - ; - 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 - 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 () -{ - - ; - 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 - gt_cv_c_wchar_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gt_cv_c_wchar_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -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 -/* 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 () -{ - - ; - 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 - gt_cv_c_wint_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gt_cv_c_wint_t=no -fi -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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -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>conftest.er1 - ac_status=$? - 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 - gl_cv_header_inttypes_h=yes -else - 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: $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 HAVE_INTTYPES_H_WITH_UINTMAX 1 -_ACEOF - - fi - - - 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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -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>conftest.er1 - ac_status=$? - 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 - gl_cv_header_stdint_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gl_cv_header_stdint_h=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -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 - -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 - 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 () -{ -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>conftest.er1 - ac_status=$? - 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 - 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 - -_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_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 - gt_cv_func_printf_posix=yes -else - 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 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 - # 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 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 -/* 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 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 - ac_cv_func_mmap_fixed_mapped=no -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 -/* 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; - - 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 - ((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 -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_func_mmap_fixed_mapped=yes -else - 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 ) -ac_cv_func_mmap_fixed_mapped=no -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_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 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 -/* 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 - -_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 -else - ac_cv_gnu_library_2_1=no -fi -rm -f conftest* - - - -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 -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 - -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 - -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); -} - -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_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 - gt_cv_int_divbyzero_sigfpe=yes -else - 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 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 - 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 () -{ -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 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_type_unsigned_long_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_unsigned_long_long=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -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 - -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 () -{ - - ; - 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 - gt_cv_header_inttypes_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gt_cv_header_inttypes_h=no -fi -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 -/* 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_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 - gt_cv_inttypes_pri_broken=no -else - 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: $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 PRI_MACROS_BROKEN 1 -_ACEOF - - fi - - - -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 - # 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 - - 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. */ - -#include -#if HAVE_STDINT_H -#include -#endif -#ifdef SIZE_MAX -Found it -#endif - -_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 - - ; - 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 - - ; - 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 - -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 () -{ -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 - 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.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 -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 - - ; - 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 - echo "$as_me: failed program was:" >&5 -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 -?*) 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 () -{ - - 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_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_hi=`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 - -( 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 * !((~(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_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 - - ; - 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 - -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 () -{ -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 - 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.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 -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 - - ; - 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 - echo "$as_me: failed program was:" >&5 -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 -?*) res_lo=$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 () -{ - - 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_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 - -( 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 - - ; - 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 - - ; - 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 - -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 () -{ -static int test_array [1 - 2 * !((sizeof (size_t) <= 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_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 - - ; - 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.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 -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 -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 - echo "$as_me: failed program was:" >&5 -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 -?*) fits_in_uint=$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 sizeof (size_t) <= sizeof (unsigned int); } -unsigned long ulongval () { return sizeof (size_t) <= sizeof (unsigned int); } -#include -#include -int -main () -{ - - 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); - - ; - 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 - fits_in_uint=`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 - -( 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 "$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; - -int -main () -{ - - ; - 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 - fits_in_uint=0 -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 - 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 SIZE_MAX $result -_ACEOF - - fi - - - - - -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 - # 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 - - - - 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 - -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 - 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" - - -# 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; -# 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. - echo "$as_me:$LINENO: checking for ld used by GCC" >&5 -echo $ECHO_N "checking for ld used by GCC... $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. - [\\/]* | [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 - 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 "${acl_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - 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 -fi - -LD="$acl_cv_path_LD" -if test -n "$LD"; then - echo "$as_me:$LINENO: result: $LD" >&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 "${acl_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 ld's only accept -v. -case `$LD -v 2>&1 &5 -echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6 -with_gnu_ld=$acl_cv_prog_gnu_ld - - - - - 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 - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - 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 - -fi -echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 -echo "${ECHO_T}$acl_cv_rpath" >&6 - 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" - # Check whether --enable-rpath or --disable-rpath was given. -if test "${enable_rpath+set}" = set; then - enableval="$enable_rpath" - : -else - enable_rpath=yes -fi; - - - - - - - - use_additional=yes - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - -# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. -if test "${with_libiconv_prefix+set}" = set; then - withval="$with_libiconv_prefix" - - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - else - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi - -fi; - LIBICONV= - LTLIBICONV= - INCICONV= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='iconv ' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" - else - : - fi - else - found_dir= - found_la= - found_so= - found_a= - if test $use_additional = yes; then - if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then - found_dir="$additional_libdir" - found_so="$additional_libdir/lib$name.$shlibext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - else - if test -f "$additional_libdir/lib$name.$libext"; then - found_dir="$additional_libdir" - found_a="$additional_libdir/lib$name.$libext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then - found_dir="$dir" - found_so="$dir/lib$name.$shlibext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - else - if test -f "$dir/lib$name.$libext"; then - found_dir="$dir" - found_a="$dir/lib$name.$libext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - if test "$hardcode_direct" = yes; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - haveit= - for x in $LDFLAGS $LIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" - fi - if test "$hardcode_minus_L" != no; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" - else - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" - fi - fi - additional_includedir= - case "$found_dir" in - */lib | */lib/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - 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 - for x in $CPPFLAGS $INCICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - if test -n "$found_la"; then - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/lib"; 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 - haveit= - for x in $LDFLAGS $LIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" - ;; - esac - done - fi - else - LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$hardcode_libdir_separator"; then - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" - done - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" - else - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - for found_dir in $ltrpathdirs; do - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" - done - fi - - - - - - - - - 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 - - - - 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 -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 _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>conftest.er1 - ac_status=$? - 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__snwprintf=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl__snwprintf=no -fi -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 - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL__SNWPRINTF $gt_value -_ACEOF - - - - - 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=$? - 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_feof_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_feof_unlocked=no -fi -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 - -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 - 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 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 - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FGETS_UNLOCKED $gt_value -_ACEOF - - - - 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 -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ - -#ifndef getc_unlocked - char *p = (char *) getc_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_getc_unlocked=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl_getc_unlocked=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -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 - - - - 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 - - - - - - - - am_save_CPPFLAGS="$CPPFLAGS" - - for element in $INCICONV; do - haveit= - for x in $CPPFLAGS; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" - fi - done - - - echo "$as_me:$LINENO: checking for iconv" >&5 -echo $ECHO_N "checking for iconv... $ECHO_C" >&6 -if test "${am_cv_func_iconv+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - am_cv_func_iconv="no, consider installing GNU libiconv" - am_cv_lib_iconv=no - 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 () -{ -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); - ; - 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 - am_cv_func_iconv=yes -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 "$am_cv_func_iconv" != yes; then - am_save_LIBS="$LIBS" - LIBS="$LIBS $LIBICONV" - 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 () -{ -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); - ; - 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 - am_cv_lib_iconv=yes - am_cv_func_iconv=yes -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 - LIBS="$am_save_LIBS" - fi - -fi -echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 -echo "${ECHO_T}$am_cv_func_iconv" >&6 - if test "$am_cv_func_iconv" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ICONV 1 -_ACEOF - - fi - if test "$am_cv_lib_iconv" = yes; then - echo "$as_me:$LINENO: checking how to link with libiconv" >&5 -echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: $LIBICONV" >&5 -echo "${ECHO_T}$LIBICONV" >&6 - else - CPPFLAGS="$am_save_CPPFLAGS" - LIBICONV= - LTLIBICONV= - fi - - - - if test "$am_cv_func_iconv" = yes; then - echo "$as_me:$LINENO: checking for iconv declaration" >&5 -echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6 - if test "${am_cv_proto_iconv+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 -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 - -int -main () -{ - - ; - 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 - am_cv_proto_iconv_arg1="" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -am_cv_proto_iconv_arg1="const" -fi -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 - - am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - echo "$as_me:$LINENO: result: ${ac_t:- - }$am_cv_proto_iconv" >&5 -echo "${ECHO_T}${ac_t:- - }$am_cv_proto_iconv" >&6 - -cat >>confdefs.h <<_ACEOF -#define ICONV_CONST $am_cv_proto_iconv_arg1 -_ACEOF - - fi - - - echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 -echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6 -if test "${am_cv_langinfo_codeset+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* cs = nl_langinfo(CODESET); - ; - 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 - am_cv_langinfo_codeset=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -am_cv_langinfo_codeset=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi -echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 -echo "${ECHO_T}$am_cv_langinfo_codeset" >&6 - if test $am_cv_langinfo_codeset = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LANGINFO_CODESET 1 -_ACEOF - - fi - - if test $ac_cv_header_locale_h = yes; then - - echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 -echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6 -if test "${gt_cv_val_LC_MESSAGES+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 () -{ -return LC_MESSAGES - ; - 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_val_LC_MESSAGES=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gt_cv_val_LC_MESSAGES=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -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 -_ACEOF - - fi - - 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. -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_INTLBISON+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$INTLBISON"; then - ac_cv_prog_INTLBISON="$INTLBISON" # 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_INTLBISON="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -INTLBISON=$ac_cv_prog_INTLBISON -if test -n "$INTLBISON"; then - 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 -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 - -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 - - - - - 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 - USE_NLS=yes -fi; - echo "$as_me:$LINENO: result: $USE_NLS" >&5 -echo "${ECHO_T}$USE_NLS" >&6 - - - - - BUILD_INCLUDED_LIBINTL=no - USE_INCLUDED_LIBINTL=no - - LIBINTL= - LTLIBINTL= - POSUB= - - if test "$USE_NLS" = "yes"; then - gt_use_preinstalled_gnugettext=no - - echo "$as_me:$LINENO: checking whether included gettext is requested" >&5 -echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6 - -# Check whether --with-included-gettext or --without-included-gettext was given. -if test "${with_included_gettext+set}" = set; then - withval="$with_included_gettext" - nls_cv_force_use_gnu_gettext=$withval -else - nls_cv_force_use_gnu_gettext=no -fi; - echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5 -echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6 - - nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" - if test "$nls_cv_force_use_gnu_gettext" != "yes"; then - - - - - - - echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 -echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6 -if test "${gt_cv_func_gnugettext1_libc+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 -extern int _nl_msg_cat_cntr; -extern int *_nl_domain_bindings; -int -main () -{ -bindtextdomain ("", ""); -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>conftest.er1 - ac_status=$? - 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_gnugettext1_libc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gt_cv_func_gnugettext1_libc=no -fi -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 - - if test "$gt_cv_func_gnugettext1_libc" != "yes"; then - - - - use_additional=yes - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - -# Check whether --with-libintl-prefix or --without-libintl-prefix was given. -if test "${with_libintl_prefix+set}" = set; then - withval="$with_libintl_prefix" - - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - else - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi - -fi; - LIBINTL= - LTLIBINTL= - INCINTL= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='intl ' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" - else - : - fi - else - found_dir= - found_la= - found_so= - found_a= - if test $use_additional = yes; then - if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then - found_dir="$additional_libdir" - found_so="$additional_libdir/lib$name.$shlibext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - else - if test -f "$additional_libdir/lib$name.$libext"; then - found_dir="$additional_libdir" - found_a="$additional_libdir/lib$name.$libext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then - found_dir="$dir" - found_so="$dir/lib$name.$shlibext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - else - if test -f "$dir/lib$name.$libext"; then - found_dir="$dir" - found_a="$dir/lib$name.$libext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - else - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - if test "$hardcode_direct" = yes; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - else - if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - haveit= - for x in $LDFLAGS $LIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" - fi - if test "$hardcode_minus_L" != no; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - else - LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" - else - LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" - fi - fi - additional_includedir= - case "$found_dir" in - */lib | */lib/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - 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 - for x in $CPPFLAGS $INCINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - if test -n "$found_la"; then - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/lib"; 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 - haveit= - for x in $LDFLAGS $LIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" - ;; - esac - done - fi - else - LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$hardcode_libdir_separator"; then - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" - done - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" - else - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - for found_dir in $ltrpathdirs; do - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" - done - fi - - echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 -echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6 -if test "${gt_cv_func_gnugettext1_libintl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - gt_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $INCINTL" - gt_save_LIBS="$LIBS" - LIBS="$LIBS $LIBINTL" - cat >conftest.$ac_ext <<_ACEOF -/* 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 (const char *); -int -main () -{ -bindtextdomain ("", ""); -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>conftest.er1 - ac_status=$? - 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_gnugettext1_libintl=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gt_cv_func_gnugettext1_libintl=no -fi -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 -/* 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 (const char *); -int -main () -{ -bindtextdomain ("", ""); -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>conftest.er1 - ac_status=$? - 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 - LIBINTL="$LIBINTL $LIBICONV" - LTLIBINTL="$LTLIBINTL $LTLIBICONV" - gt_cv_func_gnugettext1_libintl=yes - -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 - fi - CPPFLAGS="$gt_save_CPPFLAGS" - LIBS="$gt_save_LIBS" -fi -echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libintl" >&5 -echo "${ECHO_T}$gt_cv_func_gnugettext1_libintl" >&6 - fi - - if test "$gt_cv_func_gnugettext1_libc" = "yes" \ - || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \ - && test "$PACKAGE" != gettext-runtime \ - && test "$PACKAGE" != gettext-tools; }; then - gt_use_preinstalled_gnugettext=yes - else - LIBINTL= - LTLIBINTL= - INCINTL= - fi - - - if test "$gt_use_preinstalled_gnugettext" != "yes"; then - nls_cv_use_gnu_gettext=yes - fi - fi - - if test "$nls_cv_use_gnu_gettext" = "yes"; then - 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 - -cat >>confdefs.h <<\_ACEOF -#define ENABLE_NLS 1 -_ACEOF - - else - USE_NLS=no - 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 - if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then - echo "$as_me:$LINENO: checking how to link with libintl" >&5 -echo $ECHO_N "checking how to link with libintl... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: $LIBINTL" >&5 -echo "${ECHO_T}$LIBINTL" >&6 - - for element in $INCINTL; do - haveit= - for x in $CPPFLAGS; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" - fi - done - - fi - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_GETTEXT 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DCGETTEXT 1 -_ACEOF - - fi - - POSUB=po - fi - - - if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then - BUILD_INCLUDED_LIBINTL=yes - fi - - - - - - nls_cv_header_intl= - nls_cv_header_libgt= - - DATADIRNAME=share - - - INSTOBJEXT=.mo - - - GENCAT=gencat - - - INTLOBJS= - if test "$USE_INCLUDED_LIBINTL" = yes; then - INTLOBJS="\$(GETTOBJS)" - fi - - - INTL_LIBTOOL_SUFFIX_PREFIX= - - - - INTLLIBS="$LIBINTL" - - - - - - - -_localedir=`eval "echo $datadir/locale"` -if test "$_localedir" = "NONE/share/locale"; then - cat >>confdefs.h <<_ACEOF -#define LOCALEDIR "/usr/local/share/locale" -_ACEOF - -else - _localedir=`echo \"$_localedir\"` - cat >>confdefs.h <<_ACEOF -#define LOCALEDIR $_localedir -_ACEOF - -fi - - - -if test x$USE_INCLUDED_LIBINTL = xyes; then - COMPILE_INTL_TRUE= - COMPILE_INTL_FALSE='#' -else - COMPILE_INTL_TRUE='#' - COMPILE_INTL_FALSE= -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" -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 -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# 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 overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# 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 \ - "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" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -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 - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# 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[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -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 -echo "$as_me: error: conditional \"AMDEP\" was never defined. -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 -echo "$as_me: error: conditional \"COMPILE_INTL\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# 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. ## -## --------------------- ## - -# Be Bourne compatible -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 - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# 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=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# 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 - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - 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" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - 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+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -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="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="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - -exec 6>&1 - -# Open the log real soon, to keep \$[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 -_ACEOF - -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi - -cat >>$CONFIG_STATUS <<\_ACEOF - -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -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 - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to ." -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" - -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 -INSTALL="$INSTALL" -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - 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 $ac_option in - # Handling of the options. -_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) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $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 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" ;; - - esac - 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 -# -# INIT-COMMANDS section. -# - -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" -# 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%}" - - -_ACEOF - - - -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_config_target in $ac_config_targets -do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "gsmlib/Makefile" ) CONFIG_FILES="$CONFIG_FILES gsmlib/Makefile" ;; - "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; - "apps/Makefile" ) CONFIG_FILES="$CONFIG_FILES apps/Makefile" ;; - "win32/Makefile" ) CONFIG_FILES="$CONFIG_FILES win32/Makefile" ;; - "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; - "scripts/Makefile" ) CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; - "intl/Makefile" ) CONFIG_FILES="$CONFIG_FILES intl/Makefile" ;; - "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; - "ext/Makefile" ) CONFIG_FILES="$CONFIG_FILES ext/Makefile" ;; - "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; - "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; - "gsm_config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS gsm_config.h" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - 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 || -{ - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - -# -# CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -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 -s,@AUTOCONF@,$AUTOCONF,;t t -s,@AUTOMAKE@,$AUTOMAKE,;t t -s,@AUTOHEADER@,$AUTOHEADER,;t t -s,@MAKEINFO@,$MAKEINFO,;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 -s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t -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 -s,@build_os@,$build_os,;t t -s,@host@,$host,;t t -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,@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,@BUILD_INCLUDED_LIBINTL@,$BUILD_INCLUDED_LIBINTL,;t t -s,@USE_INCLUDED_LIBINTL@,$USE_INCLUDED_LIBINTL,;t t -s,@CATOBJEXT@,$CATOBJEXT,;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 -s,@LTLIBINTL@,$LTLIBINTL,;t t -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 - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (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" - else - 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 - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # 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,:.*,,'` ;; - *:* ) ac_file_in=`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 || -echo X"$ac_file" | - 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 - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# 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 - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; - esac - - # 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. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - 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 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - 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 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - 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 -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_HEADER section. -# - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# 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_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # 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,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - 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 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - # 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 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# And first: Protect against being on the right side of a sed subst in -# config.status. Protect against being in an unquoted here document -# in config.status. -rm -f conftest.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -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 -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #undef with comments. This is necessary, for -# 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]*,/* & */, -_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 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 -while grep . conftest.defines >/dev/null -do - # 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 - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs 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 #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # 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 - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs - -cat >>$CONFIG_STATUS <<\_ACEOF - # 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. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in - if test x"$ac_file" != x-; 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 || -echo X"$ac_file" | - 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; }; }; } - - rm -f $ac_file - mv $tmp/config.h $ac_file - fi - else - cat $tmp/config.h - rm -f $tmp/config.h - fi -# 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 - -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - 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 || -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 - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# 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 -echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - depfiles ) test x"$AMDEP_TRUE" != x"" || 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=`(dirname "$mf") 2>/dev/null || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - else - continue - fi - # 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=`(dirname "$file") 2>/dev/null || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - 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'` - { 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" - done -done - ;; - default-1 ) - 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 - ;; - esac - done ;; - default ) echo timestamp > stamp-h ;; - esac -done -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# 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_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. - $ac_cs_success || { (exit 1); exit 1; } -fi - - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/configure.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/configure.in deleted file mode 100644 index d586c4e35d..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/configure.in +++ /dev/null @@ -1,131 +0,0 @@ -dnl ************************************************************************* -dnl * GSM TA/ME library -dnl * -dnl * File: configure.in -dnl * -dnl * Purpose: autoconf configure script template -dnl * -dnl * Author: Peter Hofmann (software@pxh.de) -dnl * -dnl * Created: 11.11.1999 -dnl ************************************************************************* - -dnl Process this file with autoconf to produce a configure script. -AC_INIT(gsmlib/gsm_error.h) - -dnl Other -AC_CONFIG_AUX_DIR(scripts) -AC_PROG_INSTALL - -dnl check for libintl -AC_CHECK_LIB(intl, textdomain) - -dnl use config header -AM_CONFIG_HEADER(gsm_config.h) - -dnl use automake -AM_INIT_AUTOMAKE(gsmlib, 1.10) - -dnl change to no if you want no shared libraries for debugging purposes -AM_ENABLE_SHARED(yes) - -dnl use -O2 optimization by default -if test "$CXXFLAGS" = ""; then - CXXFLAGS="-O2" -fi - -dnl comment out this line to get extensive debugging output and asserts -dnl CXXFLAGS="-DNDEBUG $CXXFLAGS" - -dnl uncomment to get translations without installing gsmlib -dnl CXXFLAGS="-DLOCAL_TRANSLATIONS $CXXFLAGS" - -dnl check _REENTRANT in header files -if test x"`egrep _REENTRANT /usr/include/features.h`" != x; then - CXXFLAGS="-D_REENTRANT $CXXFLAGS" - CFLAGS="-D_REENTRANT $CFLAGS" -fi - -dnl output all warnings -CXXFLAGS="-Wall $CXXFLAGS" - -dnl use libtool -AM_PROG_LIBTOOL - -dnl Checks for programs. -AC_PROG_CPP -AC_PROG_CXX - -dnl check for gcc 2.95.x -AC_TRY_RUN([ -#include -main() -{ -#if defined(__GNUC__) && \ - ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) - return 1; -#endif - return 0; -} -],, -[echo "need at least gcc 2.95 to compile correctly" -exit 1]) - -dnl check for alloca -AC_FUNC_ALLOCA - -dnl check for getopt_long in the C library -AC_CHECK_LIB(c, getopt_long, AC_DEFINE(HAVE_GETOPT_LONG)) - -dnl check for alarm in the C library -AC_CHECK_LIB(c, alarm, AC_DEFINE(HAVE_ALARM)) - -dnl check for netinet/in.h header -AC_CHECK_HEADERS(netinet/in.h) - -dnl check for string.h header -AC_CHECK_HEADERS(string.h) - -dnl check for libintl.h header -AC_CHECK_HEADERS(libintl.h) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST - -dnl check for vsnprintf() -dnl AC_FUNC_VPRINTF -AC_EGREP_HEADER(vsnprintf, stdio.h, AC_DEFINE(HAVE_VSNPRINTF)) - -dnl checks for builtin data type sizes -AC_CHECK_SIZEOF(unsigned short int, 2) -AC_CHECK_SIZEOF(unsigned long int, 4) -AC_CHECK_SIZEOF(unsigned int, 4) - -dnl Project-specific settings -GSM_VERSION="1:4:0" -AC_SUBST(GSM_VERSION) - -dnl national language support (NLS) -LINGUAS="de" -ALL_LINGUAS=$LINGUAS -AM_GNU_GETTEXT - -dnl set locale dir (FIXME there must be a better way) -_localedir=`eval "echo $datadir/locale"` -if test "$_localedir" = "NONE/share/locale"; then - AC_DEFINE_UNQUOTED(LOCALEDIR, "/usr/local/share/locale") -else - _localedir=`echo \"$_localedir\"` - AC_DEFINE_UNQUOTED(LOCALEDIR, $_localedir) -fi - -dnl whether to compile the intl directory -AM_CONDITIONAL(COMPILE_INTL, test x$USE_INCLUDED_LIBINTL = xyes) - -AC_OUTPUT(Makefile gsmlib/Makefile tests/Makefile apps/Makefile win32/Makefile - doc/Makefile scripts/Makefile intl/Makefile po/Makefile.in - ext/Makefile, - echo timestamp > stamp-h) - -dnl repair Makefile in po subdir -dnl sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsm-utils.cron.d b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsm-utils.cron.d deleted file mode 100644 index 7974513ccc..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsm-utils.cron.d +++ /dev/null @@ -1,3 +0,0 @@ -# /etc/cron.d/gsm-utils: crontab fragment for gsm-utils - -*/5 * * * * root if [ -x /usr/bin/gsmsmsrequeue ]; then /usr/bin/gsmsmsrequeue; fi diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsm-utils.default b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsm-utils.default deleted file mode 100644 index 8ab73a9530..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/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 - -do_accounting () { true; } # it's your turn diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsm-utils.init b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsm-utils.init deleted file mode 100644 index 7bb3ac0cd1..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsm-utils.init +++ /dev/null @@ -1,81 +0,0 @@ -#! /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-patched-13ubuntu/contrib/gsmsmsrequeue b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsmsmsrequeue deleted file mode 100644 index 88b65c15bf..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsmsmsrequeue +++ /dev/null @@ -1,48 +0,0 @@ -#! /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 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsmsmsspool b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsmsmsspool deleted file mode 100644 index 75bc1f9b79..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/contrib/gsmsmsspool +++ /dev/null @@ -1,34 +0,0 @@ -#! /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/" diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/changelog b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/changelog deleted file mode 100644 index 86bca0b277..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/changelog +++ /dev/null @@ -1,284 +0,0 @@ -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 - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/compat b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/compat deleted file mode 100644 index b8626c4cff..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/compat +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/control b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/control deleted file mode 100644 index b230b8b838..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/control +++ /dev/null @@ -1,45 +0,0 @@ -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. 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 deleted file mode 100644 index dcb44c32cd..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/copyright +++ /dev/null @@ -1,34 +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 - -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 deleted file mode 100644 index a39a14c5cf..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/dirs +++ /dev/null @@ -1 +0,0 @@ -/var/run/gsm-utils diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.cron.d b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.cron.d deleted file mode 100644 index 7974513ccc..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.cron.d +++ /dev/null @@ -1,3 +0,0 @@ -# /etc/cron.d/gsm-utils: crontab fragment for gsm-utils - -*/5 * * * * root if [ -x /usr/bin/gsmsmsrequeue ]; then /usr/bin/gsmsmsrequeue; fi 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 deleted file mode 100644 index 11901da54a..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.default +++ /dev/null @@ -1,18 +0,0 @@ -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-13ubuntu/debian/gsm-utils.dirs b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.dirs deleted file mode 100644 index 7bc765edd6..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.dirs +++ /dev/null @@ -1,11 +0,0 @@ -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 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.docs b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.docs deleted file mode 100644 index d4f3801ab1..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.docs +++ /dev/null @@ -1,4 +0,0 @@ -NEWS -README -TODO -doc/FAQ 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 deleted file mode 100644 index bd892f97be..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.examples +++ /dev/null @@ -1,2 +0,0 @@ -contrib/gsm-utils.cron.d -contrib/gsm-utils.init diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.init b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.init deleted file mode 100644 index bc51002f65..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.init +++ /dev/null @@ -1,87 +0,0 @@ -#! /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 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.postinst b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.postinst deleted file mode 100644 index 2954c4a400..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.postinst +++ /dev/null @@ -1,28 +0,0 @@ -#!/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# diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.postrm b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.postrm deleted file mode 100644 index cba60a894c..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsm-utils.postrm +++ /dev/null @@ -1,43 +0,0 @@ -#!/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 - - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsmsiexfer.1 b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsmsiexfer.1 deleted file mode 100644 index 4dc996578a..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/gsmsiexfer.1 +++ /dev/null @@ -1,29 +0,0 @@ -.\" -*- 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). - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/libgsmme-dev.docs b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/libgsmme-dev.docs deleted file mode 100644 index 8c378905c5..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/libgsmme-dev.docs +++ /dev/null @@ -1,2 +0,0 @@ -doc/README.developers -doc/README.NLS diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/rules b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/rules deleted file mode 100644 index a615ea02d4..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/rules +++ /dev/null @@ -1,129 +0,0 @@ -#!/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 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/watch b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/watch deleted file mode 100644 index 530c7916ca..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/debian/watch +++ /dev/null @@ -1,2 +0,0 @@ -version=2 -http://www.pxh.de/fs/gsmlib/download/content.html gsmlib-(.*)\.tar\.gz diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/FAQ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/FAQ deleted file mode 100644 index 303ab14555..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/FAQ +++ /dev/null @@ -1,101 +0,0 @@ -*** 1. I get the error - /usr/local/bin/gsmsmsd [ERROR]: cannot route status report message to TE - -Some phones/modems cannot route all kinds of SMS to the TE -(computer). Please try - - gsmsmsd no_stat - -This is documented in the gsmsmsd manual page. - - -*** 2. Siemens M20T expects an initial PIN. - -For the Siemens M20T an initial PIN must be send once (probably when -it is switched on or the computer is powered on). This PIN is used for -all subsequent invocations of gsmlib-based programs. The trick is to -issue the following program (eg. in the rc-scripts of the operating system): - - gsmctl -I "+cpin=" - - -*** 3. Sending SMS with or retrieving SMS from my Ericsson SH888 does -not work. - -Set the environment variable GSMLIB_SH888_FIX: - -export GSMLIB_SH888_FIX=1 (bash) -setenv GSMLIB_SH888_FIX 1 (tcsh) - -If it works now, I need your model number. You could just enter -"AT+CGMM" in a terminal program and send me the results. Alternatively -set the environment variable GSMLIB_DEBUG=2 and me the dump. - -*** 4. I get the error "ME/TA error 'Unidentified subscriber' (code -28)" when trying to send SMS using gsmsendsms or gsmsmsd. - -The SMS service centre address (SCA, the phone number of the centre that is -accepting SMS for delivery) is not set correctly in your phone. There -are three ways to correct this: - -1. set the default SCA (example is for Germany T-D1): - - gsmctl -o setsca "+491710760000" - -2. Use the menus of your phone to set the SMS SCA. - -3. Use the option "--sca 1234567" for the gsmsmsd, gsmsmsstore, and -gsmsendsms programs. This tries to set the SCA in the SMS itself (does -not change default SCA) and might not work with all phones. - -*** 5. gsmlib works unreliably with my phone. - -Try another baudrate, even higher baudrates sometimes work better then -lower ones. - -*** 6. On Win32 accessing the COM device fails. - -Use COMx: (x is the number of the COM device) instead of the UNIX -device name. If this doesn't work use "\\.\COMx:". - -*** 7. Windows 2000 Does Not Support Mapping Virtual COM Ports to - Infrared Ports. - -Windows 2000 users should follow the instructions in -support.microsoft.com article Q252795 in order to connect with their -mobile. - -*** 8. gcc-compiled shared C++ libraries do not work properly on some - commercial UNIX systems and with older version of gcc. - -The symptoms may be that the program dumps core on exceptions (AIX) or that -global constructors are not called (Solaris). - -Try to compile gsmlib with - - ./configure --disable-shared --enable-static - -if you encounter strange problems. - -*** 9. How to support unicode? - -You need 6 steps: - -1. set datacodingschema to DCS_SIXTEEN_BIT_ALPHABET - -2. set your locale correctly, for example, my locale, china. - setlocale(LC_ALL, "chs"); - -3. translate MBCS(multiple byte character set) string to unicode string. - wchar_t wstr[ 1000 ]; - memset(wstr, 0, 2000); - mbstowcs(wstr, data.c_str(), data.length()); - -4. get unicode string length. - int wcs_len = wcslen(wstr); - -5. change unicode string to net order. - for (int i = 0; i < wcs_len; i++) - wstr[ i ] = htons(wstr[ i ]); - -6. put unicode string into pdu. diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/Makefile.am b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/Makefile.am deleted file mode 100644 index f194f8d496..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/Makefile.am +++ /dev/null @@ -1,33 +0,0 @@ -## Process this file with automake to produce Makefile.in -# ************************************************************************* -# * GSM TA/ME library -# * -# * File: Makefile.am -# * -# * Purpose: doc Makefile -# * -# * Author: Peter Hofmann (software@pxh.de) -# * -# * Created: 11.6.1999 -# ************************************************************************* - -man_MANS = gsmsmsd.8 gsmctl.1 gsmpb.1 gsmsendsms.1 gsmsmsstore.1 gsminfo.7 - -EXTRA_DIST = gsmsmsd.man gsmctl.man gsmpb.man gsmsendsms.man \ - gsmsmsstore.man gsmlib.lsm gsminfo.man \ - README.NLS README.developers FAQ - -%.1: %.man - sed -e "s/##VERSION##/$(VERSION)/g;s/##DATE##/`date`/g" \ - $< > $@ - -%.7: %.man - sed -e "s/##VERSION##/$(VERSION)/g;s/##DATE##/`date`/g" \ - $< > $@ - -%.8: %.man - sed -e "s/##VERSION##/$(VERSION)/g;s/##DATE##/`date`/g" \ - $< > $@ - -clean-local: - rm -f *.1 *.7 *.8 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/Makefile.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/Makefile.in deleted file mode 100644 index f0f33528e3..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/Makefile.in +++ /dev/null @@ -1,412 +0,0 @@ -# Makefile.in generated by automake 1.6.3 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# ************************************************************************* -# * GSM TA/ME library -# * -# * File: Makefile.am -# * -# * Purpose: doc Makefile -# * -# * Author: Peter Hofmann (software@pxh.de) -# * -# * Created: 11.6.1999 -# ************************************************************************* -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -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 = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ - -EXEEXT = @EXEEXT@ -OBJEXT = @OBJEXT@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -AMTAR = @AMTAR@ -AS = @AS@ -AWK = @AWK@ -BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ -CATOBJEXT = @CATOBJEXT@ -CC = @CC@ -CPP = @CPP@ -CXX = @CXX@ -DATADIRNAME = @DATADIRNAME@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -ECHO = @ECHO@ -GENCAT = @GENCAT@ -GLIBC21 = @GLIBC21@ -GMSGFMT = @GMSGFMT@ -GSM_VERSION = @GSM_VERSION@ -HAVE_LIB = @HAVE_LIB@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INSTOBJEXT = @INSTOBJEXT@ -INTLBISON = @INTLBISON@ -INTLLIBS = @INTLLIBS@ -INTLOBJS = @INTLOBJS@ -INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ -LIB = @LIB@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIB = @LTLIB@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -MKINSTALLDIRS = @MKINSTALLDIRS@ -OBJDUMP = @OBJDUMP@ -PACKAGE = @PACKAGE@ -POSUB = @POSUB@ -RANLIB = @RANLIB@ -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@ - -man_MANS = gsmsmsd.8 gsmctl.1 gsmpb.1 gsmsendsms.1 gsmsmsstore.1 gsminfo.7 - -EXTRA_DIST = gsmsmsd.man gsmctl.man gsmpb.man gsmsendsms.man \ - gsmsmsstore.man gsmlib.lsm gsminfo.man \ - README.NLS README.developers FAQ - -subdir = doc -mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/gsm_config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = - -NROFF = nroff -MANS = $(man_MANS) -DIST_COMMON = Makefile.am Makefile.in -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu doc/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -man1dir = $(mandir)/man1 -install-man1: $(man1_MANS) $(man_MANS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(man1dir) - @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 1*) ;; \ - *) ext='1' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ - done -uninstall-man1: - @$(NORMAL_UNINSTALL) - @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ - rm -f $(DESTDIR)$(man1dir)/$$inst; \ - done - -man7dir = $(mandir)/man7 -install-man7: $(man7_MANS) $(man_MANS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(man7dir) - @list='$(man7_MANS) $(dist_man7_MANS) $(nodist_man7_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.7*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 7*) ;; \ - *) ext='7' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man7dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man7dir)/$$inst; \ - done -uninstall-man7: - @$(NORMAL_UNINSTALL) - @list='$(man7_MANS) $(dist_man7_MANS) $(nodist_man7_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.7*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man7dir)/$$inst"; \ - rm -f $(DESTDIR)$(man7dir)/$$inst; \ - done - -man8dir = $(mandir)/man8 -install-man8: $(man8_MANS) $(man_MANS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(man8dir) - @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.8*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 8*) ;; \ - *) ext='8' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \ - done -uninstall-man8: - @$(NORMAL_UNINSTALL) - @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.8*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \ - rm -f $(DESTDIR)$(man8dir)/$$inst; \ - done -tags: TAGS -TAGS: - -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @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; \ - 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; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(MANS) - -installdirs: - $(mkinstalldirs) $(DESTDIR)$(man1dir) $(DESTDIR)$(man7dir) $(DESTDIR)$(man8dir) - -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-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 -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -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-am - -clean-am: clean-generic clean-libtool clean-local mostlyclean-am - -distclean: distclean-am - -distclean-am: clean-am distclean-generic distclean-libtool - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: install-man - -install-exec-am: - -install-info: install-info-am - -install-man: install-man1 install-man7 install-man8 - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -uninstall-am: uninstall-info-am uninstall-man - -uninstall-man: uninstall-man1 uninstall-man7 uninstall-man8 - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - clean-local distclean distclean-generic distclean-libtool \ - distdir dvi dvi-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-man1 install-man7 \ - install-man8 install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool uninstall \ - uninstall-am uninstall-info-am uninstall-man uninstall-man1 \ - uninstall-man7 uninstall-man8 - - -%.1: %.man - sed -e "s/##VERSION##/$(VERSION)/g;s/##DATE##/`date`/g" \ - $< > $@ - -%.7: %.man - sed -e "s/##VERSION##/$(VERSION)/g;s/##DATE##/`date`/g" \ - $< > $@ - -%.8: %.man - sed -e "s/##VERSION##/$(VERSION)/g;s/##DATE##/`date`/g" \ - $< > $@ - -clean-local: - rm -f *.1 *.7 *.8 -# 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: diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/README.NLS b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/README.NLS deleted file mode 100644 index a5381f6104..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/README.NLS +++ /dev/null @@ -1,72 +0,0 @@ -0 Introduction --------------- - -This version of gsmlib contains national language support (NLS) using -the GNU (or OS-supplied) gettext library. gettext eases the handling -of translations of (usually english) output messages to other -languages by introducing the concept of message catalogs. - -Message catalogs can exist in various formats. The human-readable and --editable format is the PO file format. I have written a PO-file for -the german language (de.po). These human-readable files are then -translated to MO files which can be used by the gettext library. - -Please refer to the GNU gettext documentation (at the time of this -writing gettext-0.10) for further details. - - -1 Compiling gsmlib with localized messages ------------------------------------------- - -Gsmlib is compiled by default with NLS enabled. If you don't want -NLS invoke configure with the option - -./configure --disable-nls - - -2 Adding new message dialogs ----------------------------- - -1. Edit the ALL_LINGUAS line in "source/configure.in" and add your - language, eg. French: - - ALL_LINGUAS="de fr" - -2. Execute "autoconf" to create a new "configure" script (possible - problem: incompatible "autoconf") - -3. Now issue "./configure" in the "sources" directory. - -4. go to the "po" subdirectory - -5. do a "touch fr.po" to create an initially empty PO-file. - -6. do a "make update-po". This extracts all the strings from the files - listed in "POTFILES" and puts them with empty translations into "fr.po" - (it also updates existing po-Files such as "de.po"). - -7. Now use the editor of your choice to provide translations in - "fr.po". There is an emacs major mode (po-mode) that eases this - process. - -8. now issue "make". This causes an "fr.mo" to be created. - - -3 Adding new strings to gsmlib source code ------------------------------------------- - -1. If you add new strings to the gsmlib source code that need - translation enclose them with "_(" and ")" (see gettext documentation - for special cases). - -2. go to the "po" directory. - -3. do a "make update-po". This updates all existing PO-files (removing - obsolete translations, providing new, emptry entries). - -4. Provide translations for the new, empty entries (ideally using - emacs po-mode) - -5. now issue "make". This causes up-to-date MO-files to be created. - - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/README.developers b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/README.developers deleted file mode 100644 index 7fdcc11940..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/README.developers +++ /dev/null @@ -1,138 +0,0 @@ -OVERVIEW - - The GSM library is written in C++ and uses the latest C++ - features: namespaces, exceptions, the standard template library. - - The actual library source code is in the gsmlib subdirectory of - this distribution. The following modules are available: - - gsm_alloca.h OS-specific alloca defines - gsm_at.h Utility classes for AT command sequence handling - gsm_error.h Error codes and error handling functions - gsm_event.h Event handler interface - gsm_me_ta.h Mobile Equipment/Terminal Adapter and SMS functions - (ETSI GSM 07.07 and 07.05) - gsm_parser.h Parser to parse MA/TA result strings - gsm_phonebook.h Phonebook management functions - gsm_port.h Abstract port definition - gsm_sms.h SMS functions (ETSI GSM 07.05) - gsm_sms_codec.h Coder and Encoder for SMS TPDUs - gsm_sms_store.h SMS functions, SMS store (ETSI GSM 07.05) - gsm_sorted_phonebook.h Alphabetically sorted phonebook - (residing in files or in the ME) - gsm_sorted_sms_store.h Sorted SMS store - (sorted by address, time or type) - (residing in files or in the ME) - gsm_unix_serial.h UNIX serial port implementation - gsm_util.h Various utilities - - -REQUIREMENTS - - I have used egcs-1.1.2 and libstdc++.so.2.8.0 for compiling the - library and all programs. Older probably don't work because of - missing features. - - -AVAILABLE DOCUMENTATION - - If you want to do your own programming using the GSM library please - refer to the extensively documented header files or to the example - programs in the test or apps subdirectory. - - I have used the following documentation to develop this software: - - gts_gsm_02.30_v5.2.0.pdf - gts_gsm_03.40_v5.3.0.pdf - gts_gsm_04.11_v5.1.0.pdf - gts_gsm_02.82_v5.0.0.pdf - gts_gsm_03.41_v5.2.0.pdf - gts_gsm_07.05_v5.3.0.pdf - gts_gsm_03.38_v5.3.0.pdf - gts_gsm_04.08_v5.1.0.pdf - gts_gsm_07.07_v5.0.0.pdf - - Due to copyright reasons I cannot include this documentation in - this distribution. You can download it from the ETSI website - (www.etsi.org) for free, though. - - -COMPILATION - - The code is automatically compiled without debugging code enabled - (mostly assert()'s). - - If there are any problems you can generate a debug version - by issuing - - CXXFLAGS="-g" ./configure --disable-shared - - To switch on asserts and additional debugging output change the line - - CXXFLAGS="-DNEBUG $CXXFLAGS" - - in configure.in do - - dnl CXXFLAGS="-DNEBUG $CXXFLAGS" - - Then regenerate configure by executing autoconf. - - You must use at least gcc-2.95.2 to compile gsmlib successfully. - - -TESTS - - The tests directory contains a number of software tests. Two kinds - of test programs are provided: Those, that run without a mobile - phone and those that require a mobile phone to be connected to a - serial port. - - No access to mobile phone needed: - runparser.sh Test the parser for AT responses - runsms.sh Test SMS message encoding and decoding routines - runspb.sh Test sorted phonebook module - runssms.sh Test sorted SMS store module - - Give mobile phone device as argument: - testsms2 Manipulate SMS store in the mobile phone (read/write) - testgsmlib Test the gsm_me_ta module (readonly) - testpb Dump all phonebooks in the mobile phone to the stdout - (readonly) - testpb2 Manipulate phonebook in the mobile phone (read/write) - - The tests that do not require a mobile phone can be executed by - issuing "make check" in the tests subdirectory. The others must be - invoked manually. WARNING: These tests alter the contents of the - mobile phone's phonebook or SMS message memory!!! Make sure, that - you understand what the test does and be prepared for loss of data in - the mobile phone. - -HINTS - - - By default gsmlib is compiled with NDEBUG set. There are lots - of assert()s all over the library that may help to find problems - in programs that use the library. Disable NDEBUG to get best - debugging support. - -CUSTOM BACKENDS - - gsmlib now allows custom backends to be defined for sorted phonebooks - and sorted SMS stores. This can be used to store phonebook entries in - relational databases or LDAP servers. The interfaces are defined in - gsm_sorted_phonebook_base.h and gsm_sorted_sms_store_base.h, - respectively. - - To register a custom backend (eg. for sorted phonebooks) follow - these steps: - - 1. Define a subclass of CustomPhonebookFactory. - - 2. Define a static initializer class in your module that uses the - interface CustomPhonebookRegistry::registerCustomPhonebookFactory() - to make your custom backend available. - - 3. Link your module to any application that should use your custom - backend. The gsmpb and gsmsmsstore programs are prepared to use the - CustomPhonebookRegistry class to obtain your custom backend - objects. - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmctl.man b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmctl.man deleted file mode 100644 index fdd48d3377..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmctl.man +++ /dev/null @@ -1,683 +0,0 @@ -.TH GSMCTL 8 "##DATE##" "gsmctl v##VERSION##" -.SH NAME -gsmctl, gsmsiectl \- GSM mobile phone control program -.SH SYNOPSIS -.B gsmctl -.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 -.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 -phone. -.PP -.B gsmctl -attaches itself to the -.I device -given on the command line (usually an GSM modem) using the specified -.IR baudrate . -If no -.I device -is given, the device -.I /dev/mobilephone -is used. If no -.I baudrate -is given, a default baud rate of 38400 is used. -.PP -.B gsmctl -can be used in to modes: If no -.B \-\-operation -option is given the -.I parameters -specify the status information to be retrieved from -the mobile phone. See the section -.B STATUS INFORMATION -for more details. If an -.B \-\-operation -option is given the requested -.I operation -is performed on the mobile using the -.IR parameters . -See the section -.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 -.TP -.BI \-b\ baudrate ,\ \-\-baudrate\ baudrate -The baud rate to use. Defaults to 38400. -.TP -.BI \-d\ device ,\ \-\-device\ device -The device to which the GSM modem is connected. The default is -.IR /dev/mobilephone . -.TP -.B \-h,\ \-\-help -Prints an option summary. -.TP -.BI \-I\ "init string" ,\ \-\-init\ "init string" -Initialization string to send to the TA (default: "E0"). Note that the -sequence "ATZ" is sent first. -.TP -.BI \-o\ operation ,\ \-\-operation\ operation -This option is used to perform an operation on the mobile phone. Refer -to the section -.B OPERATIONS -for more information on the available -operations and the -.I parameters -required for each operation. -.TP -.B \-v,\ \-\-version -Prints the program version. -.TP -.B \-X,\ \-\-xonxoff -Uses software handshaking (XON/XOFF) for accessing the device. -.SH STATUS INFORMATION -If called without the -.B \-\-operation -option -.B gsmctl -prints out default mobile phone status information as specified by the -.I parameters -described below: -.TP 7 -.B ALL -Prints all available information. -.TP 7 -.B BATT -Prints out information about the current battery status. Two lines of -the form " text" and " charge" are printed. Text may be -of "0 ME is powered by the battery", "1 ME has a battery connected, -but is not powered by it", "2 ME does not have a battery connected", -or "3 Recognized power fault, calls inhibited". Charge is a number in -the range 0..100 where 0 means that the battery is empty or not -connected and 100 means full charge. -.TP 7 -.B BITERR -Prints information about the current bit error rate. The output is of -form " value" where value can be of 0..7, 99 (99 means not -available or not detectable). -.TP 7 -.B CLIP -This option prints a line of the form " on" if caller line -identification is turned on in the network, " off" otherwise. -.TP 7 -.B CSET -Display info about charsets. The output is in the form " -available" and " current", which describes the charsets -available and which is current. -.TP 7 -.B CURROP -Prints information about the current operator. The output line has the -form " Long name: \'xxxx\' Short name: \'yyyy\' Numeric Name: zzzz". -.TP 7 -.B FLCAP -Prints out the two-letter names of available facility locks. The -meaning of standardized facility lock names is as follows: -.RS -.TP 3 -.I CS -Lock control surface (eg. phone keyboard) -.TP 3 -.I PS -Lock phone to SIM card (mobile phone asks password when other than -current SIM card inserted) -.TP 3 -.I SC -Lock SIM card (SIM asks password in mobile phone power-up and when -this lock command issued) -.TP 3 -.I AO -Barr all outgoing calls -.TP 3 -.I OI -Barr outgoing international calls -.TP 3 -.I OX -Barr outgoing international calls except to home country -.TP 3 -.I AI -Barr all incoming calls -.TP 3 -.I IR -Barr incoming calls when roaming outside the home country -.TP 3 -.I NT -Barr incoming calls from numbers not stored to TA memory -.TP 3 -.I NM -Barr incoming calls from numbers not stored to mobile phone memory -.TP 3 -.I NS -Barr incoming calls from numbers not stored to SIM memory -.TP 3 -.I NA -Barr incoming calls from numbers not stored in Any memory -.TP 3 -.I AB -All Barring services (FIXME) -.TP 3 -.I AG -All outGoing barring services (FIXME) -.TP 3 -.I AC -All inComing barring services (FIXME) -.TP 3 -.I FD -SIM fixed dialling memory feature (if PIN2 authentication has not been -done during the current session, PIN2 is required as ) -.PP -Note that mobile phones may implement facility locks not documented -here. -.RE -.TP 7 -.B FLSTAT -Prints information about the status of facility locking in the mobile -phone. For each facility a line of the form " \'facilityname\' -classes" is printed. The classes may be "Voice", "Data", and/or "Fax" -depending on the class for which the facility is enabled. If "unknown" -is printed out this means that the TA is not able to report the -status. If the facility is not enabled for any class, no class -identifier is printed. See -.B FLCAP -for information about the available two-letter names of facility -locks. -.TP 7 -.B FORW -Prints information about call forwarding enabled in the mobile -phone. For each combination of reason (UnconditionalReason, -MobileBusyReason, NoReplyReason, and NotReachableReason) and class -(Voice, Data, and Fax) a line of the form " reason class -number: xxx subaddr: yyy time: zzz" is printed. The time is the number -of seconds to wait before forwarding in case of NoReplyReason. -.TP 7 -.B ME -Prints manufacturer, model, revision, and serial number of -the mobile phone (ME = mobile equipment). Output lines are numbered from -"" to "". -.TP 7 -.B OP -Prints information about the currently available mobile network -operators. For each operator an output line of the form " status -Long name: \'xxxx\' Short name: \'yyyy\' Numeric name: zzz" is returned -where status may be of: -.RS -.TP 10 -.I unknown -The status of the operator is unknown. -.TP -.I current -This is the currently selected operator. -.TP -.I available -This operator is available for selection. -.TP -.I forbidden -This operator is not available for selection, ie. not -accessible with this SIM card. -.RE -.TP 7 -.B PIN -Prints information about the current PIN status. The output is of -form " status". Where status can be one of the following lines: -.RS -.TP 10 -.I READY -ME is not pending for any password. -.TP -.I SIM PIN -ME is waiting SIM PIN to be given. -.TP -.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. -.TP -.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 -given. -.TP -.I SIM PIN2 -ME is waiting SIM PIN2 to be given. -.TP -.I SIM PUK2 -ME is waiting SIM PUK2 to be given. -.TP -.I PH/-NET PIN -ME is waiting network personalisation password to be given. -.TP -.I PH/-NET PUK -ME is waiting network personalisation unblocking password to be given. -.TP -.I PH/-NETSUB PIN -ME is waiting network subset personalisation password to be given. -.RE -.TP 7 -.B PW -Facilities in the mobile phone may be protected by passwords (ie. PINs -or PUKs). This option prints out lines of the form " -\'facilityname\' len" for each facility for which a facility lock -password exists. See -.B FLCAP -for information about the available two-letter names of facility -locks. -.TP 7 -.B SCA -Reports the default SMS service centre address currently set in the -mobile phone. -.TP 7 -.B SIG -Prints information about the current network signal -strength. The output is of the form " value". Following values -are possible: -.TP -.po +7 -.I 0 --113 dBm or less -.TP -.I 1 --111 dBm -.TP -.I 2...30 --109... -53 dBm (in steps of 2 dBm) -.TP -.I 31 --51 dBm or greater -.TP -.I 99 -not known or not detectable -.PP -.po -.SH OPERATIONS -.TP -.BI dial\ number -Dials -.IR number . -After dialling -.B gsmctl -waits for a keypress to terminate. -.PP -.B forw -.IR mode\ reason\ number\ [\| facilityclass\| ]\ [ forwardtime ] -.RS -Changes the call forwarding behaviour in the network. -.I mode -can be any of: -.RS 3 -.I disable -Call forwarding is disabled. -.PP -.I enable -Call forwarding is enabled. The call forwarding reason, number, and -(optionally) forwardtime must be registered beforehand. -.PP -.I register -This registers the call forwarding reason, number, and forwardtime in -the network. -.PP -.I erase -This is the counterpart to register. It erase the call forwarding info -in the network. -.RE -.PP -.I reason -can be any of: -.RS 3 -.I unconditional -This applies to every call. -.PP -.I mobilebusy -The mobile phone is busy. -.PP -.I noreply -The call is not answered in \fIforwardtime\fP seconds. -.PP -.I notreachable -Mobile phone cannot be reached (ie. switched off). -.PP -.I all -This refers to all forwarding reasons. -.PP -.I allconditional -This refers to all conditional forward reasons -.RI ( mobilebusy ,\ noreply ,\ notreachable ). -.RE -.PP -.I number -is the number the incoming call is forwarded to. See the explanation -for -.I lock -operation for the meaning of -.IR facilityclass . -The default for -.I forwardtime -is 20 seconds if omitted. -.I forwardtime -can be in the range 1..30. -.RE -.PP -.TP -.BI off -Sets functionality level of the phone to 0 (low functionality). The -effects of this command depend on the phone (eg. sets low power -consumption). -.PP -.TP -.BI on -Sets functionality level of the phone to 1 (high functionality). The -effects of this command depend on the phone. -.PP -.TP -.BI pin\ pin -Sets PIN code. Use -.BI gsmctl\ pin -to get the current pin status. -.PP -.B lock -.IR facility\ [\| facilityclass \|]\ [\| passwd \|] -.RS -Locks the named facility. Use -.BI gsmctl\ flcap -to get a list of supported facilities. The -.I facilityclass -can be any of: -.RS 3 -.I all -Voice, data, and fax. -.PP -.I v\ vf\ vd\ f\ fd\ d -Any combination of voice, data and fax. -.RE -.PP -The default is \fIall\fP if \fIfacilityclass\fP is omitted. The -\fIpasswd\fP is password for the facility. If no password is given -this parameter can be omitted. -.RE -.PP -.BI setop\ opmode\ numericname -.RS -Sets the current operator to -.IR numericname . -Use -.BI gsmctl\ op -to get a list of operators with their numeric codes. -.I opmode -can be any of: -.RS 3 -.I automatic -.PP -.I manual -.PP -.I deregister -Deregister from network. -.PP -.I manualautomatic -If manual selection fails, automatic mode is entered. -.RE -.RE -.PP -.B setpw -.IR facility\ [\| oldpasswd\| ]\ [\| newpasswd\| ] -.RS -Sets the password for the facility. If one of the passwords is omitted -this means that the facility has no password protection. Passwords are -PIN1, PIN2, PUK etc. -.RE -.TP -.BI setsca\ service\ centre\ address -Sets the default SMS service centre address. -.PP -.B unlock -.IR facility\ [\| facilityclass\| ]\ [ \|passwd\| ] -.RS -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 -prints out all available status information for the mobile phone -connected to -.B /dev/mobilephone -.PP -.nf -.IP "" 3 -gsmctl all -.fi -.PP -The output could look like (lines edited to fit): -.RS 3 -.PP -.PD 0 - Manufacturer: SIEMENS -.HP - Model: S10 -.HP - Revision: 06 -.HP - Serial Number: 448058511817585 -.HP - 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 -.HP - 'CS' -.HP - 'PS' -.HP - 'SC' Voice Data Fax -.HP - 'AO' -.HP - 'OI' -.HP - 'OX' -.HP - 'AI' -.HP - 'IR' -.HP - 'CS' 'PS' 'SC' 'AO' 'OI' 'OX' 'AI' 'IR' 'AB' 'AG' 'AC' -.HP - 'PS' 8 -.HP - 'SC' 8 -.HP - 'AO' 4 -.HP - 'OI' 4 -.HP - 'OX' 4 -.HP - 'AI' 4 -.HP - 'IR' 4 -.HP - 'AB' 4 -.HP - 'AG' 4 -.HP - 'AC' 4 -.HP - on -.HP - UnconditionalReason Voice inactive number: subaddr: time: -1 -.HP - UnconditionalReason Data inactive number: subaddr: time: -1 -.HP - UnconditionalReason Fax inactive number: subaddr: time: -1 -.HP - MobileBusyReason Voice active number: +494012345678 subaddr: time: -1 -.HP - MobileBusyReason Data inactive number: subaddr: time: -1 -.HP - MobileBusyReason Fax inactive number: subaddr: time: -1 -.HP - NoReplyReason Voice active number: +494012345678 subaddr: time: 20 -.HP - NoReplyReason Data inactive number: subaddr: time: -1 -.HP - NoReplyReason Fax inactive number: subaddr: time: -1 -.HP - NotReachableReason Voice active number: +494012345678 subaddr: time: -1 -.HP - NotReachableReason Data inactive number: subaddr: time: -1 -.HP - NotReachableReason Fax inactive number: subaddr: time: -1 -.HP - 0 ME is powered by the battery -.HP - 100 -.HP - 0 -.HP - 19 -.RE -.PD -.PP -The following locks the keys on the mobile phone: -.nf -.IP "" 3 -gsmctl -o lock cs -.fi -.PP -This changes the SIM card PIN from 1234 to 2345: -.nf -.IP "" 3 -gsmctl -o setpw sc 1234 2345 -.fi -.PP -Switch off all call forwarding (actually erase the numbers): -.nf -.IP "" 3 -gsmctl -o forw erase all -.fi -.PP -Switch on call forwarding to German D1 voice box: -.nf -.IP "" 3 -gsmctl -o forw register notreachable 3313 -gsmctl -o forw enable notreachable -.fi -.PP -.SH FILES -.TP -.B /dev/mobilephone -Default mobile phone device. -.SH AUTHOR -Peter Hofmann -.SH BUGS -Report bugs to software@pxh.de. Include a complete, self-ncontained -example that will allow the bug to be reproduced, and say which -version of \fIgsmctl\fP you are using. -.SH COPYRIGHT -Copyright \(co 1999 Peter Hofmann -.PP -.B gsmctl -is free software; you can redistribute it and/or modify it under the -terms of the GNU Library General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. -.PP -.B gsmctl -is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public -License for more details. -.PP -You should have received a copy of the GNU Library General Public -License along with -.BR gsmctl ; -see the file COPYING. If not, write to the Free Software Foundation, -675 Mass Ave, Cambridge, MA 02139, USA. -.SH "SEE ALSO" -.BR gsminfo (7), -.BR gsmpb (1), -.BR gsmsendsms (1), -.BR gsmsmsd (8), -.BR gsmsmsstore (1). - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsminfo.man b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsminfo.man deleted file mode 100644 index 7939502779..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsminfo.man +++ /dev/null @@ -1,56 +0,0 @@ -.\" -*- 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 GSMINFO 7 "##DATE##" "gsmctl v##VERSION##" -.PP -.SH NAME -gsminfo \- GSM general information -.PP -.SH DESCRIPTION -\fIgsmlib\fP is a library to access GSM mobile phones through GSM -modems or via IrDA devices. In the \fIgsmlib\fP documentation and error -messages the following abbreviations are used: -.TP .7i -\fBME\fP -Mobile Equipment. The mobile phone, usually. -.TP .7i -\fBSC\fP -Service Centre. In the context of this documentation, the center -responsible for sending and relaying SMs. -.TP .7i -\fBSM\fP -Short Message. -.TP .7i -\fBSME\fP -Short Message Equipment. Usually the mobile phone. -.TP .7i -\fBTA\fP -Terminal Adapter. This can be a GSM modem PC card or it can be -integrated into the ME. -.TP .7i -\fBTE\fP -Terminal Equipment. This is the device to which the TA is connected, -usually the computer. -.PP -.SH AUTHOR -Peter Hofmann -.PP -.SH COPYRIGHT -Copyright \(co 1999 Peter Hofmann -.PP -.SH "SEE ALSO" -.BR gsmctl(1), -.BR gsmpb(1), -.BR gsmsendsms(1), -.BR gsmsmsd(8), -.BR gsmsmsstore(1). - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmlib.lsm b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmlib.lsm deleted file mode 100644 index 6056b88eed..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmlib.lsm +++ /dev/null @@ -1,20 +0,0 @@ -Begin3 -Title: gsmlib -Version: 1.0 -Entered-date: 29JUL99 -Description: This distribution contains a library to access - GSM mobile phones through GSM modems. Features include: - * modification of phonebooks 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 - Additionally, some simple command line programs are - provided to use these functionalities. -Keywords: gsm mobile phone modem sms -Author: Peter Hofmann -Maintained-by: Peter Hofmann -Primary-site: http://www.pxh.de/fs/gsmlib/ -Platforms: Linux -Copying-policy: LGPL -End diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmpb.man b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmpb.man deleted file mode 100644 index fef171e0aa..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmpb.man +++ /dev/null @@ -1,245 +0,0 @@ -.\" -*- 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 GSMPB 8 "##DATE##" "gsmpb v##VERSION##" -.SH NAME -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 ] -.PP -.SH DESCRIPTION -\fIgsmpb\fP can store or retrieve phonebook entries residing in a GSM -mobile phone's phonebook to or from a file. A synchronization mode is -also available. -.PP -\fIgsmpb\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. \fIgsmpb\fP writes phonebook -entries to a destination file or device. Depending on the mode the -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 -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 -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 -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. -.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 -The baud rate to use. The default baudrate is 38400. -.TP .7i -\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 -The destination device or file. -.TP .7i -\fB\-h\fP, \fB\-\-help\fP -Prints an option summary. -.TP .7i -\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 -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 -phonebook file or to change the position of entries by editing a -phonebook file and writing them back to the mobile phone. -If this option is given the phonebook file used as the source -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 -The name of the phonebook to read from or write to. This is only used -for device sources and destinations. Commonly available phonebooks -are: -.TP .3i -.po +0.7i -.ll 5.8i -\fIFD\fP -SIM fixdialling\-phonebook -.TP .3i -\fILD\fP -SIM last\-dialling\-phonebook -.TP .3i -\fIME\fP -ME phonebook -.TP .3i -\fIMT\fP -combined ME and SIM phonebook -.TP .3i -\fISM\fP -SIM phonebook -.TP .3i -\fITA\fP -TA phonebook -.TP .7i -.po -0.7i -.ll 6.5i -\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 -Set the character set to use for phonebook operations (default is the -GSM default alphabet). -.TP -\fB\-v\fP, \fB\-\-version\fP -Prints the program version. -.TP .7i -\fB\-V\fP, \fB\-\-verbose\fP -Prints out a detailed progress report. -.TP .7i -\fB\-X\fP, \fB\-\-xonxoff\fP -Uses software handshaking (XON/XOFF) for accessing the device. -.TP .7i -\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 -.po +0.7i -.ll 5.8i -\- -If the source contains an entry with a name that does not exist in the -destination this entry is added to the destination. -.TP .2i -\- -If the source contains an entry with a name that can also be found in -the destination, the entry in the destination is overwritten (ie. the -telephone number is updated). Exception: More then one entry with the -name exists in the destination. In this case the new entry ist just added. -.TP .2i -\- -Entries in the destination that do not exist in the source are -deleted. -.PP -Note that synchronization has the following properties that differ -from copying: This algorithm does not change the location of unchanged -entries in the destination phonebook. The synchronization function -is not case-sensitive when comparing names. -.PP -.po -0.7i -.ll 6.5i -.SH PHONEBOOK FILE FORMAT -Phonebook entries are stored in phonebook files that are meant to be -human-readable and -editable. There is one phonebook entry per line, -and each line has the format: -.PP -.nf -index|text|phone number -.fi -.PP -The fields have the following meanings: -.TP .7i -\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 -the mobile phone. -.TP .7i -\fItext\fP -Descriptive text for the entry. The text may contain the special -characters '\\', '|', carriage return (ASCII code 13), or line feed -(ASCII code 10). These must be written "\\\\", "\\|", "\\r", "\\n", -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 '+' -sign denotes an international number. -.PP -.SH EXAMPLES -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" -.fi -.PP -.SH AUTHOR -Peter Hofmann -.PP -.SH BUGS -Report bugs to software@pxh.de. Include a complete, self-contained -example that will allow the bug to be reproduced, and say which -version of \fIgsmpb\fP you are using. -.PP -.SH COPYRIGHT -Copyright \(co 1999 Peter Hofmann -.LP -\fIgsmpb\fP is free software; you can redistribute it and/or modify it under -the terms of the GNU Library General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. -.LP -\fIgsmpb\fP is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License -for more details. -.LP -You should have received a copy of the GNU Library General Public License along -with \fIgsmpb\fP; see the file COPYING. If not, write to the Free Software -Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -.PP -.SH "SEE ALSO" -.BR gsminfo(7), -.BR gsmctl(1), -.BR gsmsendsms(1), -.BR gsmsmsd(8), -.BR gsmsmsstore(1). - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmsendsms.man b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmsendsms.man deleted file mode 100644 index d3c8a9c395..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmsendsms.man +++ /dev/null @@ -1,154 +0,0 @@ -.\" -*- 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 GSMSENDSMS 8 "##DATE##" "gsmsendsms v##VERSION##" -.PP -.SH NAME -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 ] -\fIphonenumber\fP -[ \fItext\fP ] -.PP -.SH DESCRIPTION -\fIgsmsendsms\fP sends SMS short messages using an GSM mobile phone. -.PP -\fIgsmsendsms\fP attaches itself to the \fIdevice\fP given on the command -line (usually an GSM modem) using the specified \fIbaudrate\fP. If no -\fIdevice\fP is given, the device \fI/dev/mobilephone\fP is used. If -no \fIbaudrate\fP is given, a default baud rate of 38400 is used. -.PP -\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 -that can not be encoded using the GSM default alphabet are converted -to the GSM delta character (GSM code 16). -.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 -\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 -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 -be in the range 0..255. Not all receiving phones will support -concatenated SMSs (and display them as separate SMSs), -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 -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 -The device to which the GSM modem is connected. The default is -\fI/dev/mobilephone\fP. -.TP -\fB\-h\fP, \fB\-\-help\fP -Prints an option summary. -.TP -\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 -Request status reports for sent SMS. -.TP -\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 -default alphabet. Characters that can not be converted to the GSM default -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 -Prints the program version. -.TP -\fB\-X\fP, \fB\-\-xonxoff\fP -Uses software handshaking (XON/XOFF) for accessing the device. -.PP -.SH EXAMPLES -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 -.fi -.PP -.SH FILES -.TP 1.4i -.B /dev/mobilephone -Default mobile phone device. -.PP -.SH AUTHOR -Peter Hofmann -.PP -.SH BUGS -Report bugs to software@pxh.de. Include a complete, self-contained -example that will allow the bug to be reproduced, and say which -version of \fIgsmsendsms\fP you are using. -.PP -.SH COPYRIGHT -Copyright \(co 1999 Peter Hofmann -.LP -\fIgsmsendsms\fP is free software; you can redistribute it and/or modify it under -the terms of the GNU Library General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. -.LP -\fIgsmsendsms\fP is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. -.LP -You should have received a copy of the GNU Library General Public License along -with \fIgsmsendsms\fP; see the file COPYING. If not, write to the Free Software -Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -.PP -.SH "SEE ALSO" -.BR gsminfo(7), -.BR gsmpb(1), -.BR gsmctl(1), -.BR gsmsmsd(8), -.BR gsmsmsstore(1). - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmsmsd.man b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmsmsd.man deleted file mode 100644 index 89e9c95f39..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmsmsd.man +++ /dev/null @@ -1,269 +0,0 @@ -.\" -*- 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 GSMSMSD 8 "##DATE##" "gsmsmsd v##VERSION##" -.PP -.SH NAME -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 ] -{ \fIsms_type\fP } -.PP -.SH DESCRIPTION -\fIgsmsmsd\fP reads new incoming SMS from the mobile phone and -dispatches them to a user-defined action. Additionally it can send SMS -message that it reads from a spooldir. -.PP -\fIgsmsmsd\fP attaches itself to the \fIdevice\fP given on the command -line (usually an GSM modem) using the specified \fIbaudrate\fP and -waits for incoming SMS messages. If no \fIdevice\fP is given, the -device \fI/dev/mobilephone\fP is used. If no \fIbaudrate\fP is given, a -default baud rate of 38400 is used. -.PP -If no action is given, the SMS message is printed to the standard -output. If an \fIaction\fP is specified the \fIaction\fP is excecuted using the -shell and the SMS message is written to the standard input of the action. -.PP -\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. -.PP -To terminate \fIgsmsmsd\fP cleanly (without losing SMS messages) one -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 -terminates on error the error code 1 is returned. -.PP -\fIsms_type\fP may be any combination of: -.TP -\fIsms\fP, \fIno_sms\fP -Controls reception of normal SMS messages. -.TP -\fIcb\fP, \fIno_cb\fP -Controls reception of cell broadcast messages. -.TP -\fIstat\fP, \fIno_stat\fP -Controls reception of status reports. -.PP -The default is \fIsms\fP, \fIcb\fP, and \fIstat\fP. -.PP -.SH OPTIONS -.TP -\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 -The baud rate to use. -.TP -\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 -be in the range 0..255. This number is increased by one for every -outgoing concatenated SMS and wraps around after 255. -Not all receiving phones will support -concatenated SMSs (and display them as separate SMSs), -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 -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 -The device to which the GSM modem is connected. The default is -\fI/dev/mobilephone\fP. -.TP -\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 -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 -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 -Prints an option summary. -.TP -\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 -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 -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 -the first line is interpreted as the SMS text. Please refer to -.BR gsmsendsms(1) -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) -or write to (for temporary SMS storage). This option must -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 -Prints the program version. -.TP -\fB\-X\fP, \fB\-\-xonxoff\fP -Uses software handshaking (XON/XOFF) for accessing the device. -.PP -.SH EXAMPLES -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" -.fi -.PP -This is the format of SMS deliver messages as output from \fIgsmsmsd\fP: -.PP -.nf ----------------------------------------------------------------- -Message type: SMS\-DELIVER -SC address: '491710762100' -More messages to send: 1 -Reply path: 0 -User data header indicator: 0 -Status report indication: 0 -Originating address: '01805000102' -Protocol identifier: 0x39 -Data coding scheme: default alphabet -SC timestamp: 17.12.98 14:10:55(+0100) -User data length: 159 -User data header: 0x -User data: 'Nicht vergessen! Die XtraWeihnachtsverlosung lauft -noch bis zum 24.12. Nutzen Sie jetzt Ihre Gewinnchance und faxen -Sie Ihren Teiln.-Gutschein an 0180/5000 056' ----------------------------------------------------------------- -.fi -.PP -This is the format of SMS status report messages as output from \fIgsmsmsd\fP: -.PP -.nf ----------------------------------------------------------------- -Message type: SMS\-STATUS\-REPORT -SC address: '' -More messages to send: 0 -Status report qualifier: 0 -Message reference: 0 -Recipient address: '' -SC timestamp: 00.00.00 00:00:00(+0000) -Discharge time: 00.00.00 00:00:00(+0000) -Status: 0x0 'Short message received by the SME' ----------------------------------------------------------------- -.fi -.PP -The following invocation of \fIgsmsmsd\fP flushes all existing -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' -.fi -.PP -.SH FILES -.TP 1.4i -.B /dev/mobilephone -Default mobile phone device. -.PP -.SH AUTHOR -Peter Hofmann -.PP -.SH BUGS -Cell broadcast SMS message reception has not been tested, but it has -been enabled in the \fIgsmsmsd\fP daemon. -.PP -The mobile phone device is blocked when the \fIgsmsmsd\fP daemon is -running, ie. it cannot be used for data transfer or from the other -programs of this suite (\fIgsmpb\fP, \fIgsmsms\fP). -.PP -Report bugs to software@pxh.de. Include a complete, self-contained -example that will allow the bug to be reproduced, and say which -version of \fIgsmsmsd\fP you are using. -.PP -.SH COPYRIGHT -Copyright \(co 1999 Peter Hofmann -.LP -\fIgsmsmsd\fP is free software; you can redistribute it and/or modify it under -the terms of the GNU Library General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. -.LP -\fIgsmsmsd\fP is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. -.LP -You should have received a copy of the GNU Library General Public License along -with \fIgsmsmsd\fP; see the file COPYING. If not, write to the Free Software -Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -.PP -.SH "SEE ALSO" -.BR gsminfo(7), -.BR gsmpb(1), -.BR gsmctl(1), -.BR gsmsendsms(1), -.BR gsmsmsstore(1). - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmsmsstore.man b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmsmsstore.man deleted file mode 100644 index fb3fb9bc7f..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/doc/gsmsmsstore.man +++ /dev/null @@ -1,185 +0,0 @@ -.\" -*- 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 GSMSMSSTORE 8 "##DATE##" "gsmsmsstore v##VERSION##" -.SH NAME -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 ] -{ \fIindices\fP } -[ \fIphonenumber\fP \fItext\fP ] -.PP -.SH DESCRIPTION -\fIgsmsmsstore\fP can store or retrieve SMS messages entries residing -in a GSM mobile phone's SMS store to or from a file, add SMS messages -to a store, or list the store's contents. Additionally, it is possible -to add SMS submit messages to a store. -.PP -\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. -.PP -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 -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 -and/or written to standard output, respectively. -.PP -SMS message files are not human-readable. -.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 -\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 -The baud rate to use. The default baudrate is 38400. -.TP -\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 -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 -The destination device or file. -.TP -\fB\-h\fP, \fB\-\-help\fP -Prints an option summary. -.TP -\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 -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 -Prints out the entire contents of the source in human-readable form. -.TP -\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 -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 -Prints the program version. -.TP -\fB\-V\fP, \fB\-\-verbose\fP -Prints out a detailed progress report. -.TP -\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 -Uses software handshaking (XON/XOFF) for accessing the device. -.PP -.SH EXAMPLES -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 -.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 -.fi -.PP -.SH AUTHOR -Peter Hofmann -.PP -.SH BUGS -Report bugs to software@pxh.de. Include a complete, self-contained -example that will allow the bug to be reproduced, and say which -version of \fIgsmsmsstore\fP you are using. -.PP -.SH COPYRIGHT -Copyright \(co 1999 Peter Hofmann -.LP -\fIgsmsmsstore\fP is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2, or (at -your option) any later version. -.LP -\fIgsmsmsstore\fP is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. -.LP -You should have received a copy of the GNU Library General Public License -along with \fIgsmsmsstore\fP; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -.PP -.SH "SEE ALSO" -.BR gsminfo(7), -.BR gsmctl(1), -.BR gsmpb(1), -.BR gsmsendsms(1), -.BR gsmsmsd(8). diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/Makefile.am b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/Makefile.am deleted file mode 100644 index 1c1d2fc3ce..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/Makefile.am +++ /dev/null @@ -1,40 +0,0 @@ -## Process this file with automake to produce Makefile.in -# ************************************************************************* -# * GSM TA/ME library -# * -# * File: Makefile.am -# * -# * Purpose: Makefile for phone-specific extensions -# * -# * Author: Peter Hofmann (software@pxh.de) -# * -# * Created: 16.12.2001 -# ************************************************************************* - -INCLUDES = -I.. - -EXTRA_DIST = README.sieme - -# build addon library -lib_LTLIBRARIES = libgsmext.la - -libgsmext_la_SOURCES = gsm_sie_me.cc - -libgsmext_la_LDFLAGS = -version-info $(GSM_VERSION) - -gsmincludedir = $(includedir)/gsmlib - -gsminclude_HEADERS = gsm_sie_me.h - -# build programs -bin_PROGRAMS = gsmsiectl gsmsiexfer - -# build gsmsiectl from gsmsiectl.cc and libgsmme.la -gsmsiectl_SOURCES = gsmsiectl.cc -gsmsiectl_LDADD = ../gsmlib/libgsmme.la libgsmext.la $(INTLLIBS) - -# build gsmsiexfer from gsmsiexfer.cc and libgsmme.la -gsmsiexfer_SOURCES = gsmsiexfer.cc -gsmsiexfer_LDADD = ../gsmlib/libgsmme.la libgsmext.la $(INTLLIBS) - - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/Makefile.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/Makefile.in deleted file mode 100644 index 42240fb530..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/Makefile.in +++ /dev/null @@ -1,480 +0,0 @@ -# Makefile.in generated by automake 1.6.3 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# ************************************************************************* -# * GSM TA/ME library -# * -# * File: Makefile.am -# * -# * Purpose: Makefile for phone-specific extensions -# * -# * Author: Peter Hofmann (software@pxh.de) -# * -# * Created: 16.12.2001 -# ************************************************************************* -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -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 = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ - -EXEEXT = @EXEEXT@ -OBJEXT = @OBJEXT@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -AMTAR = @AMTAR@ -AS = @AS@ -AWK = @AWK@ -BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ -CATOBJEXT = @CATOBJEXT@ -CC = @CC@ -CPP = @CPP@ -CXX = @CXX@ -DATADIRNAME = @DATADIRNAME@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -ECHO = @ECHO@ -GENCAT = @GENCAT@ -GLIBC21 = @GLIBC21@ -GMSGFMT = @GMSGFMT@ -GSM_VERSION = @GSM_VERSION@ -HAVE_LIB = @HAVE_LIB@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INSTOBJEXT = @INSTOBJEXT@ -INTLBISON = @INTLBISON@ -INTLLIBS = @INTLLIBS@ -INTLOBJS = @INTLOBJS@ -INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ -LIB = @LIB@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIB = @LTLIB@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -MKINSTALLDIRS = @MKINSTALLDIRS@ -OBJDUMP = @OBJDUMP@ -PACKAGE = @PACKAGE@ -POSUB = @POSUB@ -RANLIB = @RANLIB@ -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@ - -INCLUDES = -I.. - -EXTRA_DIST = README.sieme - -# build addon library -lib_LTLIBRARIES = libgsmext.la - -libgsmext_la_SOURCES = gsm_sie_me.cc - -libgsmext_la_LDFLAGS = -version-info $(GSM_VERSION) - -gsmincludedir = $(includedir)/gsmlib - -gsminclude_HEADERS = gsm_sie_me.h - -# build programs -bin_PROGRAMS = gsmsiectl gsmsiexfer - -# build gsmsiectl from gsmsiectl.cc and libgsmme.la -gsmsiectl_SOURCES = gsmsiectl.cc -gsmsiectl_LDADD = ../gsmlib/libgsmme.la libgsmext.la $(INTLLIBS) - -# build gsmsiexfer from gsmsiexfer.cc and libgsmme.la -gsmsiexfer_SOURCES = gsmsiexfer.cc -gsmsiexfer_LDADD = ../gsmlib/libgsmme.la libgsmext.la $(INTLLIBS) -subdir = ext -mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/gsm_config.h -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(lib_LTLIBRARIES) - -libgsmext_la_LIBADD = -am_libgsmext_la_OBJECTS = gsm_sie_me.lo -libgsmext_la_OBJECTS = $(am_libgsmext_la_OBJECTS) -bin_PROGRAMS = gsmsiectl$(EXEEXT) gsmsiexfer$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) - -am_gsmsiectl_OBJECTS = gsmsiectl.$(OBJEXT) -gsmsiectl_OBJECTS = $(am_gsmsiectl_OBJECTS) -gsmsiectl_DEPENDENCIES = ../gsmlib/libgsmme.la libgsmext.la -gsmsiectl_LDFLAGS = -am_gsmsiexfer_OBJECTS = gsmsiexfer.$(OBJEXT) -gsmsiexfer_OBJECTS = $(am_gsmsiexfer_OBJECTS) -gsmsiexfer_DEPENDENCIES = ../gsmlib/libgsmme.la libgsmext.la -gsmsiexfer_LDFLAGS = - -DEFS = @DEFS@ -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/gsm_sie_me.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/gsmsiectl.Po ./$(DEPDIR)/gsmsiexfer.Po -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -CXXFLAGS = @CXXFLAGS@ -DIST_SOURCES = $(libgsmext_la_SOURCES) $(gsmsiectl_SOURCES) \ - $(gsmsiexfer_SOURCES) -HEADERS = $(gsminclude_HEADERS) - -DIST_COMMON = $(gsminclude_HEADERS) Makefile.am Makefile.in -SOURCES = $(libgsmext_la_SOURCES) $(gsmsiectl_SOURCES) $(gsmsiexfer_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .cc .lo .o .obj -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu ext/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -libLTLIBRARIES_INSTALL = $(INSTALL) -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(libdir) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ - else :; fi; \ - done - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test -z "$dir" && dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libgsmext.la: $(libgsmext_la_OBJECTS) $(libgsmext_la_DEPENDENCIES) - $(CXXLINK) -rpath $(libdir) $(libgsmext_la_LDFLAGS) $(libgsmext_la_OBJECTS) $(libgsmext_la_LIBADD) $(LIBS) -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - || test -f $$p1 \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \ - else :; fi; \ - done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ - rm -f $(DESTDIR)$(bindir)/$$f; \ - done - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -gsmsiectl$(EXEEXT): $(gsmsiectl_OBJECTS) $(gsmsiectl_DEPENDENCIES) - @rm -f gsmsiectl$(EXEEXT) - $(CXXLINK) $(gsmsiectl_LDFLAGS) $(gsmsiectl_OBJECTS) $(gsmsiectl_LDADD) $(LIBS) -gsmsiexfer$(EXEEXT): $(gsmsiexfer_OBJECTS) $(gsmsiexfer_DEPENDENCIES) - @rm -f gsmsiexfer$(EXEEXT) - $(CXXLINK) $(gsmsiexfer_LDFLAGS) $(gsmsiexfer_OBJECTS) $(gsmsiexfer_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm_sie_me.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsmsiectl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsmsiexfer.Po@am__quote@ - -distclean-depend: - -rm -rf ./$(DEPDIR) - -.cc.o: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -.cc.obj: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CXXCOMPILE) -c -o $@ `cygpath -w $<` - -.cc.lo: -@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< -CXXDEPMODE = @CXXDEPMODE@ - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -gsmincludeHEADERS_INSTALL = $(INSTALL_HEADER) -install-gsmincludeHEADERS: $(gsminclude_HEADERS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(gsmincludedir) - @list='$(gsminclude_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(gsmincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(gsmincludedir)/$$f"; \ - $(gsmincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(gsmincludedir)/$$f; \ - done - -uninstall-gsmincludeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(gsminclude_HEADERS)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " rm -f $(DESTDIR)$(gsmincludedir)/$$f"; \ - rm -f $(DESTDIR)$(gsmincludedir)/$$f; \ - 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; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - 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; } \ - 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 - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @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; \ - 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; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) -install-binPROGRAMS: install-libLTLIBRARIES - - -installdirs: - $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) $(DESTDIR)$(gsmincludedir) - -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-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 -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -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-am - -clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool mostlyclean-am - -distclean: distclean-am - -distclean-am: clean-am distclean-compile distclean-depend \ - distclean-generic distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: install-gsmincludeHEADERS - -install-exec-am: install-binPROGRAMS install-libLTLIBRARIES - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -uninstall-am: uninstall-binPROGRAMS uninstall-gsmincludeHEADERS \ - uninstall-info-am uninstall-libLTLIBRARIES - -.PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libLTLIBRARIES clean-libtool distclean \ - distclean-compile distclean-depend distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am info \ - info-am install install-am install-binPROGRAMS install-data \ - install-data-am install-exec install-exec-am \ - install-gsmincludeHEADERS install-info install-info-am \ - install-libLTLIBRARIES install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool tags uninstall \ - uninstall-am uninstall-binPROGRAMS uninstall-gsmincludeHEADERS \ - uninstall-info-am uninstall-libLTLIBRARIES - -# 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: diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/README.sieme b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/README.sieme deleted file mode 100644 index 4305ae33a2..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/README.sieme +++ /dev/null @@ -1,75 +0,0 @@ -Extended support for Siemens mobile phones via gsmlib ------------------------------------------------------ - -* Hardware: - -Supported phones: S25, S35, S45, ME45, SL45 -Tested phones: S45, ME45 - -* Feature list: - - - ACM: Output ACM (accumulated call meter) and ACMmax => maybe not - - - BNR/BNW: Binary read and write => yes, xfer - - - CID: Output card ID => maybe - - - CKS: Output SIM card status => maybe - - - CNI: Output call number information => maybe - - - DBR: Database Read => yes, phonebook - - - DLD: Delete the "last number redial" memory => maybe dangerous? - - - GAUTH: Select Type of Authentication for PPP => no - - - ICO: Icon control => no - - - LCK: Switch locks on and off => yes, lock/unlock - - - LNG: Language settings => maybe - - - MGL: List SMS => no - - - MGO: SMS overflow indicator => no - - - MGR: Read SMS (same as AT+CMGR) => no - - - MSO: Switch device off => maybe not - - - NFS: Select NF hardware => maybe - - - NFV: Set the volume => maybe - - - PBC: Seek in telephone book => no - - - PBG: Sorted telephone book => yes - - - PBS: Select a telephone book => yes - - - PIC: Output PIN counter => maybe - - - PLM: Read the PLMN list => yes - - - PLR/PLW: read/write preferred-operator list => yes - - - PST: Play Signal Tone => yes - - - PWD: Change password to a lock => maybe - - - RTC: Set the ringing tone => yes - - - STK: SIM toolkit => no - - -* Additional References - -http://www.s45-world.net/vissie.htm - - -* Author and contact - -Christian W. Zuckschwerdt -http://triq.net/gsm.html - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsm_sie_me.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsm_sie_me.cc deleted file mode 100644 index fb22260836..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsm_sie_me.cc +++ /dev/null @@ -1,258 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_sie_me.cc -// * -// * Purpose: Mobile Equipment/Terminal Adapter and SMS functions -// * (According to "AT command set for S45 Siemens mobile phones" -// * v1.8, 26. July 2001 - Common AT prefix is "^S") -// * -// * Author: Christian W. Zuckschwerdt -// * -// * Created: 2001-12-15 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -// SieMe members - -void SieMe::init() throw(GsmException) -{ -} - -SieMe::SieMe(Ref port) throw(GsmException) : MeTa::MeTa(port) -{ - // initialize Siemens ME - - init(); -} - -vector SieMe::getSupportedPhonebooks() throw(GsmException) -{ - Parser p(_at->chat("^SPBS=?", "^SPBS:")); - return p.parseStringList(); -} - -string SieMe::getCurrentPhonebook() throw(GsmException) -{ - if (_lastPhonebookName == "") - { - Parser p(_at->chat("^SPBS?", "^SPBS:")); - // answer is e.g. ^SPBS: "SM",41,250 - _lastPhonebookName = p.parseString(); - p.parseComma(); - int _currentNumberOfEntries = p.parseInt(); - p.parseComma(); - int _maxNumberOfEntries = p.parseInt(); - } - return _lastPhonebookName; -} - -void SieMe::setPhonebook(string phonebookName) throw(GsmException) -{ - if (phonebookName != _lastPhonebookName) - { - _at->chat("^SPBS=\"" + phonebookName + "\""); - _lastPhonebookName = phonebookName; - } -} - - -IntRange SieMe:: getSupportedSignalTones() throw(GsmException) -{ - Parser p(_at->chat("^SPST=?", "^SPST:")); - // ^SPST: (0-4),(0,1) - IntRange typeRange = p.parseRange(); - p.parseComma(); - vector volumeList = p.parseIntList(); - return typeRange; -} - -void SieMe:: playSignalTone(int tone) throw(GsmException) -{ - _at->chat("^SPST=" + intToStr(tone) + ",1"); -} - -void SieMe:: stopSignalTone(int tone) throw(GsmException) -{ - _at->chat("^SPST=" + intToStr(tone) + ",0"); -} - - -IntRange SieMe::getSupportedRingingTones() throw(GsmException) // (AT^SRTC=?) -{ - Parser p(_at->chat("^SRTC=?", "^SRTC:")); - // ^SRTC: (0-42),(1-5) - IntRange typeRange = p.parseRange(); - p.parseComma(); - IntRange volumeRange = p.parseRange(); - return typeRange; -} - -int SieMe::getCurrentRingingTone() throw(GsmException) // (AT^SRTC?) -{ - Parser p(_at->chat("^SRTC?", "^SRTC:")); - // ^SRTC: 41,2,0 - int type = p.parseInt(); - p.parseComma(); - int volume = p.parseInt(); - p.parseComma(); - int ringing = p.parseInt(); - return type; -} - -void SieMe::setRingingTone(int tone, int volume) throw(GsmException) -{ - _at->chat("^SRTC=" + intToStr(tone) + "," + intToStr(volume)); -} - -void SieMe:: playRingingTone() throw(GsmException) -{ - // get ringing bool - Parser p(_at->chat("^SRTC?", "^SRTC:")); - // ^SRTC: 41,2,0 - int type = p.parseInt(); - p.parseComma(); - int volume = p.parseInt(); - p.parseComma(); - int ringing = p.parseInt(); - - if (ringing == 0) - toggleRingingTone(); -} - -void SieMe::stopRingingTone() throw(GsmException) -{ - // get ringing bool - Parser p(_at->chat("^SRTC?", "^SRTC:")); - // ^SRTC: 41,2,0 - int type = p.parseInt(); - p.parseComma(); - int volume = p.parseInt(); - p.parseComma(); - int ringing = p.parseInt(); - - if (ringing == 1) - toggleRingingTone(); -} - -void SieMe::toggleRingingTone() throw(GsmException) // (AT^SRTC) -{ - _at->chat("^SRTC"); -} - -// Siemens get supported binary read -vector SieMe::getSupportedBinaryReads() throw(GsmException) -{ - Parser p(_at->chat("^SBNR=?", "^SBNR:")); - // ^SBNR: ("bmp",(0-3)),("mid",(0-4)),("vcf",(0-500)),("vcs",(0-50)) - - return p.parseParameterRangeList(); -} - -// Siemens get supported binary write -vector SieMe::getSupportedBinaryWrites() throw(GsmException) -{ - Parser p(_at->chat("^SBNW=?", "^SBNW:")); - // ^SBNW: ("bmp",(0-3)),("mid",(0-4)),("vcf",(0-500)),("vcs",(0-50)),("t9d",(0)) - - return p.parseParameterRangeList(); -} - -// Siemens Binary Read -BinaryObject SieMe::getBinary(string type, int subtype) throw(GsmException) -{ - // expect several response lines - vector result; - result = _at->chatv("^SBNR=\"" + type + "\"," + intToStr(subtype), "^SBNR:"); - // "bmp",0,1,5 pdu "bmp",0,2,5 ... - // most likely to be PDUs of 382 chars (191 * 2) - string pdu; - int fragmentCount = 0; - for (vector::iterator i = result.begin(); i != result.end(); ++i) - { - ++fragmentCount; - // parse header - Parser p(*i); - string fragmentType = p.parseString(); - if (fragmentType != type) - throw GsmException(_("bad PDU type"), ChatError); - p.parseComma(); - int fragmentSubtype = p.parseInt(); - if (fragmentSubtype != subtype) - throw GsmException(_("bad PDU subtype"), ChatError); - p.parseComma(); - int fragmentNumber = p.parseInt(); - if (fragmentNumber != fragmentCount) - throw GsmException(_("bad PDU number"), ChatError); - p.parseComma(); - int numberOfFragments = p.parseInt(); - if (fragmentNumber > numberOfFragments) - throw GsmException(_("bad PDU number"), ChatError); - - // concat pdu fragment - ++i; - pdu += *i; - } - - BinaryObject bnr; - bnr._type = type; - bnr._subtype = subtype; - bnr._size = pdu.length() / 2; - bnr._data = new unsigned char[pdu.length() / 2]; - if (! hexToBuf(pdu, bnr._data)) - throw GsmException(_("bad hexadecimal PDU format"), ChatError); - - return bnr; -} - -// Siemens Binary Write -void SieMe::setBinary(string type, int subtype, BinaryObject obj) - throw(GsmException) -{ - if (obj._size <= 0) - throw GsmException(_("bad object"), ParameterError); - - // Limitation: The maximum pdu size is 176 bytes (or 352 characters) - // this should be a configurable field - int maxPDUsize = 176; - int numberOfPDUs = (obj._size + maxPDUsize - 1) / maxPDUsize; - unsigned char *p = obj._data; - - for (int i = 1; i <= numberOfPDUs; ++i) - { - // construct pdu - int size = maxPDUsize; - if (i == numberOfPDUs) - size = obj._size - (numberOfPDUs - 1) * maxPDUsize; - string pdu = bufToHex(p, size); - p += size; - - cout << "processing " << i << " of " << numberOfPDUs - << " of " << size << " bytes." << endl; - cout << "^SBNW=\"" + type + "\"," + intToStr(subtype) + "," - + intToStr(i) + "," + intToStr(numberOfPDUs) << endl; - cout << pdu << endl; - - _at->sendPdu("^SBNW=\"" + type + "\"," + intToStr(subtype) + "," - + intToStr(i) + "," + intToStr(numberOfPDUs), "", - pdu, true); - cout << "OK" << endl; - } -} - - - - - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsm_sie_me.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsm_sie_me.h deleted file mode 100644 index 2c827a0379..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsm_sie_me.h +++ /dev/null @@ -1,99 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_sie_me.h -// * -// * Purpose: Mobile Equipment/Terminal Adapter and SMS functions -// * (According to "AT command set for S45 Siemens mobile phones" -// * v1.8, 26. July 2001 - Common AT prefix is "^S") -// * -// * Author: Christian W. Zuckschwerdt -// * -// * Created: 2001-12-15 -// ************************************************************************* - -#ifndef GSM_SIE_ME_H -#define GSM_SIE_ME_H - -#include -#include -#include -#include - -using namespace std; - -namespace gsmlib -{ - // *** Siemens mobile phone binary objects (bitmap, midi, vcal, vcard) - - struct BinaryObject - { - string _type; // Object type - int _subtype; // Object subtype (storage number) - unsigned char *_data; // Object binary data - int _size; // Object data size - }; - - // *** this class allows extended access to Siemens moblie phones - - class SieMe : public MeTa - { - private: - // init ME/TA to sensible defaults - void init() throw(GsmException); - - public: - // initialize a new MeTa object given the port - SieMe(Ref port) throw(GsmException); - - - // get the current phonebook in the Siemens ME - vector getSupportedPhonebooks() throw(GsmException);// (AT^SPBS=?) - - // get the current phonebook in the Siemens ME - string getCurrentPhonebook() throw(GsmException); // (AT^SPBS?) - - // set the current phonebook in the Siemens ME - // remember the last phonebook set for optimisation - void setPhonebook(string phonebookName) throw(GsmException); // (AT^SPBS=) - - - // Siemens get supported signal tones - IntRange getSupportedSignalTones() throw(GsmException); // (AT^SPST=?) - - // Siemens set ringing tone - void playSignalTone(int tone) throw(GsmException); // (AT^SRTC=x,1) - - // Siemens set ringing tone - void stopSignalTone(int tone) throw(GsmException); // (AT^SRTC=x,0) - - - // Siemens get ringing tone - IntRange getSupportedRingingTones() throw(GsmException); // (AT^SRTC=?) - // Siemens get ringing tone - int getCurrentRingingTone() throw(GsmException); // (AT^SRTC?) - // Siemens set ringing tone - void setRingingTone(int tone, int volume) throw(GsmException);// (AT^SRTC=) - // Siemens set ringing tone on - void playRingingTone() throw(GsmException); - // Siemens set ringing tone of - void stopRingingTone() throw(GsmException); - // Siemens toggle ringing tone - void toggleRingingTone() throw(GsmException); // (AT^SRTC) - - // Siemens get supported binary read - vector getSupportedBinaryReads() throw(GsmException); - - // Siemens get supported binary write - vector getSupportedBinaryWrites() throw(GsmException); - - // Siemens Binary Read - BinaryObject getBinary(string type, int subtype) throw(GsmException); - - // Siemens Binary Write - void setBinary(string type, int subtype, BinaryObject obj) - throw(GsmException); - }; -}; - -#endif // GSM_ME_TA_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsmsiectl.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsmsiectl.cc deleted file mode 100644 index 4ea92edfea..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsmsiectl.cc +++ /dev/null @@ -1,698 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsmsiectl.cc -// * -// * Purpose: GSM Siemens mobile phone control program -// * -// * Author: Christian W. Zuckschwerdt -// * -// * Created: 2001-12-15 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#if defined(HAVE_GETOPT_LONG) || defined(WIN32) -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef WIN32 -#include -#else -#include -#include -#endif -#include - -using namespace std; -using namespace gsmlib; - -// my ME - -static SieMe *m; - -// information parameters - -enum InfoParameter {AllInfo, // print all info - MeInfo, // MeInfo must be first! - OperatorInfo, - CurrentOperatorInfo, - FacilityLockStateInfo, - FacilityLockCapabilityInfo, - PasswordInfo, - CLIPInfo, - CallForwardingInfo, - BatteryInfo, - BitErrorInfo, - SCAInfo, - CharSetInfo, - PhonebookInfo, // extended Siemens info - SignalToneInfo, - RingingToneInfo, - BinaryInfo, - SignalInfo}; // SignalInfo must be last! - -// operation parameters - -// FIXME operations not implemented yet - -// options - -#ifdef HAVE_GETOPT_LONG -static struct option longOpts[] = -{ - {"xonxoff", no_argument, (int*)NULL, 'X'}, - {"operation", required_argument, (int*)NULL, 'o'}, - {"device", required_argument, (int*)NULL, 'd'}, - {"baudrate", required_argument, (int*)NULL, 'b'}, - {"init", required_argument, (int*)NULL, 'I'}, - {"help", no_argument, (int*)NULL, 'h'}, - {"version", no_argument, (int*)NULL, 'v'}, - {(char*)NULL, 0, (int*)NULL, 0} -}; -#else -#define getopt_long(argc, argv, options, longopts, indexptr) \ - getopt(argc, argv, options) -#endif - -// helper function, prints forwarding info - -void printForwardReason(string s, ForwardInfo &info) -{ - cout << s << " " - << (info._active ? _("active ") : _("inactive ")) - << _("number: ") << info._number - << _(" subaddr: ") << info._subAddr - << _(" time: ") << info._time << endl; -} - -// helper function, prints integer range - -void printIntRange(IntRange ir) -{ - cout << "(" << ir._low; - if (ir._high != NOT_SET) - cout << "-" << ir._high; - cout << ")"; -} - -// helper function, prints parameter range - -void printParameterRange(ParameterRange pr) -{ - cout << "(\"" << pr._parameter << "\","; - printIntRange(pr._range); - cout << ")"; -} - -// print information - -static void printInfo(InfoParameter ip) -{ - switch (ip) - { - case MeInfo: - { - MEInfo mei = m->getMEInfo(); - cout << _(" Manufacturer: ") << mei._manufacturer << endl - << _(" Model: ") << mei._model << endl - << _(" Revision: ") << mei._revision << endl - << _(" Serial Number: ") << mei._serialNumber << endl; - break; - } - case OperatorInfo: - { - int count = 0; - vector opis = m->getAvailableOPInfo(); - for (vector::iterator i = opis.begin(); i != opis.end(); ++i) - { - cout << " Status: "); - switch (i->_status) - { - case UnknownOPStatus: cout << _("unknown"); break; - case CurrentOPStatus: cout << _("current"); break; - case AvailableOPStatus: cout << _("available"); break; - case ForbiddenOPStatus: cout << _("forbidden"); break; - } - cout << _(" Long name: '") << i->_longName << "' " - << _(" Short name: '") << i->_shortName << "' " - << _(" Numeric name: ") << i->_numericName << endl; - ++count; - } - break; - } - case CurrentOperatorInfo: - { - OPInfo opi = m->getCurrentOPInfo(); - cout << "" - << _(" Long name: '") << opi._longName << "' " - << _(" Short name: '") << opi._shortName << "' " - << _(" Numeric name: ") << opi._numericName - << _(" Mode: "); - switch (opi._mode) - { - case AutomaticOPMode: cout << _("automatic"); break; - case ManualOPMode: cout << _("manual"); break; - case DeregisterOPMode: cout << _("deregister"); break; - case ManualAutomaticOPMode: cout << _("manual/automatic"); break; - } - cout << endl; - break; - } - case FacilityLockStateInfo: - { - int count = 0; - vector fclc = m->getFacilityLockCapabilities(); - for (vector::iterator i = fclc.begin(); i != fclc.end(); ++i) - if (*i != "AB" && *i != "AG" && *i != "AC") - { - cout << " '" << *i << "'"; - try - { - if (m->getFacilityLockStatus(*i, VoiceFacility)) - cout << _(" Voice"); - } - catch (GsmException &e) - { - cout << _(" unknown"); - } - try - { - if (m->getFacilityLockStatus(*i, DataFacility)) - cout << _(" Data"); - } - catch (GsmException &e) - { - cout << _(" unknown"); - } - try - { - if (m->getFacilityLockStatus(*i, FaxFacility)) - cout << _(" Fax"); - } - catch (GsmException &e) - { - cout << _(" unknown"); - } - cout << endl; - ++count; - } - break; - } - case FacilityLockCapabilityInfo: - { - cout << " "; - vector fclc = m->getFacilityLockCapabilities(); - for (vector::iterator i = fclc.begin(); i != fclc.end(); ++i) - cout << "'" << *i << "' "; - cout << endl; - break; - } - case PasswordInfo: - { - vector pwi = m->getPasswords(); - int count = 0; - for (vector::iterator i = pwi.begin(); i != pwi.end(); ++i) - { - cout << " '" - << i->_facility << "' " << i->_maxPasswdLen << endl; - ++count; - } - break; - } - case CLIPInfo: - { - cout << " " << (m->getNetworkCLIP() ? _("on") : _("off")) << endl; - break; - } - case CallForwardingInfo: - { - for (int r = 0; r < 4; ++r) - { - string text; - switch (r) - { - case 0: text = _("UnconditionalReason"); break; - case 1: text = _("MobileBusyReason"); break; - case 2: text = _("NoReplyReason"); break; - case 3: text = _("NotReachableReason"); break; - } - ForwardInfo voice, fax, data; - m->getCallForwardInfo((ForwardReason)r, voice, fax, data); - cout << " " + text + _(" Voice"), voice); - cout << " " + text + _(" Data"), data); - cout << " " + text + _(" Fax"), fax); - } - break; - } - case BatteryInfo: - { - cout << " "; - int bcs = m->getBatteryChargeStatus(); - switch (bcs) - { - case 0: cout << _("0 ME is powered by the battery") << endl; break; - case 1: cout << _("1 ME has a battery connected, but is not powered by it") - << endl; break; - case 2: cout << _("2 ME does not have a battery connected") << endl; break; - case 3: - cout << _("3 Recognized power fault, calls inhibited") << endl; - break; - } - cout << " " << m->getBatteryCharge() << endl; - break; - } - case BitErrorInfo: - { - cout << " " << m->getBitErrorRate() << endl; - break; - } - case SCAInfo: - { - cout << " " << m->getServiceCentreAddress() << endl; - break; - } - case CharSetInfo: - { - cout << " "; - vector cs = m->getSupportedCharSets(); - for (vector::iterator i = cs.begin(); i != cs.end(); ++i) - cout << "'" << *i << "' "; - cout << endl; - cout << " '" << m->getCurrentCharSet() << "'" << endl; - break; - } - case SignalInfo: - { - cout << " " << m->getSignalStrength() << endl; - break; - } - case PhonebookInfo: - { - cout << " "; - vector pb = m->getSupportedPhonebooks(); - for (vector::iterator i = pb.begin(); i != pb.end(); ++i) - cout << "'" << *i << "' "; - cout << endl; - cout << " '" << m->getCurrentPhonebook() << "'" << endl; - break; - } - case SignalToneInfo: - { - cout << " "; - IntRange st = m->getSupportedSignalTones(); - printIntRange(st); - cout << endl; -// cout << " '" << m->getCurrentSignalTone() << "'" << endl; - break; - } - case RingingToneInfo: - { - cout << " "; - IntRange rt = m->getSupportedRingingTones(); - printIntRange(rt); - cout << endl; - cout << " " << m->getCurrentRingingTone() << endl; - break; - } - case BinaryInfo: - { - cout << " "; - vector bnr = m->getSupportedBinaryReads(); - for (vector::iterator i = bnr.begin(); i != bnr.end(); ++i) - { - printParameterRange(*i); - cout << " "; - } - cout << endl; - cout << " "; - vector bnw = m->getSupportedBinaryWrites(); - for (vector::iterator i = bnw.begin(); i != bnw.end(); ++i) - { - printParameterRange(*i); - cout << " "; - } - cout << endl; - break; - } - default: - assert(0); - break; - } -} - -// convert facility class string of the form "", "all", or any combination -// of "v" (voice), "d" (data), or "f" (fax) to numeric form - -FacilityClass strToFacilityClass(string facilityClassS) -{ - facilityClassS = lowercase(facilityClassS); - FacilityClass facilityClass = (FacilityClass)0; - if (facilityClassS == "all" || facilityClassS == "") - return (FacilityClass)ALL_FACILITIES; - - // OR in facility class bits - for (unsigned int i = 0; i < facilityClassS.length(); ++i) - if (facilityClassS[i] == 'v') - facilityClass = (FacilityClass)(facilityClass | VoiceFacility); - else if (facilityClassS[i] == 'd') - facilityClass = (FacilityClass)(facilityClass | DataFacility); - else if (facilityClassS[i] == 'f') - facilityClass = (FacilityClass)(facilityClass | FaxFacility); - else - throw GsmException( - stringPrintf(_("unknown facility class parameter '%c'"), - facilityClassS[i]), ParameterError); - - return facilityClass; -} - -// check if argc - optind is in range min..max -// throw exception otherwise - -void checkParamCount(int optind, int argc, int min, int max) -{ - int paramCount = argc - optind; - if (paramCount < min) - throw GsmException(stringPrintf(_("not enough parameters, minimum number " - "of parameters is %d"), min), - ParameterError); - else if (paramCount > max) - throw GsmException(stringPrintf(_("too many parameters, maximum number " - "of parameters is %d"), max), - ParameterError); -} - -// *** main program - -int main(int argc, char *argv[]) -{ - try - { - // handle command line options - string device = "/dev/mobilephone"; - string operation; - string baudrate; - string initString = DEFAULT_INIT_STRING; - bool swHandshake = false; - - int opt; - int dummy; - while((opt = getopt_long(argc, argv, "I:o:d:b:hvX", longOpts, &dummy)) - != -1) - switch (opt) - { - case 'X': - swHandshake = true; - break; - case 'I': - initString = optarg; - break; - case 'd': - device = optarg; - break; - case 'o': - operation = optarg; - break; - case 'b': - baudrate = optarg; - break; - case 'v': - cerr << argv[0] << stringPrintf(_(": version %s [compiled %s]"), - VERSION, __DATE__) << endl; - exit(0); - break; - case 'h': - cerr << argv[0] << _(": [-b baudrate][-d device][-h]" - "[-I init string][-o operation]\n" - " [-v][-X]{parameters}") << endl - << endl - << _(" -b, --baudrate baudrate to use for device " - "(default: 38400)") - << endl - << _(" -d, --device sets the destination device to " - "connect to") << endl - << _(" -h, --help prints this message") << endl - << _(" -I, --init device AT init sequence") << endl - << _(" -o, --operation operation to perform on the mobile \n" - " phone with the specified parameters") - << endl - << _(" -v, --version prints version and exits") << endl - << _(" -X, --xonxoff switch on software handshake") << endl - << endl - << _(" 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") - << endl << endl - << _("Refer to gsmctl(1) for details on the available parameters" - " and operations.") - << endl << endl; - exit(0); - break; - case '?': - throw GsmException(_("unknown option"), ParameterError); - break; - } - - // open the port and ME/TA - m = new SieMe(new -#ifdef WIN32 - Win32SerialPort -#else - UnixSerialPort -#endif - (device, - baudrate == "" ? - DEFAULT_BAUD_RATE : - baudRateStrToSpeed(baudrate), - initString, swHandshake)); - - if (operation == "") - { // process info parameters - for (int i = optind; i < argc; ++i) - { - string param = lowercase(argv[i]); - if (param == "all") - for (int ip = MeInfo; ip <= SignalInfo; ++ip) - printInfo((InfoParameter)ip); - else if (param == "me") - printInfo(MeInfo); - else if (param == "op") - printInfo(OperatorInfo); - else if (param == "currop") - printInfo(CurrentOperatorInfo); - else if (param == "flstat") - printInfo(FacilityLockStateInfo); - else if (param == "flcap") - printInfo(FacilityLockCapabilityInfo); - else if (param == "pw") - printInfo(PasswordInfo); - else if (param == "clip") - printInfo(CLIPInfo); - else if (param == "forw") - printInfo(CallForwardingInfo); - else if (param == "batt") - printInfo(BatteryInfo); - else if (param == "biterr") - printInfo(BitErrorInfo); - else if (param == "sig") - printInfo(SignalInfo); - else if (param == "sca") - printInfo(SCAInfo); - else if (param == "cset") - printInfo(CharSetInfo); - else if (param == "pbook") - printInfo(PhonebookInfo); - else if (param == "signal") - printInfo(SignalToneInfo); - else if (param == "ring") - printInfo(RingingToneInfo); - else if (param == "binary") - printInfo(BinaryInfo); - else - throw GsmException( - stringPrintf(_("unknown information parameter '%s'"), - param.c_str()), - ParameterError); - } - } - else - { // process operation - operation = lowercase(operation); - if (operation == "dial") - { - // dial: number - checkParamCount(optind, argc, 1, 1); - - m->dial(argv[optind]); - - // wait for keypress from stdin - char c; - read(1, &c, 1); - } - else if (operation == "setop") - { - // setop: opmode numeric FIXME allow long and numeric too - checkParamCount(optind, argc, 2, 2); - string opmodeS = lowercase(argv[optind]); - OPModes opmode; - if (opmodeS == "automatic") - opmode = AutomaticOPMode; - else if (opmodeS == "manual") - opmode = ManualOPMode; - else if (opmodeS == "deregister") - opmode = DeregisterOPMode; - else if (opmodeS == "manualautomatic") - opmode = ManualAutomaticOPMode; - else - throw GsmException(stringPrintf(_("unknown opmode parameter '%s'"), - opmodeS.c_str()), ParameterError); - - m->setCurrentOPInfo(opmode, "" , "", checkNumber(argv[optind + 1])); - } - else if (operation == "lock") - { - // lock: facility [facilityclass] [passwd] - checkParamCount(optind, argc, 1, 3); - string passwd = (argc - optind == 3) ? - (string)argv[optind + 2] : (string)""; - - m->lockFacility(argv[optind], - (argc - optind >= 2) ? - strToFacilityClass(argv[optind + 1]) : - (FacilityClass)ALL_FACILITIES, - passwd); - } - else if (operation == "unlock") - { - // unlock: facility [facilityclass] [passwd] - checkParamCount(optind, argc, 1, 3); - string passwd = argc - optind == 3 ? argv[optind + 2] : ""; - - m->unlockFacility(argv[optind], - (argc - optind >= 2) ? - strToFacilityClass(argv[optind + 1]) : - (FacilityClass)ALL_FACILITIES, - passwd); - } - else if (operation == "setpw") - { - // set password: facility oldpasswd newpasswd - checkParamCount(optind, argc, 1, 3); - string oldPasswd = argc - optind >= 2 ? argv[optind + 1] : ""; - string newPasswd = argc - optind == 3 ? argv[optind + 2] : ""; - - m->setPassword(argv[optind], oldPasswd, newPasswd); - } - else if (operation == "forw") - { - // call forwarding: mode reason number [facilityclass] [forwardtime] - checkParamCount(optind, argc, 2, 5); - - // get optional parameters facility class and forwardtime - int forwardTime = argc - optind == 5 ? checkNumber(argv[optind + 4]) : - NOT_SET; - FacilityClass facilityClass = - argc - optind >= 4 ? strToFacilityClass(argv[optind + 3]) : - (FacilityClass)ALL_FACILITIES; - - // get forward reason - string reasonS = lowercase(argv[optind + 1]); - ForwardReason reason; - if (reasonS == "unconditional") - reason = UnconditionalReason; - else if (reasonS == "mobilebusy") - reason = MobileBusyReason; - else if (reasonS == "noreply") - reason = NoReplyReason; - else if (reasonS == "notreachable") - reason = NotReachableReason; - else if (reasonS == "all") - reason = AllReasons; - else if (reasonS == "allconditional") - reason = AllConditionalReasons; - else - throw GsmException( - stringPrintf(_("unknown forward reason parameter '%s'"), - reasonS.c_str()), ParameterError); - - // get mode - string modeS = lowercase(argv[optind]); - ForwardMode mode; - if (modeS == "disable") - mode = DisableMode; - else if (modeS == "enable") - mode = EnableMode; - else if (modeS == "register") - mode = RegistrationMode; - else if (modeS == "erase") - mode = ErasureMode; - else - throw GsmException( - stringPrintf(_("unknown forward mode parameter '%s'"), - modeS.c_str()), ParameterError); - - m->setCallForwarding(reason, mode, - (argc - optind >= 3) ? argv[optind + 2] : "", - "", // subaddr - facilityClass, forwardTime); - } - else if (operation == "setsca") - { - // set sca: number - checkParamCount(optind, argc, 1, 1); - m->setServiceCentreAddress(argv[optind]); - } - else if (operation == "cset") - { - // set charset: string - checkParamCount(optind, argc, 1, 1); - m->setCharSet(argv[optind]); - } - else if (operation == "signal") - { - // play signal tone: int - checkParamCount(optind, argc, 1, 1); - int tone = atoi(argv[optind]); - m->playSignalTone(tone); - } - else if (operation == "setrt") - { - // set ringing tone: int int - checkParamCount(optind, argc, 2, 2); - int tone = atoi(argv[optind]); - int volume = atoi(argv[optind + 1]); - m->setRingingTone(tone, volume); - } - else if (operation == "playrt") - { - // play/stop ringing tone - m->toggleRingingTone(); - } - else - throw GsmException(stringPrintf(_("unknown operation '%s'"), - operation.c_str()), ParameterError); - } - } - catch (GsmException &ge) - { - cerr << argv[0] << _("[ERROR]: ") << ge.what() << endl; - return 1; - } - return 0; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsmsiexfer.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsmsiexfer.cc deleted file mode 100644 index 90fce1f471..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/ext/gsmsiexfer.cc +++ /dev/null @@ -1,292 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsmsiexfer.cc -// * -// * Purpose: Siemens ME file transfer program -// * -// * Author: Christian W. Zuckschwerdt -// * -// * Created: 2001-12-16 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#ifdef WIN32 -#include -#else -#include -#include -#endif -#if defined(HAVE_GETOPT_LONG) || defined(WIN32) -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -#ifdef HAVE_GETOPT_LONG -static struct option longOpts[] = -{ - {"xonxoff", no_argument, (int*)NULL, 'X'}, - {"init", required_argument, (int*)NULL, 'I'}, - {"destination", required_argument, (int*)NULL, 'd'}, - {"source", required_argument, (int*)NULL, 's'}, - {"baudrate", required_argument, (int*)NULL, 'b'}, - {"type", required_argument, (int*)NULL, 't'}, - {"subtype", required_argument, (int*)NULL, 'i'}, - {"help", no_argument, (int*)NULL, 'h'}, - {"version", no_argument, (int*)NULL, 'v'}, - {"verbose", no_argument, (int*)NULL, 'V'}, - {(char*)NULL, 0, (int*)NULL, 0} -}; -#else -#define getopt_long(argc, argv, options, longopts, indexptr) \ - getopt(argc, argv, options) -#endif - -// I f*ck up this file IO thing. - -// read binary object from stdin -BinaryObject readBinaryFile(istream &ifs, string filename) -{ - size_t size = 10000; // Bad coder, no biscuits! - BinaryObject bnr; - bnr._data = new unsigned char[size]; - ifs.read((char*)bnr._data, size); - bnr._size = ifs.gcount(); - return bnr; -} - -// read binary object from file -BinaryObject readFile(string filename) -{ - // open the file - ifstream ifs(filename.c_str()); - if (ifs.bad()) - throw GsmException(stringPrintf(_("cannot open file '%s'"), - filename.c_str()), - OSError); - // and read the file - return readBinaryFile(ifs, filename); -} - -// read binary object from stdin -BinaryObject readFile(bool fromStdin) -{ - // read from stdin -// if (fromStdin) - return readBinaryFile(cin, (string)_("")); -} - -// write binary object to file -void writeBinaryFile(ostream &ofs, string filename, BinaryObject bnw) -{ - // well just dump the data - ofs.write((char*)bnw._data, bnw._size); -} - -// write binary object -void writeFile(string filename, BinaryObject obj) -{ - // open the file - ofstream ofs(filename.c_str()); - if (ofs.bad()) - throw GsmException(stringPrintf(_("cannot open file '%s'"), - filename.c_str()), - OSError); - // and read the file - writeBinaryFile(ofs, filename, obj); -} - -// write binary object to stdout -void writeFile(bool toStdout, BinaryObject obj) -{ -// if (toStdout) - writeBinaryFile(cout, (string)_(""), obj); -} - -// *** main program - -int main(int argc, char *argv[]) -{ - try - { - // handle command line options - string destination; - string source; - string baudrate; - string type; - string subtype; - int subtypeN; - bool verbose = false; - string initString = DEFAULT_INIT_STRING; - bool swHandshake = false; - Ref sourceMeTa, destMeTa; - BinaryObject sourceObject; - - int opt; - int dummy; - while((opt = getopt_long(argc, argv, "XI:s:d:b:hvVt:i:", longOpts, - &dummy)) - != -1) - switch (opt) - { - case 'X': - swHandshake = true; - break; - case 'I': - initString = optarg; - break; - case 'V': - verbose = true; - break; - case 't': - type = optarg; - break; - case 'i': - subtype = optarg; - subtypeN = atoi(optarg); - break; - case 'd': - destination = optarg; - break; - case 's': - source = optarg; - break; - case 'b': - baudrate = optarg; - break; - case 'v': - cerr << argv[0] << stringPrintf(_(": version %s [compiled %s]"), - VERSION, __DATE__) << endl; - exit(0); - break; - case 'h': - cerr << argv[0] << _(": [-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]") << endl - << endl - << _(" -b, --baudrate baudrate to use for device " - "(default: 38400)") - << endl - << _(" -c, --copy copy source entries to destination") - << endl - << _(" -d, --destination sets the destination device to " - "connect \n" - " to, or the file to write") << endl - << _(" -D, --destination-backend sets the destination backend") - << endl - << _(" -h, --help prints this message") << endl - << _(" -i, --index takes index positions into account") - << endl - << _(" -I, --init device AT init sequence") << endl - << _(" -p, --phonebook name of phonebook to use") << endl - << _(" -s, --source sets the source device to connect to,\n" - " or the file to read") << endl - << _(" -t, --charset sets the character set to use for\n" - " phonebook entries") << endl - << _(" -S, --source-backend sets the source backend") - << endl - << _(" -v, --version prints version and exits") << endl - << _(" -V, --verbose print detailed progress messages") - << endl - << _(" -X, --xonxoff switch on software handshake") << endl - << _(" -y, --synchronize synchronize destination with source\n" - " entries (destination is overwritten)\n" - " (see gsmpb(1) for details)") - << endl << endl; - exit(0); - break; - case '?': - throw GsmException(_("unknown option"), ParameterError); - break; - } - - // check if all parameters all present - if (destination == "" || source == "") - throw GsmException(_("both source and destination must be given"), - ParameterError); - - // start accessing source mobile phone or file - if (source == "-") - sourceObject = readFile(true); - else if (isFile(source)) - sourceObject = readFile(source); - else - { - if (type == "") - throw GsmException(_("type be given"), ParameterError); - if (subtype == "") - throw GsmException(_("subtype be given"), ParameterError); - - sourceMeTa = new SieMe(new -#ifdef WIN32 - Win32SerialPort -#else - UnixSerialPort -#endif - (source, - baudrate == "" ? DEFAULT_BAUD_RATE : - baudRateStrToSpeed(baudrate), initString, - swHandshake)); - sourceObject = sourceMeTa->getBinary(type, subtypeN); - } - - // make sure destination.c_str file exists - if (destination != "") - { - try - { - ofstream f(destination.c_str(), ios::out | ios::app); - } - catch (exception) - { - } - } - - // start accessing destination mobile phone or file - if (destination == "-") - writeFile(true, sourceObject); - else if (isFile(destination)) - writeFile(destination, sourceObject); - else - { - if (type == "") - throw GsmException(_("type must be given"), ParameterError); - if (subtype == "") - throw GsmException(_("subtype must be given"), ParameterError); - - destMeTa = new SieMe(new -#ifdef WIN32 - Win32SerialPort -#else - UnixSerialPort -#endif - (destination, - baudrate == "" ? DEFAULT_BAUD_RATE : - baudRateStrToSpeed(baudrate), initString, - swHandshake)); - destMeTa->setBinary(type, subtypeN, sourceObject); - } - } - catch (GsmException &ge) - { - cerr << argv[0] << _("[ERROR]: ") << ge.what() << endl; - return 1; - } - return 0; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/g41.patch b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/g41.patch deleted file mode 100644 index 4c33e6a7d2..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/g41.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ./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; diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsm_config.h.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsm_config.h.in deleted file mode 100644 index 4ed31e1464..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsm_config.h.in +++ /dev/null @@ -1,344 +0,0 @@ -/* gsm_config.h.in. Generated from configure.in by autoheader. */ -/* used by libtool*/ -#define PACKAGE 0 - -/* used by libtool*/ -#define VERSION 0 - -/* Define if getopt_long() available */ -#undef HAVE_GETOPT_LONG - -/* Define if alarm() available */ -#undef HAVE_ALARM - -/* Define if netinet/in.h header available */ -#undef HAVE_NETINET_IN_H - -/* Define if string.h header available */ -#undef HAVE_STRING_H - -/* Define for NLS */ -#undef ENABLE_NLS -#undef HAVE_CATGETS -#undef HAVE_GETTEXT -#undef HAVE_LC_MESSAGES -#undef HAVE_STPCPY - -/* Define LOCALEDIR */ -#define LOCALEDIR "/usr/share/locale" - -/* Define if libintl.h header available */ -#undef HAVE_LIBINTL_H - -/* Define if vsnprintf() function available */ -#undef HAVE_VSNPRINTF - -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -#undef CRAY_STACKSEG_END - -/* Define to 1 if using `alloca.c'. */ -#undef C_ALLOCA - -/* Define to 1 if translation of program messages to the user's native - language is requested. */ -#undef ENABLE_NLS - -/* Define to 1 if you have `alloca', as a function or macro. */ -#undef HAVE_ALLOCA - -/* Define to 1 if you have and it should be used (not on Ultrix). - */ -#undef HAVE_ALLOCA_H - -/* 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 `fwprintf' function. */ -#undef HAVE_FWPRINTF - -/* Define to 1 if you have the `getcwd' function. */ -#undef HAVE_GETCWD - -/* Define to 1 if you have the `getegid' function. */ -#undef HAVE_GETEGID - -/* Define to 1 if you have the `geteuid' function. */ -#undef HAVE_GETEUID - -/* Define to 1 if you have the `getgid' function. */ -#undef HAVE_GETGID - -/* Define to 1 if you have the `getpagesize' function. */ -#undef HAVE_GETPAGESIZE - -/* Define if the GNU gettext() function is already present or preinstalled. */ -#undef HAVE_GETTEXT - -/* Define to 1 if you have the `getuid' function. */ -#undef HAVE_GETUID - -/* 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 - -/* Define if exists, doesn't clash with , and - declares uintmax_t. */ -#undef HAVE_INTTYPES_H_WITH_UINTMAX - -/* Define if you have and nl_langinfo(CODESET). */ -#undef HAVE_LANGINFO_CODESET - -/* Define if your file defines LC_MESSAGES. */ -#undef HAVE_LC_MESSAGES - -/* Define to 1 if you have the `intl' library (-lintl). */ -#undef HAVE_LIBINTL - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBINTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - -/* 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 - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `mempcpy' function. */ -#undef HAVE_MEMPCPY - -/* Define to 1 if you have a working `mmap' system call. */ -#undef HAVE_MMAP - -/* Define to 1 if you have the `munmap' function. */ -#undef HAVE_MUNMAP - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IN_H - -/* 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 - -/* Define to 1 if you have the `setenv' function. */ -#undef HAVE_SETENV - -/* 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 - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define if exists, doesn't clash with , and declares - uintmax_t. */ -#undef HAVE_STDINT_H_WITH_UINTMAX - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `stpcpy' function. */ -#undef HAVE_STPCPY - -/* Define to 1 if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define to 1 if you have the `strdup' function. */ -#undef HAVE_STRDUP - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strtoul' function. */ -#undef HAVE_STRTOUL - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* 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. */ -#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 - -/* Define to 1 if you have the `__argz_next' function. */ -#undef HAVE___ARGZ_NEXT - -/* 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 - -/* Define if integer division by zero raises signal SIGFPE. */ -#undef INTDIV0_RAISES_SIGFPE - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define if exists and defines unusable PRI* macros. */ -#undef PRI_MACROS_BROKEN - -/* The size of a `unsigned int', as computed by sizeof. */ -#undef SIZEOF_UNSIGNED_INT - -/* The size of a `unsigned long int', as computed by sizeof. */ -#undef SIZEOF_UNSIGNED_LONG_INT - -/* 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 */ -#undef STACK_DIRECTION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Version number of package */ -#undef VERSION - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* 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. */ -#undef uintmax_t diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/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 deleted file mode 100644 index 7bc765edd6..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib-1.10.debmg/debian/gsm-utils.dirs +++ /dev/null @@ -1,11 +0,0 @@ -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 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/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 deleted file mode 100644 index cc623b611b..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib-1.10.debmg/debian/gsm-utils.postinst +++ /dev/null @@ -1,28 +0,0 @@ -#!/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# diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/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 deleted file mode 100644 index 34c947e93e..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib-1.10.debmg/debian/gsm-utils.prerm +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -e - -deluser gsmsms || true -delgroup gsmsms || true - -# Add the rest automatically.. -#DEBHELPER# diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib-1.10.debmg/debian/gsm-utils.undocumented b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/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-13ubuntu/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-13ubuntu/gsmlib.spec b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib.spec deleted file mode 100644 index c262954cc5..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib.spec +++ /dev/null @@ -1,92 +0,0 @@ -%define LIBVER 1.0.4 -Summary: Library to access GSM mobile phones through GSM modems -Name: gsmlib -Version: 1.10 -Release: 1 -Source: gsmlib-%{version}.tar.gz -Group: System Environment/Libraries -Copyright: GNU LIBRARY GENERAL PUBLIC LICENSE -URL: http://www.pxh.de/fs/gsmlib/ -Vendor: Peter Hofmann -Buildroot: /var/tmp/gsmlib-root - -%package devel -Summary: Development tools for programs which will use the gsmlib library. -Group: Development/Libraries -Requires: gsmlib - -%package ext -Summary: Extensions to gsmlib to support non-standard phone features. -Group: Development/Libraries -Requires: gsmlib - -%description -This distribution contains a library to access -GSM mobile phones through GSM modems. Features include: - * modification of phonebooks 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 -Additionally, some simple command line programs are -provided to use these functionalities. - -%description devel -The gsmlib-devel package includes the header files and static libraries -necessary for developing programs which use the gsmlib library. - -%description ext -The extension package of gsmlib contains programs, libraries, and -documentation to support non-standard features of GSM phones. The -following phones/phone types are currently supported: - * Siemens GSM phones - -%prep -%setup - -%build -CXXFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr -make - -%install -make DESTDIR="$RPM_BUILD_ROOT" install - -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root) -/usr/lib/libgsmme.so -/usr/lib/libgsmme.so.%{LIBVER} -/usr/bin/gsmsmsstore -/usr/bin/gsmctl -/usr/bin/gsmsmsd -/usr/bin/gsmpb -/usr/bin/gsmsendsms -/usr/man/man1/gsmctl.1.gz -/usr/man/man7/gsminfo.7.gz -/usr/man/man1/gsmpb.1.gz -/usr/man/man1/gsmsendsms.1.gz -/usr/man/man8/gsmsmsd.8.gz -/usr/man/man1/gsmsmsstore.1.gz -/usr/share/locale/de/LC_MESSAGES/gsmlib.mo - -%doc README INSTALL ABOUT-NLS AUTHORS COPYING NEWS TODO -%doc doc/README.NLS doc/README.developers doc/FAQ ChangeLog - -%files devel -%defattr(-,root,root) -/usr/lib/libgsmme.a -/usr/include/gsmlib - -%files ext -/usr/bin/gsmsiectl -/usr/bin/gsmsiexfer -/usr/lib/libgsmext.so -/usr/lib/libgsmext.so.%{LIBVER} - -%doc ext/README.sieme diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/Makefile.am b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/Makefile.am deleted file mode 100644 index 12d6948c52..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## Process this file with automake to produce Makefile.in -# ************************************************************************* -# * GSM TA/ME library -# * -# * File: Makefile.am -# * -# * Purpose: GSM library Makefile -# * -# * Author: Peter Hofmann (software@pxh.de) -# * -# * Created: 5.5.1999 -# ************************************************************************* - -INCLUDES = -I.. - -lib_LTLIBRARIES = libgsmme.la - -libgsmme_la_SOURCES = gsm_phonebook.cc gsm_util.cc gsm_unix_serial.cc \ - gsm_me_ta.cc gsm_at.cc gsm_error.cc gsm_parser.cc \ - gsm_sms.cc gsm_sms_codec.cc gsm_sms_store.cc \ - gsm_event.cc gsm_sorted_phonebook.cc \ - gsm_sorted_sms_store.cc gsm_nls.cc \ - gsm_sorted_phonebook_base.cc gsm_cb.cc - -gsmincludedir = $(includedir)/gsmlib - -gsminclude_HEADERS = gsm_at.h gsm_parser.h gsm_sms.h gsm_unix_serial.h \ - gsm_error.h gsm_phonebook.h gsm_sms_codec.h \ - gsm_util.h gsm_me_ta.h gsm_port.h gsm_sms_store.h \ - gsm_event.h gsm_sorted_phonebook.h \ - gsm_sorted_sms_store.h gsm_map_key.h \ - gsm_sorted_phonebook_base.h gsm_cb.h - -noinst_HEADERS = gsm_nls.h gsm_sysdep.h - -libgsmme_la_LDFLAGS = -version-info $(GSM_VERSION) - -EXTRA_DIST = gsm_win32_serial.h gsm_win32_serial.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/Makefile.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/Makefile.in deleted file mode 100644 index 5e1f2477cb..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/Makefile.in +++ /dev/null @@ -1,461 +0,0 @@ -# Makefile.in generated by automake 1.6.3 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# ************************************************************************* -# * GSM TA/ME library -# * -# * File: Makefile.am -# * -# * Purpose: GSM library Makefile -# * -# * Author: Peter Hofmann (software@pxh.de) -# * -# * Created: 5.5.1999 -# ************************************************************************* -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -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 = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ - -EXEEXT = @EXEEXT@ -OBJEXT = @OBJEXT@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -AMTAR = @AMTAR@ -AS = @AS@ -AWK = @AWK@ -BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ -CATOBJEXT = @CATOBJEXT@ -CC = @CC@ -CPP = @CPP@ -CXX = @CXX@ -DATADIRNAME = @DATADIRNAME@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -ECHO = @ECHO@ -GENCAT = @GENCAT@ -GLIBC21 = @GLIBC21@ -GMSGFMT = @GMSGFMT@ -GSM_VERSION = @GSM_VERSION@ -HAVE_LIB = @HAVE_LIB@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INSTOBJEXT = @INSTOBJEXT@ -INTLBISON = @INTLBISON@ -INTLLIBS = @INTLLIBS@ -INTLOBJS = @INTLOBJS@ -INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ -LIB = @LIB@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIB = @LTLIB@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -MKINSTALLDIRS = @MKINSTALLDIRS@ -OBJDUMP = @OBJDUMP@ -PACKAGE = @PACKAGE@ -POSUB = @POSUB@ -RANLIB = @RANLIB@ -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@ - -INCLUDES = -I.. - -lib_LTLIBRARIES = libgsmme.la - -libgsmme_la_SOURCES = gsm_phonebook.cc gsm_util.cc gsm_unix_serial.cc \ - gsm_me_ta.cc gsm_at.cc gsm_error.cc gsm_parser.cc \ - gsm_sms.cc gsm_sms_codec.cc gsm_sms_store.cc \ - gsm_event.cc gsm_sorted_phonebook.cc \ - gsm_sorted_sms_store.cc gsm_nls.cc \ - gsm_sorted_phonebook_base.cc gsm_cb.cc - - -gsmincludedir = $(includedir)/gsmlib - -gsminclude_HEADERS = gsm_at.h gsm_parser.h gsm_sms.h gsm_unix_serial.h \ - gsm_error.h gsm_phonebook.h gsm_sms_codec.h \ - gsm_util.h gsm_me_ta.h gsm_port.h gsm_sms_store.h \ - gsm_event.h gsm_sorted_phonebook.h \ - gsm_sorted_sms_store.h gsm_map_key.h \ - gsm_sorted_phonebook_base.h gsm_cb.h - - -noinst_HEADERS = gsm_nls.h gsm_sysdep.h - -libgsmme_la_LDFLAGS = -version-info $(GSM_VERSION) - -EXTRA_DIST = gsm_win32_serial.h gsm_win32_serial.cc -subdir = gsmlib -mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/gsm_config.h -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(lib_LTLIBRARIES) - -libgsmme_la_LIBADD = -am_libgsmme_la_OBJECTS = gsm_phonebook.lo gsm_util.lo gsm_unix_serial.lo \ - gsm_me_ta.lo gsm_at.lo gsm_error.lo gsm_parser.lo gsm_sms.lo \ - gsm_sms_codec.lo gsm_sms_store.lo gsm_event.lo \ - gsm_sorted_phonebook.lo gsm_sorted_sms_store.lo gsm_nls.lo \ - gsm_sorted_phonebook_base.lo gsm_cb.lo -libgsmme_la_OBJECTS = $(am_libgsmme_la_OBJECTS) - -DEFS = @DEFS@ -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/gsm_at.Plo ./$(DEPDIR)/gsm_cb.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/gsm_error.Plo ./$(DEPDIR)/gsm_event.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/gsm_me_ta.Plo ./$(DEPDIR)/gsm_nls.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/gsm_parser.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/gsm_phonebook.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/gsm_sms.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/gsm_sms_codec.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/gsm_sms_store.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/gsm_sorted_phonebook.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/gsm_sorted_phonebook_base.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/gsm_sorted_sms_store.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/gsm_unix_serial.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/gsm_util.Plo -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -CXXFLAGS = @CXXFLAGS@ -DIST_SOURCES = $(libgsmme_la_SOURCES) -HEADERS = $(gsminclude_HEADERS) $(noinst_HEADERS) - -DIST_COMMON = $(gsminclude_HEADERS) $(noinst_HEADERS) Makefile.am \ - Makefile.in -SOURCES = $(libgsmme_la_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .cc .lo .o .obj -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu gsmlib/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -libLTLIBRARIES_INSTALL = $(INSTALL) -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(libdir) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ - else :; fi; \ - done - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test -z "$dir" && dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libgsmme.la: $(libgsmme_la_OBJECTS) $(libgsmme_la_DEPENDENCIES) - $(CXXLINK) -rpath $(libdir) $(libgsmme_la_LDFLAGS) $(libgsmme_la_OBJECTS) $(libgsmme_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm_at.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm_cb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm_error.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm_event.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm_me_ta.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm_nls.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm_parser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm_phonebook.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm_sms.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm_sms_codec.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm_sms_store.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm_sorted_phonebook.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm_sorted_phonebook_base.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm_sorted_sms_store.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm_unix_serial.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm_util.Plo@am__quote@ - -distclean-depend: - -rm -rf ./$(DEPDIR) - -.cc.o: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -.cc.obj: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CXXCOMPILE) -c -o $@ `cygpath -w $<` - -.cc.lo: -@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< -CXXDEPMODE = @CXXDEPMODE@ - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -gsmincludeHEADERS_INSTALL = $(INSTALL_HEADER) -install-gsmincludeHEADERS: $(gsminclude_HEADERS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(gsmincludedir) - @list='$(gsminclude_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(gsmincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(gsmincludedir)/$$f"; \ - $(gsmincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(gsmincludedir)/$$f; \ - done - -uninstall-gsmincludeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(gsminclude_HEADERS)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " rm -f $(DESTDIR)$(gsmincludedir)/$$f"; \ - rm -f $(DESTDIR)$(gsmincludedir)/$$f; \ - 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; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - 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; } \ - 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 - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @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; \ - 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; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(HEADERS) - -installdirs: - $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(gsmincludedir) - -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-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 -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -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-am - -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - mostlyclean-am - -distclean: distclean-am - -distclean-am: clean-am distclean-compile distclean-depend \ - distclean-generic distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: install-gsmincludeHEADERS - -install-exec-am: install-libLTLIBRARIES - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -uninstall-am: uninstall-gsmincludeHEADERS uninstall-info-am \ - uninstall-libLTLIBRARIES - -.PHONY: GTAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool distclean distclean-compile \ - distclean-depend distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-gsmincludeHEADERS install-info \ - install-info-am install-libLTLIBRARIES install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - tags uninstall uninstall-am uninstall-gsmincludeHEADERS \ - uninstall-info-am uninstall-libLTLIBRARIES - -# 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: diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_at.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_at.cc deleted file mode 100644 index 1c163d06e1..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_at.cc +++ /dev/null @@ -1,444 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_at.cc -// * -// * Purpose: Utility classes for AT command sequence handling -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 3.5.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -// GsmAt members - -bool GsmAt::matchResponse(string answer, string responseToMatch) -{ - if (answer.substr(0, responseToMatch.length()) == responseToMatch) - return true; - else - // some TAs omit the ':' at the end of the response - if (_meTa.getCapabilities()._omitsColon && - responseToMatch[responseToMatch.length() - 1] == ':' && - answer.substr(0, responseToMatch.length() - 1) == - responseToMatch.substr(0, responseToMatch.length() - 1)) - return true; - return false; -} - -string GsmAt::cutResponse(string answer, string responseToMatch) -{ - if (answer.substr(0, responseToMatch.length()) == responseToMatch) - return normalize(answer.substr(responseToMatch.length(), - answer.length() - - responseToMatch.length())); - else - // some TAs omit the ':' at the end of the response - if (_meTa.getCapabilities()._omitsColon && - responseToMatch[responseToMatch.length() - 1] == ':' && - answer.substr(0, responseToMatch.length() - 1) == - responseToMatch.substr(0, responseToMatch.length() - 1)) - return normalize(answer.substr(responseToMatch.length() - 1, - answer.length() - - responseToMatch.length() + 1)); - assert(0); - return ""; -} - -void GsmAt::throwCmeException(string s) throw(GsmException) -{ - if (matchResponse(s, "ERROR")) - throw GsmException(_("unspecified ME/TA error"), ChatError); - - bool meError = matchResponse(s, "+CME ERROR:"); - if (meError) - s = cutResponse(s, "+CME ERROR:"); - else - s = cutResponse(s, "+CMS ERROR:"); - istrstream is(s.c_str()); - int error; - is >> error; - throw GsmException(_("ME/TA error '") + - (meError ? getMEErrorText(error) : - getSMSErrorText(error)) + - "' " + - stringPrintf(_("(code %s)"), s.c_str()), - ChatError, error); -} - -GsmAt::GsmAt(MeTa &meTa) : - _meTa(meTa), _port(meTa.getPort()), _eventHandler(NULL) -{ -} - -string GsmAt::chat(string atCommand, string response, - bool ignoreErrors, bool acceptEmptyResponse) - throw(GsmException) -{ - string dummy; - return chat(atCommand, response, dummy, ignoreErrors, false, - acceptEmptyResponse); -} - -string GsmAt::chat(string atCommand, string response, string &pdu, - bool ignoreErrors, bool expectPdu, - bool acceptEmptyResponse) throw(GsmException) -{ - string s; - bool gotOk = false; // special handling for empty SMS entries - - // send AT command - 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 || - ((response.length() == 0 || !matchResponse(s, response)) && - (expect.length() > 0 && matchResponse(s, expect)))); - - // handle errors - if (matchResponse(s, "+CME ERROR:") || matchResponse(s, "+CMS ERROR:")) - if (ignoreErrors) - return ""; - else - throwCmeException(s); - if (matchResponse(s, "ERROR")) - if (ignoreErrors) - return ""; - else - throw GsmException(_("ME/TA error '' (code not known)"), - ChatError, -1); - - // return if response is "OK" and caller says this is OK - if (acceptEmptyResponse && s == "OK") - return ""; - - // handle PDU if one is expected - if (expectPdu) - { - string ps; - do - { - ps = normalize(getLine()); - } - while (ps.length() == 0 && ps != "OK"); - if (ps == "OK") - gotOk = true; - else - { - pdu = ps; - // remove trailing zero added by some devices (e.g. Falcom A2-1) - if (pdu.length() > 0 && pdu[pdu.length() - 1] == 0) - pdu.erase(pdu.length() - 1); - } - } - - // handle expected response - if (response.length() == 0) // no response expected - { - if (s == "OK") return ""; - // else fall through to error - } - else - { - string result; - // some TA/TEs don't prefix their response with the response string - // as proscribed by the standard: just handle either case - if (matchResponse(s, response)) - result = cutResponse(s, response); - else - result = s; - - if (gotOk) - return result; - else - { - // get the final "OK" - do - { - s = normalize(getLine()); - } - while (s.length() == 0); - - if (s == "OK") return result; - // else fall through to error - } - } - throw GsmException( - stringPrintf(_("unexpected response '%s' when sending 'AT%s'"), - s.c_str(), atCommand.c_str()), - ChatError); -} - -vector GsmAt::chatv(string atCommand, string response, - bool ignoreErrors) throw(GsmException) -{ - string s; - vector result; - - // send AT command - putLine("AT" + atCommand); - // and gobble up CR/LF (and possibly echoed characters if echo can't be - // switched off) - do - { - s = normalize(getLine()); - } - while (s.length() == 0 || s == "AT" + atCommand); - - // handle errors - if (matchResponse(s, "+CME ERROR:") || matchResponse(s, "+CMS ERROR:")) - if (ignoreErrors) - return result; - else - throwCmeException(s); - if (matchResponse(s, "ERROR")) - if (ignoreErrors) - return result; - else - throw GsmException(_("ME/TA error '' (code not known)"), - ChatError, -1); - - // push all lines that are not empty - // cut response prefix if it is there - // stop when an OK line is read - while (1) - { - if (s == "OK") - return result; - // some TA/TEs don't prefix their response with the response string - // as proscribed by the standard: just handle either case - if (response.length() != 0 && matchResponse(s, response)) - result.push_back(cutResponse(s, response)); - else - result.push_back(s); - // get next line - do - { - s = normalize(getLine()); - } - while (s.length() == 0); - reportProgress(); - } - - // never reached - assert(0); - return result; -} - -string GsmAt::normalize(string s) -{ - size_t start = 0, end = s.length(); - bool changed = true; - - while (start < end && changed) - { - changed = false; - if (isspace(s[start])) - { - ++start; - changed = true; - } - else - if (isspace(s[end - 1])) - { - --end; - changed = true; - } - } - return s.substr(start, end - start); -} - -string GsmAt::sendPdu(string atCommand, string response, string pdu, - bool acceptEmptyResponse) throw(GsmException) -{ - string s; - bool errorCondition; - bool retry = false; - int tries = 5; // How many error conditions do we accept - - int c; - do - { - errorCondition = false; - putLine("AT" + atCommand); - do - { - retry = false; - try - { - do - { - // read first of two bytes "> " - c = readByte(); - } - // there have been reports that some phones give spurious CRs - // LF separates CDSI messages if there are more than one - while (c == CR || c == LF); - } - catch (GsmException &e) - { - c = '-'; - errorCondition = true; // TA does not expect PDU anymore, retry - } - - if (c == '+' || c == 'E') // error or unsolicited result code - { - _port->putBack(c); - s = normalize(getLine()); - errorCondition = (s != ""); - - retry = ! errorCondition; - } - } - while (retry); - } - while (errorCondition && tries--); - - if (! errorCondition) - { - - if (c != '>' || readByte() != ' ') - throw GsmException(_("unexpected character in PDU handshake"), - ChatError); - - putLine(pdu + "\032", false); // write pdu followed by CTRL-Z - - // some phones (Ericcson T68, T39) send spurious zero characters after - // accepting the PDU - c = readByte(); - if (c != 0) - _port->putBack(c); - - // loop while empty lines (maybe with a zero, Ericsson T39m) - // or an echo of the pdu (with or without CTRL-Z) - // is read - do - { - s = normalize(getLine()); - } - while (s.length() == 0 || s == pdu || s == (pdu + "\032") || - (s.length() == 1 && s[0] == 0)); - } - - // handle errors - if (matchResponse(s, "+CME ERROR:") || matchResponse(s, "+CMS ERROR:")) - throwCmeException(s); - if (matchResponse(s, "ERROR")) - throw GsmException(_("ME/TA error '' (code not known)"), - ChatError, -1); - - // return if response is "OK" and caller says this is OK - if (acceptEmptyResponse && s == "OK") - return ""; - - if (matchResponse(s, response)) - { - string result = cutResponse(s, response); - // get the final "OK" - do - { - s = normalize(getLine()); - } - while (s.length() == 0); - - if (s == "OK") return result; - // else fall through to error - } - throw GsmException( - stringPrintf(_("unexpected response '%s' when sending 'AT%s'"), - s.c_str(), atCommand.c_str()), - ChatError); -} - -string GsmAt::getLine() throw(GsmException) -{ - if (_eventHandler == (GsmEvent*)NULL) - return _port->getLine(); - else - { - bool eventOccurred; - string result; - do - { - eventOccurred = false; - result = _port->getLine(); - string s = normalize(result); - if (matchResponse(s, "+CMT:") || - matchResponse(s, "+CBM:") || - matchResponse(s, "+CDS:") || - matchResponse(s, "+CMTI:") || - matchResponse(s, "+CBMI:") || - matchResponse(s, "+CDSI:") || - matchResponse(s, "RING") || - matchResponse(s, "NO CARRIER") || - // hack: the +CLIP? sequence returns +CLIP: n,m - // which is NOT an unsolicited result code - (matchResponse(s, "+CLIP:") && s.length() > 10)) - { - _eventHandler->dispatch(s, *this); - eventOccurred = true; - } - } - while (eventOccurred); - return result; - } -} - -void GsmAt::putLine(string line, - bool carriageReturn) throw(GsmException) -{ - _port->putLine(line, carriageReturn); - // remove empty echo line - if (carriageReturn) - getLine(); -} - -bool GsmAt::wait(GsmTime timeout) throw(GsmException) -{ - return _port->wait(timeout); -} - -int GsmAt::readByte() throw(GsmException) -{ - return _port->readByte(); -} - -GsmEvent *GsmAt::setEventHandler(GsmEvent *newHandler) -{ - GsmEvent *result = _eventHandler; - _eventHandler = newHandler; - return result; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_at.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_at.h deleted file mode 100644 index 96c3359425..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_at.h +++ /dev/null @@ -1,104 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_at.h -// * -// * Purpose: Utility classes for AT command sequence handling -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 3.5.1999 -// ************************************************************************* - -#ifndef GSM_AT_H -#define GSM_AT_H - -#include -#include -#include - -using namespace std; - -namespace gsmlib -{ - // forward declarations - - class GsmEvent; - class MeTa; - - // utiliy class to handle AT sequences - - class GsmAt : public RefBase - { - protected: - MeTa &_meTa; - Ref _port; - GsmEvent *_eventHandler; - - // return true if response matches - bool matchResponse(string answer, string responseToMatch); - - // cut response and normalize - string cutResponse(string answer, string responseToMatch); - - // parse CME error contained in string and throw MeTaException - void throwCmeException(string s) throw(GsmException); - - public: - GsmAt(MeTa &meTa); - - // return MeTa object for this AT object - MeTa &getMeTa() {return _meTa;} - - // the following sequence functions recognize asynchronous messages - // from the TA and return the appropriate event - - // send AT command, wait for response response, returns response line - // without response match - // if response == "" only an OK is expected - // white space at beginning or end are removed - // +CME ERROR or ERROR raises exception (if ignoreErrors == true) - // additionally, accept empty responses (just an OK) - // if acceptEmptyResponse == true - // in this case an empty string is returned - string chat(string atCommand = "", - string response = "", - bool ignoreErrors = false, - bool acceptEmptyResponse = false) throw(GsmException); - - // same as chat() above but also get pdu if expectPdu == true - string chat(string atCommand, - string response, - string &pdu, - bool ignoreErrors = false, - bool expectPdu = true, - bool acceptEmptyResponse = false) throw(GsmException); - - // same as above, but expect several response lines - vector chatv(string atCommand = "", - string response = "", - bool ignoreErrors = false) - throw(GsmException); - - // removes whitespace at beginning and end of string - string normalize(string s); - - // send pdu (wait for and send - // at the end - // return text after response - string sendPdu(string atCommand, string response, string pdu, - bool acceptEmptyResponse = false) throw(GsmException); - - // functions from class Port - string getLine() throw(GsmException); - void putLine(string line, - bool carriageReturn = true) throw(GsmException); - bool wait(GsmTime timeout) throw(GsmException); - int readByte() throw(GsmException); - - // set event handler class, return old one - GsmEvent *setEventHandler(GsmEvent *newHandler); - }; -}; - -#endif // GSM_AT_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_cb.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_cb.cc deleted file mode 100644 index 37c0e4aae7..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_cb.cc +++ /dev/null @@ -1,176 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_cb.cc -// * -// * Purpose: Cell Broadcast Message Implementation -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 4.8.2001 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -// local constants - -static const string dashes = -"---------------------------------------------------------------------------"; - -// CBDataCodingScheme members - -CBDataCodingScheme::CBDataCodingScheme(unsigned char dcs) : _dcs(dcs) -{ - if ((_dcs & 0xf0) <= 0x30) // bits 7..4 in the range 0000..0011 - if ((_dcs & 0x30) == 0) - _language = (Language)_dcs; - else - _language = Unknown; -} - -string CBDataCodingScheme::toString() const -{ - string result; - if (compressed()) result += _("compressed "); - switch (getLanguage()) - { - case German: - result += _("German"); - break; - case English: - result += _("English"); - break; - case Italian: - result += _("Italian"); - break; - case French: - result += _("French"); - break; - case Spanish: - result += _("Spanish"); - break; - case Dutch: - result += _("Dutch"); - break; - case Swedish: - result += _("Swedish"); - break; - case Danish: - result += _("Danish"); - break; - case Portuguese: - result += _("Portuguese"); - break; - case Finnish: - result += _("Finnish"); - break; - case Norwegian: - result += _("Norwegian"); - break; - case Greek: - result += _("Greek"); - break; - case Turkish: - result += _("Turkish"); - break; - } - result += " "; - switch (getAlphabet()) - { - case DCS_DEFAULT_ALPHABET: - result += _("default alphabet"); - break; - case DCS_EIGHT_BIT_ALPHABET: - result += _("8-bit alphabet"); - break; - case DCS_SIXTEEN_BIT_ALPHABET: - result += _("16-bit alphabet"); - break; - case DCS_RESERVED_ALPHABET: - result += _("reserved alphabet"); - break; - } - return result; -} - -// CBMessage members - -CBMessage::CBMessage(string pdu) throw(GsmException) -{ - SMSDecoder d(pdu); - _messageCode = d.getInteger(6) << 4; - _geographicalScope = (GeographicalScope)d.get2Bits(); - _updateNumber = d.getInteger(4); - _messageCode |= d.getInteger(4); - _messageIdentifier = d.getInteger(8) << 8; - _messageIdentifier |= d.getInteger(8); - _dataCodingScheme = CBDataCodingScheme(d.getOctet()); - _totalPageNumber = d.getInteger(4); - _currentPageNumber = d.getInteger(4); - - // the values 82 and 93 come from ETSI GSM 03.41, section 9.3 - d.markSeptet(); - if (_dataCodingScheme.getAlphabet() == DCS_DEFAULT_ALPHABET) - { - _data = d.getString(93); - _data = gsmToLatin1(_data); - } - else - { - unsigned char *s = - (unsigned char*)alloca(sizeof(unsigned char) * 82); - d.getOctets(s, 82); - _data.assign((char*)s, (unsigned int)82); - } -} - -string CBMessage::toString() const -{ - ostrstream os; - os << dashes << endl - << _("Message type: CB") << endl - << _("Geographical scope: "); - switch (_geographicalScope) - { - case CellWide: - os << "Cell wide" << endl; - break; - case PLMNWide: - os << "PLMN wide" << endl; - break; - case LocationAreaWide: - os << "Location area wide" << endl; - break; - case CellWide2: - os << "Cell wide (2)" << endl; - break; - } - // remove trailing \r characters for output - string data = _data; - string::iterator i; - for (i = data.end(); i > data.begin() && *(i - 1) == '\r'; - --i); - data.erase(i, data.end()); - - os << _("Message Code: ") << _messageCode << endl - << _("Update Number: ") << _updateNumber << endl - << _("Message Identifer: ") << _messageIdentifier << endl - << _("Data coding scheme: ") << _dataCodingScheme.toString() << endl - << _("Total page number: ") << _totalPageNumber << endl - << _("Current page number: ") << _currentPageNumber << endl - << _("Data: '") << data << "'" << endl - << dashes << endl << endl << ends; - char *ss = os.str(); - string result(ss); - delete[] ss; - return result; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_cb.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_cb.h deleted file mode 100644 index 3457c8105c..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_cb.h +++ /dev/null @@ -1,106 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_cb.h -// * -// * Purpose: Cell Broadcast Message Implementation -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 4.8.2001 -// ************************************************************************* - -#ifndef GSM_CB_H -#define GSM_CB_H - -#include -#include -#include - -using namespace std; - -namespace gsmlib -{ - // representation of DataCodingScheme - // The data coding scheme is described in detail in ETSI GSM 03.38, section 5 - // This class reuses the DCS_* constants from DataCodingScheme in - // gsm_sms_codec - - class CBDataCodingScheme - { - public: - enum Language {German = 0, English = 1, Italian = 2, French = 3, - Spanish = 4, Dutch = 5, Swedish = 6, Danish = 7, - Portuguese = 8, Finnish = 9, Norwegian = 10, Greek = 11, - Turkish = 12, Unknown = 1000}; - - private: - unsigned char _dcs; - Language _language; - - public: - // initialize with data coding scheme octet - CBDataCodingScheme(unsigned char dcs); - - // default constructor - CBDataCodingScheme() : _dcs(DCS_DEFAULT_ALPHABET), _language(English) {} - - // return language of CBM - Language getLanguage() const {return _language;} - - // return compression level (if language == Unknown) - bool compressed() const {return (_dcs & DCS_COMPRESSED) == DCS_COMPRESSED;} - - // return type of alphabet used - // (DCS_DEFAULT_ALPHABET, DCS_EIGHT_BIT_ALPHABET, DCS_SIXTEEN_BIT_ALPHABET, - // DCS_RESERVED_ALPHABET) - unsigned char getAlphabet() const - {return _language == Unknown ? _dcs & (3 << 2) : DCS_DEFAULT_ALPHABET;} - - // create textual representation of CB data coding scheme - string toString() const; - }; - - // representation of Cell Broadcast message (CBM) - // The CBM format is described in detail in ETSI GSM 03.41, section 9.3 - - class CBMessage : public RefBase - { - public: - enum GeographicalScope {CellWide, PLMNWide, LocationAreaWide, - CellWide2}; - - private: - // fields parsed from the CB TPDU - GeographicalScope _geographicalScope; - int _messageCode; - int _updateNumber; - int _messageIdentifier; - CBDataCodingScheme _dataCodingScheme; - int _totalPageNumber; - int _currentPageNumber; - string _data; - - public: - // constructor with given pdu - CBMessage(string pdu) throw(GsmException); - - // accessor functions - GeographicalScope getGeographicalScope() const {return _geographicalScope;} - int getMessageCode() const {return _messageCode;} - int getUpdateNumber() const {return _updateNumber;} - int getMessageIdentifier() const {return _messageIdentifier;} - CBDataCodingScheme getDataCodingScheme() const {return _dataCodingScheme;} - int getTotalPageNumber() const {return _totalPageNumber;} - int getCurrentPageNumber() const {return _currentPageNumber;} - string getData() const {return _data;} - - // create textual representation of CBM - string toString() const; - }; - - // some useful typdefs - typedef Ref CBMessageRef; -}; - -#endif // GSM_CB_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_error.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_error.cc deleted file mode 100644 index 2cf9179ede..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_error.cc +++ /dev/null @@ -1,424 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_error.cc -// * -// * Purpose: Error codes and error handling functions -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 11.5.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -string gsmlib::getMEErrorText(const int errorCode) throw(GsmException) -{ - switch (errorCode) - { - case ME_PHONE_FAILURE: - return _("phone failure"); - break; - case ME_NO_CONNECTION_TO_PHONE: - return _("no connection to phone"); - break; - case ME_PHONE_ADAPTOR_LINK_RESERVED: - return _("phone adaptor link reserved"); - break; - case ME_OPERATION_NOT_ALLOWED: - return _("operation not allowed"); - break; - case ME_OPERATION_NOT_SUPPORTED: - return _("operation not supported"); - break; - case ME_PH_SIM_PIN_REQUIRED: - return _("ph SIM PIN required"); - break; - case ME_SIM_NOT_INSERTED: - return _("SIM not inserted"); - break; - case ME_SIM_PIN_REQUIRED: - return _("SIM PIN required"); - break; - case ME_SIM_PUK_REQUIRED: - return _("SIM PUK required"); - break; - case ME_SIM_FAILURE: - return _("SIM failure"); - break; - case ME_SIM_BUSY: - return _("SIM busy"); - break; - case ME_SIM_WRONG: - return _("SIM wrong"); - break; - case ME_INCORRECT_PASSWORD: - return _("incorrect password"); - break; - case ME_SIM_PIN2_REQUIRED: - return _("SIM PIN2 required"); - break; - case ME_SIM_PUK2_REQUIRED: - return _("SIM PUK2 required"); - break; - case ME_MEMORY_FULL: - return _("memory full"); - break; - case ME_INVALID_INDEX: - return _("invalid index"); - break; - case ME_NOT_FOUND: - return _("not found"); - break; - case ME_MEMORY_FAILURE: - return _("memory failure"); - break; - case ME_TEXT_STRING_TOO_LONG: - return _("text string too long"); - break; - case ME_INVALID_CHARACTERS_IN_TEXT_STRING: - return _("invalid characters in text string"); - break; - case ME_DIAL_STRING_TOO_LONG: - return _("dial string too long"); - break; - case ME_INVALID_CHARACTERS_IN_DIAL_STRING: - return _("invalid characters in dial string"); - break; - case ME_NO_NETWORK_SERVICE: - return _("no network service"); - break; - case ME_NETWORK_TIMEOUT: - return _("network timeout"); - break; - case ME_UNKNOWN: - return _("unknown"); - break; - default: - throw GsmException(stringPrintf(_("invalid ME error %d"), errorCode), - OtherError); - } -} - -string gsmlib::getSMSErrorText(const int errorCode) throw(GsmException) -{ - switch (errorCode) - { - case SMS_UNASSIGNED_OR_UNALLOCATED_NUMBER: - return _("Unassigned (unallocated) number"); - break; - case SMS_OPERATOR_DETERMINED_BARRING: - return _("Operator determined barring"); - break; - case SMS_CALL_BARRED: - return _("Call barred"); - break; - case SMS_NETWORK_FAILURE: - return _("Network failure"); - break; - case SMS_SHORT_MESSAGE_TRANSFER_REJECTED: - return _("Short message transfer rejected"); - break; - case SMS_CONGESTION: - case SMS_CONGESTION2: - return _("Congestion"); - break; - case SMS_DESTINATION_OUT_OF_SERVICE: - return _("Destination out of service"); - break; - case SMS_UNIDENTIFIED_SUBSCRIBER: - return _("Unidentified subscriber"); - break; - case SMS_FACILITY_REJECTED: - return _("Facility rejected"); - break; - case SMS_UNKNOWN_SUBSCRIBER: - return _("Unknown subscriber"); - break; - case SMS_NETWORK_OUT_OF_ORDER: - return _("Network out of order"); - break; - case SMS_TEMPORARY_FAILURE: - return _("Temporary failure"); - break; - case SMS_RESOURCES_UNAVAILABLE_UNSPECIFIED: - return _("Resources unavailable, unspecified"); - break; - case SMS_REQUESTED_FACILITY_NOT_SUBSCRIBED: - return _("Requested facility not subscribed"); - break; - case SMS_REQUESTED_FACILITY_NOT_IMPLEMENTED: - return _("Requested facility not implemented"); - break; - case SMS_INVALID_TRANSACTION_IDENTIFIER: - return _("Invalid Transaction Identifier"); - break; - case SMS_SEMANTICALLY_INCORRECT_MESSAGE: - return _("Semantically incorrect message"); - break; - case SMS_INVALID_MANDATORY_INFORMATION: - return _("Invalid mandatory information"); - break; - case SMS_MESSAGE_TYPE_NONEXISTENT_OR_NOT_IMPLEMENTED: - return _("Message type non-existent or not implemented"); - break; - case SMS_MESSAGE_NOT_COMPATIBLE_WITH_SHORT_MESSAGE_PROTOCOL_STATE: - return _("Message not compatible with short message protocol state"); - break; - case SMS_INFORMATION_ELEMENT_NONEXISTENT_OR_NOT_IMPLEMENTED: - return _("Information element non-existent or not implemented"); - break; - case SMS_UNSPECIFIED_PROTOCOL_ERROR: - return _("Protocol error, unspecified"); - break; - case SMS_UNSPECIFIED_INTERWORKING_ERROR: - return _("Interworking, unspecified"); - break; - case SMS_TELEMATIC_INTERWORKING_NOT_SUPPORTED: - return _("Telematic interworking not supported"); - break; - case SMS_SHORT_MESSAGE_TYPE_0_NOT_SUPPORTED: - return _("Short message Type 0 not supported"); - break; - case SMS_CANNOT_REPLACE_SHORT_MESSAGE: - return _("Cannot replace short message"); - break; - case SMS_UNSPECIFIED_TP_PID_ERROR: - return _("Unspecified TP-PID error"); - break; - case SMS_DATA_CODING_SCHEME_NOT_SUPPORTED: - return _("Data coding scheme (alphabet) not supported"); - break; - case SMS_MESSAGE_CLASS_NOT_SUPPORTED: - return _("Message class not supported"); - break; - case SMS_UNSPECIFIEC_TP_DCS_ERROR: - return _("Unspecifiec TP-DCS error"); - break; - case SMS_COMMAND_CANNOT_BE_ACTIONED: - return _("Command cannot be actioned"); - break; - case SMS_COMMAND_UNSUPPORTED: - return _("Command unsupported"); - break; - case SMS_UNSPECIFIED_TP_COMMAND_ERROR: - return _("Unspecified TP-Command error"); - break; - case SMS_TPDU_NOT_SUPPORTED: - return _("TPDU not supported"); - break; - case SMS_SC_BUSY: - return _("SC busy"); - break; - case SMS_NO_SC_SUBSCRIPTION: - return _("No SC subscription"); - break; - case SMS_SC_SYSTEM_FAILURE: - return _("SC system failure"); - break; - case SMS_INVALID_SME_ADDRESS: - return _("Invalid SME address"); - break; - case SMS_DESTINATION_SME_BARRED: - return _("Destination SME barred"); - break; - case SMS_SM_REJECTED_DUPLICATED_SM: - return _("SM Rejected-Duplicated SM"); - break; - case SMS_SIM_SMS_STORAGE_FULL: - return _("SIM SMS storage full"); - break; - case SMS_NO_SMS_STORAGE_CAPABILITY_IN_SIM: - return _("No SMS storage capability in SIM"); - break; - case SMS_ERROR_IN_MS: - return _("Error in MS"); - break; - case SMS_MEMORY_CAPACITY_EXCEED: - return _("Memory Capacity Exceed"); - break; - case SMS_UNSPECIFIED_ERROR_CAUSE: - return _("Unspecified error cause"); - break; - case SMS_ME_FAILURE: - return _("ME failure"); - break; - case SMS_SMS_SERVICE_OF_ME_RESERVED: - return _("SMS service of ME reserved"); - break; - case SMS_OPERATION_NOT_ALLOWED: - return _("operation not allowed"); - break; - case SMS_OPERATION_NOT_SUPPORTED: - return _("operation not supported"); - break; - case SMS_INVALID_PDU_MODE_PARAMETER: - return _("invalid PDU mode parameter"); - break; - case SMS_INVALID_TEXT_MODE_PARAMETER: - return _("invalid text mode parameter"); - break; - case SMS_SIM_NOT_INSERTED: - return _("SIM not inserted"); - break; - case SMS_SIM_PIN_REQUIRED: - return _("SIM PIN required"); - break; - case SMS_PH_SIM_PIN_REQUIRED: - return _("PH-SIM PIN required"); - break; - case SMS_SIM_FAILURE: - return _("SIM failure"); - break; - case SMS_SIM_BUSY: - return _("SIM busy"); - break; - case SMS_SIM_WRONG: - return _("SIM wrong"); - break; - case SMS_SIM_PUK_REQUIRED: - return _("SIM PUK required"); - break; - case SMS_SIM_PIN2_REQUIRED: - return _("SIM PIN2 required"); - break; - case SMS_SIM_PUK2_REQUIRED: - return _("SIM PUK2 required"); - break; - case SMS_MEMORY_FAILURE: - return _("memory failure"); - break; - case SMS_INVALID_MEMORY_INDEX: - return _("invalid memory index"); - break; - case SMS_MEMORY_FULL: - return _("memory full"); - break; - case SMS_SMSC_ADDRESS_UNKNOWN: - return _("SMSC address unknown"); - break; - case SMS_NO_NETWORK_SERVICE: - return _("no network service"); - break; - case SMS_NETWORK_TIMEOUT: - return _("network timeout"); - break; - case SMS_NO_CNMA_ACKNOWLEDGEMENT_EXPECTED: - return _("no +CNMA acknowledgement expected"); - break; - case SMS_UNKNOWN_ERROR: - return _("unknown error"); - break; - default: - throw GsmException(stringPrintf(_("invalid SMS error %d"), errorCode), - OtherError); - } -} - -string gsmlib::getSMSStatusString(unsigned char status) -{ - string result; - if (status < SMS_STATUS_TEMPORARY_BIT) - { - switch (status) - { - case SMS_STATUS_RECEIVED: - result = _("Short message received by the SME"); - break; - case SMS_STATUS_FORWARDED: - result = _("Short message forwarded by the SC to the SME but the SC " - "is unable to confirm delivery"); - break; - case SMS_STATUS_SM_REPLACES: - result = _("Short message replaced by the SC"); - break; - default: - result = _("reserved"); - break; - } - return result; - } - else if (status & SMS_STATUS_TEMPORARY_BIT) - { - switch (status & ~(SMS_STATUS_TEMPORARY_BIT | SMS_STATUS_PERMANENT_BIT)) - { - case SMS_STATUS_CONGESTION: - result = _("Congestion"); - break; - case SMS_STATUS_SME_BUSY: - result = _("SME busy"); - break; - case SMS_STATUS_NO_RESPONSE_FROM_SME: - result = _("No response from SME"); - break; - case SMS_STATUS_SERVICE_REJECTED: - result = _("Service rejected"); - break; - case SMS_STATUS_QUALITY_OF_SERVICE_UNAVAILABLE: - result = _("Quality of service not available"); - break; - case SMS_STATUS_ERROR_IN_SME: - result = _("Error in SME"); - break; - default: - result = _("reserved"); - break; - } - if (status & SMS_STATUS_PERMANENT_BIT) - return result + _(" (Temporary error, SC is not making any " - "more transfer attempts)"); - else - return result + _(" (Temporary error, SC still trying to " - "transfer SM)"); - } - else - { - switch (status & ~SMS_STATUS_PERMANENT_BIT) - { - case SMS_STATUS_REMOTE_PROCECURE_ERROR: - result = _("Remote Procedure Error"); - break; - case SMS_STATUS_INCOMPATIBLE_DESTINATION: - result = _("Incompatible destination"); - break; - case SMS_STATUS_CONNECTION_REJECTED_BY_SME: - result = _("Connection rejected by SME"); - break; - case SMS_STATUS_NOT_OBTAINABLE: - result = _("Not obtainable"); - break; - case SMS_STATUS_QUALITY_OF_SERVICE_UNAVAILABLE: - result = _("Quality of service not available"); - break; - case SMS_STATUS_NO_INTERWORKING_AVAILABLE: - result = _("No interworking available"); - break; - case SMS_STATUS_SM_VALIDITY_PERDIOD_EXPIRED: - result = _("SM validity period expired"); - break; - case SMS_STATUS_SM_DELETED_BY_ORIGINATING_SME: - result = _("SM deleted by originating SME"); - break; - case SMS_STATUS_SM_DELETED_BY_ADMINISTRATION: - result = _("SM deleted by SC administration"); - break; - case SMS_STATUS_SM_DOES_NOT_EXIST: - result = _("SM does not exit"); - break; - default: - result = _("reserved"); - break; - } - return result + _(" (Permanent Error, SC is not making any " - "more transfer attempts)"); - } -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_error.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_error.h deleted file mode 100644 index 5dc96538e3..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_error.h +++ /dev/null @@ -1,209 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_error.h -// * -// * Purpose: Error codes and error handling functions -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 4.5.1999 -// ************************************************************************* - -#ifndef GSM_ERROR_H -#define GSM_ERROR_H - -#include -#include - -using namespace std; - -namespace gsmlib -{ - // different classes of GSM errors - enum GsmErrorClass{OSError, // error caused by OS call (eg. file handling) - ParserError, // error when parsing AT response - ChatError, // error in chat sequence (ME/TA/SMS error) - ParameterError, // gsmlib function called with bad params - NotImplementedError, // feature not implemented - MeTaCapabilityError, // non-existent capability in ME - SMSFormatError, // SMS format error - InterruptException, // gsmlib was interrupted() - OtherError}; // all other errors - - // all gsmlib exceptions - - class GsmException : public runtime_error - { - private: - GsmErrorClass _errorClass; - int _errorCode; - - public: - GsmException(string errorText, GsmErrorClass errorClass) : - runtime_error(errorText), _errorClass(errorClass), _errorCode(-1) {} - - GsmException(string errorText, GsmErrorClass errorClass, int errorCode) : - runtime_error(errorText), _errorClass(errorClass), - _errorCode(errorCode) {} - - int getErrorCode() const {return _errorCode;} - - GsmErrorClass getErrorClass() const {return _errorClass;} - }; - - // error codes returned by TA/ME (+CMEE) - - const int ME_PHONE_FAILURE = 0; - const int ME_NO_CONNECTION_TO_PHONE = 1; - const int ME_PHONE_ADAPTOR_LINK_RESERVED = 2; - const int ME_OPERATION_NOT_ALLOWED = 3; - const int ME_OPERATION_NOT_SUPPORTED = 4; - const int ME_PH_SIM_PIN_REQUIRED = 5; - const int ME_SIM_NOT_INSERTED = 10; - const int ME_SIM_PIN_REQUIRED = 11; - const int ME_SIM_PUK_REQUIRED = 12; - const int ME_SIM_FAILURE = 13; - const int ME_SIM_BUSY = 14; - const int ME_SIM_WRONG = 15; - const int ME_INCORRECT_PASSWORD = 16; - const int ME_SIM_PIN2_REQUIRED = 17; - const int ME_SIM_PUK2_REQUIRED = 18; - const int ME_MEMORY_FULL = 20; - const int ME_INVALID_INDEX = 21; - const int ME_NOT_FOUND = 22; - const int ME_MEMORY_FAILURE = 23; - const int ME_TEXT_STRING_TOO_LONG = 24; - const int ME_INVALID_CHARACTERS_IN_TEXT_STRING = 25; - const int ME_DIAL_STRING_TOO_LONG = 26; - const int ME_INVALID_CHARACTERS_IN_DIAL_STRING = 27; - const int ME_NO_NETWORK_SERVICE = 30; - const int ME_NETWORK_TIMEOUT = 31; - const int ME_UNKNOWN = 100; - - // return descriptive text for the given error code - // the text is already translated - extern string getMEErrorText(const int errorCode) throw(GsmException); - - // SMS error codes - - // error codes from ETSI GSM 04.11, Annex E - const int SMS_UNASSIGNED_OR_UNALLOCATED_NUMBER = 1; - const int SMS_OPERATOR_DETERMINED_BARRING = 8; - const int SMS_CALL_BARRED = 10; - const int SMS_NETWORK_FAILURE = 17; - const int SMS_SHORT_MESSAGE_TRANSFER_REJECTED = 21; - const int SMS_CONGESTION = 22; - const int SMS_DESTINATION_OUT_OF_SERVICE = 27; - const int SMS_UNIDENTIFIED_SUBSCRIBER = 28; - const int SMS_FACILITY_REJECTED = 29; - const int SMS_UNKNOWN_SUBSCRIBER = 30; - const int SMS_NETWORK_OUT_OF_ORDER = 38; - const int SMS_TEMPORARY_FAILURE = 41; - const int SMS_CONGESTION2 = 42; - const int SMS_RESOURCES_UNAVAILABLE_UNSPECIFIED = 47; - const int SMS_REQUESTED_FACILITY_NOT_SUBSCRIBED = 50; - const int SMS_REQUESTED_FACILITY_NOT_IMPLEMENTED = 69; - const int SMS_INVALID_TRANSACTION_IDENTIFIER = 81; - const int SMS_SEMANTICALLY_INCORRECT_MESSAGE = 95; - const int SMS_INVALID_MANDATORY_INFORMATION = 96; - const int SMS_MESSAGE_TYPE_NONEXISTENT_OR_NOT_IMPLEMENTED = 97; - const int SMS_MESSAGE_NOT_COMPATIBLE_WITH_SHORT_MESSAGE_PROTOCOL_STATE = 98; - const int SMS_INFORMATION_ELEMENT_NONEXISTENT_OR_NOT_IMPLEMENTED = 99; - const int SMS_UNSPECIFIED_PROTOCOL_ERROR = 111; - const int SMS_UNSPECIFIED_INTERWORKING_ERROR = 127; - - // error codes from ETSI GSM 03.40, section 9.2.3.22 - const int SMS_TELEMATIC_INTERWORKING_NOT_SUPPORTED = 0x80; - const int SMS_SHORT_MESSAGE_TYPE_0_NOT_SUPPORTED = 0x81; - const int SMS_CANNOT_REPLACE_SHORT_MESSAGE = 0x82; - const int SMS_UNSPECIFIED_TP_PID_ERROR = 0x8f; - const int SMS_DATA_CODING_SCHEME_NOT_SUPPORTED = 0x90; - const int SMS_MESSAGE_CLASS_NOT_SUPPORTED = 0x91; - const int SMS_UNSPECIFIEC_TP_DCS_ERROR = 0x9f; - const int SMS_COMMAND_CANNOT_BE_ACTIONED = 0xa0; - const int SMS_COMMAND_UNSUPPORTED = 0xa1; - const int SMS_UNSPECIFIED_TP_COMMAND_ERROR = 0xaf; - const int SMS_TPDU_NOT_SUPPORTED = 0xb0; - const int SMS_SC_BUSY = 0xc0; - const int SMS_NO_SC_SUBSCRIPTION = 0xc1; - const int SMS_SC_SYSTEM_FAILURE = 0xc2; - const int SMS_INVALID_SME_ADDRESS = 0xc3; - const int SMS_DESTINATION_SME_BARRED = 0xc4; - const int SMS_SM_REJECTED_DUPLICATED_SM = 0xc5; - const int SMS_SIM_SMS_STORAGE_FULL = 0xd0; - const int SMS_NO_SMS_STORAGE_CAPABILITY_IN_SIM = 0xd1; - const int SMS_ERROR_IN_MS = 0xd2; - const int SMS_MEMORY_CAPACITY_EXCEED = 0xd3; - const int SMS_UNSPECIFIED_ERROR_CAUSE = 0xff; - - // error codes from ETSI GSM 07.05, section 3.2.5 - const int SMS_ME_FAILURE = 300; - const int SMS_SMS_SERVICE_OF_ME_RESERVED = 301; - const int SMS_OPERATION_NOT_ALLOWED = 302; - const int SMS_OPERATION_NOT_SUPPORTED = 303; - const int SMS_INVALID_PDU_MODE_PARAMETER = 304; - const int SMS_INVALID_TEXT_MODE_PARAMETER = 305; - const int SMS_SIM_NOT_INSERTED = 310; - const int SMS_SIM_PIN_REQUIRED = 311; - const int SMS_PH_SIM_PIN_REQUIRED = 312; - const int SMS_SIM_FAILURE = 313; - const int SMS_SIM_BUSY = 314; - const int SMS_SIM_WRONG = 315; - const int SMS_SIM_PUK_REQUIRED = 316; - const int SMS_SIM_PIN2_REQUIRED = 317; - const int SMS_SIM_PUK2_REQUIRED = 318; - const int SMS_MEMORY_FAILURE = 320; - const int SMS_INVALID_MEMORY_INDEX = 321; - const int SMS_MEMORY_FULL = 322; - const int SMS_SMSC_ADDRESS_UNKNOWN = 330; - const int SMS_NO_NETWORK_SERVICE = 331; - const int SMS_NETWORK_TIMEOUT = 332; - const int SMS_NO_CNMA_ACKNOWLEDGEMENT_EXPECTED = 340; - const int SMS_UNKNOWN_ERROR = 500; - - // return descriptive text for the given error code - // the text is already translated - extern string getSMSErrorText(const int errorCode) throw(GsmException); - - // SMS status handling - // success codes - const int SMS_STATUS_RECEIVED = 0; - const int SMS_STATUS_FORWARDED = 1; - const int SMS_STATUS_SM_REPLACES = 2; - - // if this bit is set, the error is only temporary and - // the SC is still trying to transfer the SM - const int SMS_STATUS_TEMPORARY_BIT = 32; - - // if this bit is set, the error is only temporary and - // the SC is still trying to transfer the SM - const int SMS_STATUS_PERMANENT_BIT = 64; - // both bits may be set at once - - // temporary errors (both bits may be set) - const int SMS_STATUS_CONGESTION = 0; - const int SMS_STATUS_SME_BUSY = 1; - const int SMS_STATUS_NO_RESPONSE_FROM_SME = 2; - const int SMS_STATUS_SERVICE_REJECTED = 3; - const int SMS_STATUS_QUALITY_OF_SERVICE_UNAVAILABLE = 4; - const int SMS_STATUS_ERROR_IN_SME = 5; - - // permanent errors (SMS_STATUS_PERMANENT_BIT is set) - const int SMS_STATUS_REMOTE_PROCECURE_ERROR = 0; - const int SMS_STATUS_INCOMPATIBLE_DESTINATION = 1; - const int SMS_STATUS_CONNECTION_REJECTED_BY_SME = 2; - const int SMS_STATUS_NOT_OBTAINABLE = 3; - // const int SMS_STATUS_QUALITY_OF_SERVICE_UNAVAILABLE = 4; - const int SMS_STATUS_NO_INTERWORKING_AVAILABLE = 5; - const int SMS_STATUS_SM_VALIDITY_PERDIOD_EXPIRED = 6; - const int SMS_STATUS_SM_DELETED_BY_ORIGINATING_SME = 7; - const int SMS_STATUS_SM_DELETED_BY_ADMINISTRATION = 8; - const int SMS_STATUS_SM_DOES_NOT_EXIST = 9; - - // return text for SMS status code - // the text is already translated - string getSMSStatusString(unsigned char status); -}; - -#endif // GSM_ERROR_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_event.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_event.cc deleted file mode 100644 index a608b04f62..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_event.cc +++ /dev/null @@ -1,174 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_event.cc -// * -// * Purpose: Event handler interface -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 7.6.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -// GsmEvent members - -void GsmEvent::dispatch(string s, GsmAt &at) throw(GsmException) -{ - SMSMessageType messageType; - bool indication = false; - if (s.substr(0, 5) == "+CMT:") - messageType = NormalSMS; - else if (s.substr(0, 5) == "+CBM:") - messageType = CellBroadcastSMS; - else if (s.substr(0, 5) == "+CDS:") - { - // workaround for phones that report CDS when they actually mean CDSI - indication = at.getMeTa().getCapabilities()._CDSmeansCDSI; - messageType = StatusReportSMS; - } - else if (s.substr(0, 6) == "+CMTI:") - { - indication = true; - messageType = NormalSMS; - } - else if (s.substr(0, 6) == "+CBMI:") - { - indication = true; - messageType = CellBroadcastSMS; - } - else if (s.substr(0, 6) == "+CDSI:") - { - indication = true; - messageType = StatusReportSMS; - } - else if (s.substr(0, 4) == "RING") - { - ringIndication(); - return; - } - // handling NO CARRIER - else if (s.substr(0, 10) == "NO CARRIER") - { - noAnswer(); - return; - } - - else if (s.substr(0, 6) == "+CLIP:") - { - // ,[,,[,]] - s = s.substr(6); - Parser p(s); - string num = p.parseString(); - if (p.parseComma(true)) - { - unsigned int numberFormat; - if ((numberFormat = p.parseInt()) == InternationalNumberFormat) - num = "+" + num; - else if (numberFormat != UnknownNumberFormat) - throw GsmException(stringPrintf(_("unexpected number format %d"), - numberFormat), OtherError); - } - string subAddr; - string alpha; - if (p.parseComma(true)) - { - subAddr = p.parseString(true); - p.parseComma(); - p.parseInt(true); // FIXME subaddr type ignored - - if (p.parseComma(true)) - alpha = p.parseString(true); - } - - // call the event handler - callerLineID(num, subAddr, alpha); - return; - } - else - throw GsmException(stringPrintf(_("unexpected unsolicited event '%s'"), - s.c_str()), OtherError); - - if (indication) - { - // handle SMS storage indication - s = s.substr(6); - Parser p(s); - string storeName = p.parseString(); - p.parseComma(); - unsigned int index = p.parseInt(); - SMSReceptionIndication(storeName, index - 1, messageType); - } - else - if (messageType == CellBroadcastSMS) - { - // handle CB message - string pdu = at.getLine(); - - CBMessageRef cb = new CBMessage(pdu); - - // call the event handler - CBReception(cb); - } - else - { - // handle SMS - string pdu = at.getLine(); - - // add missing service centre address if required by ME - if (! at.getMeTa().getCapabilities()._hasSMSSCAprefix) - pdu = "00" + pdu; - - SMSMessageRef sms = SMSMessage::decode(pdu); - - // send acknowledgement if necessary - if (at.getMeTa().getCapabilities()._sendAck) - at.chat("+CNMA"); - - // call the event handler - SMSReception(sms, messageType); - } -} - -void GsmEvent::callerLineID(string number, string subAddr, string alpha) -{ - // ignore event -} - -void GsmEvent::SMSReception(SMSMessageRef newMessage, - SMSMessageType messageType) -{ - // ignore event -} - -void GsmEvent::CBReception(CBMessageRef newMessage) -{ - // ignore event -} - -void GsmEvent::SMSReceptionIndication(string storeName, unsigned int index, - SMSMessageType messageType) -{ - // ignore event -} - -void GsmEvent::ringIndication() -{ - // ignore event -} - -void GsmEvent::noAnswer() -{ - // ignore event -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_event.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_event.h deleted file mode 100644 index b2b986cd15..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_event.h +++ /dev/null @@ -1,68 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_event.h -// * -// * Purpose: Event handler interface -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 7.6.1999 -// ************************************************************************* - -#ifndef GSM_EVENT_H -#define GSM_EVENT_H - -#include -#include - -using namespace std; - -namespace gsmlib -{ - // forward declarations - - class GsmAt; - - // event handler interface - - class GsmEvent - { - private: - // dispatch CMT/CBR/CDS/CLIP etc. - void dispatch(string s, GsmAt &at) throw(GsmException); - - public: - // for SMSReception, type of SMS - enum SMSMessageType {NormalSMS, CellBroadcastSMS, StatusReportSMS}; - - // caller line identification presentation - // only called if setCLIPEvent(true) is set - virtual void callerLineID(string number, string subAddr, string alpha); - - // called if the string NO CARRIER is read - virtual void noAnswer(); - - // SMS reception - // only called if setSMSReceptionEvent(...true...) is set - virtual void SMSReception(SMSMessageRef newMessage, - SMSMessageType messageType); - - // CB reception - // only called if setSMSReceptionEvent(...true...) is set - // storage of CBM in ME is not supported by the standard - virtual void CBReception(CBMessageRef newMessage); - - // SMS reception indication (called when SMS is not delivered to TE - // but stored in ME memory) - virtual void SMSReceptionIndication(string storeName, unsigned int index, - SMSMessageType messageType); - - // RING indication - virtual void ringIndication(); - - friend class gsmlib::GsmAt; - }; -}; - -#endif // GSM_EVENT_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_map_key.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_map_key.h deleted file mode 100644 index d47b7e0cd9..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_map_key.h +++ /dev/null @@ -1,128 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_map_key.h -// * -// * Purpose: Common MapKey implementation for the multimaps in -// * gsm_sorted_sms_store and gsm_sorted_phonebook -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 5.11.1999 -// ************************************************************************* - -#ifndef GSM_MAP_KEY_H -#define GSM_MAP_KEY_H - -#include - -namespace gsmlib -{ - // sort order for MapKeys - - enum SortOrder {ByText = 0, ByTelephone = 1, ByIndex = 2, ByDate = 3, - ByType = 4, ByAddress = 5}; - - // wrapper for map key, can access Sortedtore to get sortOrder() - - template class MapKey - { - public: - SortedStore &_myStore; // my store - // different type keys - Address _addressKey; - Timestamp _timeKey; - int _intKey; - string _strKey; - - public: - // constructors for the different sort keys - MapKey(SortedStore &myStore, Address key) : - _myStore(myStore), _addressKey(key) {} - MapKey(SortedStore &myStore, Timestamp key) : - _myStore(myStore), _timeKey(key) {} - MapKey(SortedStore &myStore, int key) : - _myStore(myStore), _intKey(key) {} - MapKey(SortedStore &myStore, string key) : - _myStore(myStore), _strKey(key) {} - -/* - friend - bool operator< -#ifndef WIN32 - <> -#endif - (const MapKey &x, - const MapKey &y); - friend - bool operator== -#ifndef WIN32 - <> -#endif - (const MapKey &x, - const MapKey &y); -*/ - }; - - // compare two keys - template - extern bool operator<(const MapKey &x, - const MapKey &y); - template - extern bool operator==(const MapKey &x, - const MapKey &y); - - // MapKey members - - template - bool operator<(const MapKey &x, - const MapKey &y) - { - assert(&x._myStore == &y._myStore); - - switch (x._myStore.sortOrder()) - { - case ByDate: - return x._timeKey < y._timeKey; - case ByAddress: - return x._addressKey < y._addressKey; - case ByIndex: - case ByType: - return x._intKey < y._intKey; - case ByTelephone: - return Address(x._strKey) < Address(y._strKey); - case ByText: - return x._strKey < y._strKey; - default: - assert(0); - return true; - } - } - - template - bool operator==(const MapKey &x, - const MapKey &y) - { - assert(&x._myStore == &y._myStore); - - switch (x._myStore.sortOrder()) - { - case ByDate: - return x._timeKey == y._timeKey; - case ByAddress: - return x._addressKey == y._addressKey; - case ByIndex: - case ByType: - return x._intKey == y._intKey; - case ByTelephone: - return Address(x._strKey) == Address(y._strKey); - case ByText: - return x._strKey == y._strKey; - default: - assert(0); - return true; - } - } -}; - -#endif // GSM_MAP_KEY_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_me_ta.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_me_ta.cc deleted file mode 100644 index 1f9e84581a..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_me_ta.cc +++ /dev/null @@ -1,1254 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_me_ta.cc -// * -// * Purpose: Mobile Equipment/Terminal Adapter functions -// * (ETSI GSM 07.07) -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 10.5.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include - -#include - -using namespace std; -using namespace gsmlib; - -// Capabilities members - -Capabilities::Capabilities() : - _hasSMSSCAprefix(true), - _cpmsParamCount(-1), // initialize to -1, must be set later by - // setSMSStore() function - _omitsColon(true), // FIXME - _veryShortCOPSanswer(false), // Falcom A2-1 - _wrongSMSStatusCode(false), // Motorola Timeport 260 - _CDSmeansCDSI(false), // Nokia Cellular Card Phone RPE-1 GSM900 and - // Nokia Card Phone RPM-1 GSM900/1800 - _sendAck(false) // send ack for directly routed SMS -{ -} - -// MeTa members - -void MeTa::init() throw(GsmException) -{ - // switch on extended error codes - // caution: may be ignored by some TAs, so allow it to fail - _at->chat("+CMEE=1", "", true, true); - - // select SMS pdu mode - _at->chat("+CMGF=0"); - - // now fill in capability object - MEInfo info = getMEInfo(); - - // Ericsson model 6050102 - if ((info._manufacturer == "ERICSSON" && - (info._model == "1100801" || - info._model == "1140801")) || - getenv("GSMLIB_SH888_FIX") != NULL) - { - // the Ericsson leaves out the service centre address - _capabilities._hasSMSSCAprefix = false; - } - - // handle Falcom strangeness - if ((info._manufacturer == "Funkanlagen Leipoldt OHG" && - info._revision == "01.95.F2") || - getenv("GSMLIB_FALCOM_A2_1_FIX") != NULL) - { - _capabilities._veryShortCOPSanswer = true; - } - - // handle Motorola SMS store bug - wrong status code - if ((info._manufacturer == "Motorola" && - info._model == "L Series")) - { - _capabilities._wrongSMSStatusCode = true; - } - - // handle Nokia Cellular Card Phone RPE-1 GSM900 and - // Nokia Card Phone RPM-1 GSM900/1800 bug - CDS means CDSI - if ((info._manufacturer == "Nokia Mobile Phones" && - (info._model == "Nokia Cellular Card Phone RPE-1 GSM900" || - info._model == "Nokia Card Phone RPM-1 GSM900/1800"))) - { - _capabilities._CDSmeansCDSI = true; - } - - // find out whether we are supposed to send an acknowledgment - Parser p(_at->chat("+CSMS?", "+CSMS:")); - _capabilities._sendAck = p.parseInt() >= 1; - - // set GSM default character set - try - { - setCharSet("GSM"); - } - catch (GsmException) - { - // ignore errors, some devices don't support this - } - - // set default event handler - // necessary to handle at least RING indications that might - // otherwise confuse gsmlib - _at->setEventHandler(&_defaultEventHandler); -} - -MeTa::MeTa(Ref port) throw(GsmException) : _port(port) -{ - // initialize AT handling - _at = new GsmAt(*this); - - init(); -} - -// MeTa::MeTa(Ref at) throw(GsmException) : -// _at(at) -// { -// init(); -// } - -void MeTa::setPIN(string pin) throw(GsmException) -{ - _at->chat("+CPIN=\"" + pin + "\""); -} - -string MeTa::getPINStatus() throw(GsmException) -{ - Parser p(_at->chat("+CPIN?", "+CPIN:")); - return p.parseString(); -} - -void MeTa::setPhonebook(string phonebookName) throw(GsmException) -{ - if (phonebookName != _lastPhonebookName) - { - _at->chat("+CPBS=\"" + phonebookName + "\""); - _lastPhonebookName = phonebookName; - } -} - -string MeTa::setSMSStore(string smsStore, int storeTypes, bool needResultCode) - throw(GsmException) -{ - if (_capabilities._cpmsParamCount == -1) - { - // count the number of parameters for the CPMS AT sequences - _capabilities._cpmsParamCount = 1; - Parser p(_at->chat("+CPMS=?", "+CPMS:")); - p.parseStringList(); - while (p.parseComma(true)) - { - ++_capabilities._cpmsParamCount; - p.parseStringList(); - } - } - - // optimatization: only set current SMS store if different from last call - // or the result code is needed - if (needResultCode || _lastSMSStoreName != smsStore) - { - _lastSMSStoreName = smsStore; - - // build chat string - string chatString = "+CPMS=\"" + smsStore + "\""; - for (int i = 1; i < min(_capabilities._cpmsParamCount, storeTypes); ++i) - chatString += ",\"" + smsStore + "\""; - - return _at->chat(chatString, "+CPMS:"); - } - return ""; -} - -void MeTa::getSMSStore(string &readDeleteStore, - string &writeSendStore, - string &receiveStore) throw(GsmException) -{ - Parser p(_at->chat("+CPMS?", "+CPMS:")); - writeSendStore = receiveStore = ""; - readDeleteStore = p.parseString(); - p.parseComma(); - p.parseInt(); - p.parseComma(); - p.parseInt(); - if (p.parseComma(true)) - { - writeSendStore = p.parseString(); - p.parseComma(); - p.parseInt(); - p.parseComma(); - p.parseInt(); - if (p.parseComma(true)) - { - receiveStore = p.parseString(); - } - } -} - -void MeTa::waitEvent(GsmTime timeout) throw(GsmException) -{ - if (_at->wait(timeout)) - _at->chat(); // send AT, wait for OK, handle events -} - -// aux function for MeTa::getMEInfo() - -static string stringVectorToString(const vector& v, - char separator = '\n') -{ - if (v.empty()) - return ""; - - // concatenate string in vector as rows - string result; - for (vector::const_iterator i = v.begin();;) - { - string s = *i; - // remove leading and trailing "s - if (s.length() > 0 && s[0] == '"') - s.erase(s.begin()); - if (s.length() > 0 && s[s.length() - 1] == '"') - s.erase(s.end() - 1); - - result += s; - // don't add end line to last - if ( ++i == v.end() || !separator) - break; - result += separator; - } - return result; -} - -MEInfo MeTa::getMEInfo() throw(GsmException) -{ - MEInfo result; - // some TAs just return OK and no info line - // leave the info empty in this case - // some TAs return multirows with info like address, firmware version - result._manufacturer = - stringVectorToString(_at->chatv("+CGMI", "+CGMI:", false)); - result._model = stringVectorToString(_at->chatv("+CGMM", "+CGMM:", false)); - result._revision = - stringVectorToString(_at->chatv("+CGMR", "+CGMR:", false)); - result._serialNumber = - stringVectorToString(_at->chatv("+CGSN", "+CGSN:", false),0); - return result; -} - -vector MeTa::getSupportedCharSets() throw(GsmException) -{ - Parser p(_at->chat("+CSCS=?", "+CSCS:")); - return p.parseStringList(); -} - -string MeTa::getCurrentCharSet() throw(GsmException) -{ - if (_lastCharSet == "") - { - Parser p(_at->chat("+CSCS?", "+CSCS:")); - _lastCharSet = p.parseString(); - } - return _lastCharSet; -} - -void MeTa::setCharSet(string charSetName) throw(GsmException) -{ - _at->chat("+CSCS=\"" + charSetName + "\""); - _lastCharSet = ""; -} - -string MeTa::getExtendedErrorReport() throw(GsmException) -{ - return _at->chat("+CEER", "+CEER:"); -} - -void MeTa::dial(string number) throw(GsmException) -{ - _at->chat("D" + number + ";"); -} - -void MeTa::answer() throw(GsmException) -{ - _at->chat("A"); -} - -void MeTa::hangup() throw(GsmException) -{ - _at->chat("H"); - -} - -vector MeTa::getAvailableOPInfo() throw(GsmException) -{ - vector result; - vector responses = _at->chatv("+COPS=?", "+COPS:"); - - // special treatment for Falcom A2-1, answer looks like - // responses.push_back("(1,29341),(3,29340)"); - if (_capabilities._veryShortCOPSanswer) - { - if (responses.size() == 1) - { - Parser p(responses[0]); - while (p.parseChar('(', true)) - { - OPInfo opi; - opi._status = (OPStatus)p.parseInt(); - p.parseComma(); - opi._numericName = p.parseInt(); - p.parseChar(')'); - p.parseComma(true); - result.push_back(opi); - } - } - } - else - // some formats I have encountered... - //responses.push_back("2,,,31017,,(0,1),(2)"); - //responses.push_back("(3,\"UK CELLNET\",\"CLNET\",\"23410\")," - // "(3,\"ONE2 ONE\",\"ONE2ONE\",\"23430\")," - // "(3,\"ORANGE\",\"ORANGE\",\"23433\")"); - //responses.push_back("(2,\"D1-TELEKOM\",,26201)," - // "(3,\"D2 PRIVAT\",,26202),,(0,1,3,4),(0,2)"); - // some phones arbitrarily split the response into several lines - //responses.push_back("(1,\"AMENA\",,\"21403\")," - // "(3,\"MOVISTAR\",,\"21407\"),"); - //responses.push_back("(3,\"E VODAFONE\",,\"21401\"),,(0,1),(2)"); - - // GSM modems might return - // 1. quadruplets of info enclosed in brackets separated by comma - // 2. several lines of quadruplets of info enclosed in brackets - // 3. several lines of quadruplets without brackets and additional - // info at EOL (e.g. Nokia 8290) - for (vector::iterator i = responses.begin(); - i != responses.end(); ++i) - { -// while (i->length() > 0 && ! isprint((*i)[i->length() - 1])) -// i->erase(i->length() - 1, 1); - - bool expectClosingBracket = false; - Parser p(*i); - while (1) - { - OPInfo opi; - expectClosingBracket = p.parseChar('(', true); - int status = p.parseInt(true); - opi._status = (status == NOT_SET ? UnknownOPStatus : (OPStatus)status); - p.parseComma(); - opi._longName = p.parseString(true); - p.parseComma(); - opi._shortName = p.parseString(true); - p.parseComma(); - try - { - opi._numericName = p.parseInt(true); - } - catch (GsmException &e) - { - if (e.getErrorClass() == ParserError) - { - // the Ericsson GM12 GSM modem returns the numeric ID as string - string s = p.parseString(); - opi._numericName = checkNumber(s); - } - else - throw e; - } - if (expectClosingBracket) p.parseChar(')'); - result.push_back(opi); - if (! p.parseComma(true)) break; - // two commas ",," mean the list is finished - if (p.getEol() == "" || p.parseComma(true)) break; - } - // without brackets, the ME/TA must use format 3. - if (! expectClosingBracket) break; - } - return result; -} - -OPInfo MeTa::getCurrentOPInfo() throw(GsmException) -{ - OPInfo result; - - // 1. This exception thing is necessary because not all ME/TA combinations - // might support all the formats and then return "ERROR". - // 2. Additionally some modems return "ERROR" for all "COPS=3,n" command - // and report only one format with the "COPS?" command (e.g. Nokia 8290). - - // get long format - try - { - try - { - _at->chat("+COPS=3,0"); - } - catch (GsmException &e) - { - if (e.getErrorClass() != ChatError) throw; - } - Parser p(_at->chat("+COPS?", "+COPS:")); - result._mode = (OPModes)p.parseInt(); - // some phones (e.g. Nokia Card Phone 2.0) just return "+COPS: 0" - // if no network connection - if (p.parseComma(true)) - { - if (p.parseInt() == 0) - { - p.parseComma(); - result._longName = p.parseString(); - } - } - } - catch (GsmException &e) - { - if (e.getErrorClass() != ChatError) throw; - } - - // get short format - try - { - try - { - _at->chat("+COPS=3,1"); - } - catch (GsmException &e) - { - if (e.getErrorClass() != ChatError) throw; - } - Parser p(_at->chat("+COPS?", "+COPS:")); - result._mode = (OPModes)p.parseInt(); - // some phones (e.g. Nokia Card Phone 2.0) just return "+COPS: 0" - // if no network connection - if (p.parseComma(true)) - { - if (p.parseInt() == 1) - { - p.parseComma(); - result._shortName = p.parseString(); - } - } - } - catch (GsmException &e) - { - if (e.getErrorClass() != ChatError) throw; - } - - // get numeric format - try - { - try - { - _at->chat("+COPS=3,2"); - } - catch (GsmException &e) - { - if (e.getErrorClass() != ChatError) throw; - } - Parser p(_at->chat("+COPS?", "+COPS:")); - result._mode = (OPModes)p.parseInt(); - // some phones (e.g. Nokia Card Phone 2.0) just return "+COPS: 0" - // if no network connection - if (p.parseComma(true)) - { - if (p.parseInt() == 2) - { - p.parseComma(); - try - { - result._numericName = p.parseInt(); - } - catch (GsmException &e) - { - if (e.getErrorClass() == ParserError) - { - // the Ericsson GM12 GSM modem returns the numeric ID as string - string s = p.parseString(); - result._numericName = checkNumber(s); - } - else - throw e; - } - } - } - } - catch (GsmException &e) - { - if (e.getErrorClass() != ChatError) throw; - } - return result; -} - -void MeTa::setCurrentOPInfo(OPModes mode, - string longName, - string shortName, - int numericName) throw(GsmException) -{ - bool done = false; - if (longName != "") - { - try - { - _at->chat("+COPS=" + intToStr((int)mode) + ",0,\"" + longName + "\""); - done = true; - } - catch (GsmException &e) - { - if (e.getErrorClass() != ChatError) throw; - } - } - if (shortName != "" && ! done) - { - try - { - _at->chat("+COPS=" + intToStr((int)mode) + ",1,\"" + shortName + "\""); - done = true; - } - catch (GsmException &e) - { - if (e.getErrorClass() != ChatError) throw; - } - } - if (numericName != NOT_SET && ! done) - { - try - { - _at->chat("+COPS=" + intToStr((int)mode) + ",2," + - intToStr(numericName)); - done = true; - } - catch (GsmException &e) - { - if (e.getErrorClass() != ChatError) throw; - } - } - if (! done) - throw GsmException(_("unable to set operator"), OtherError); -} - -vector MeTa::getFacilityLockCapabilities() throw(GsmException) -{ - string locks = _at->chat("+CLCK=?", "+CLCK:"); - // some TA don't add '(' and ')' (Option FirstFone) - if (locks.length() && locks[0] != '(') - { - locks.insert(locks.begin(),'('); - locks += ')'; - } - Parser p(locks); - return p.parseStringList(); -} - -bool MeTa::getFacilityLockStatus(string facility, FacilityClass cl) - throw(GsmException) -{ - // some TA return always multiline response with all classes - // (Option FirstFone) - // !!! errors handling is correct (responses.empty() true) ? - vector responses = - _at->chatv("+CLCK=\"" + facility + "\",2,," + intToStr((int)cl),"+CLCK:",true); - for (vector::iterator i = responses.begin(); - i != responses.end(); ++i) - { - Parser p(*i); - int enabled = p.parseInt(); - - // if the first time and there is no comma this - // return direct state of classes - // else return all classes - if (i == responses.begin()) - { - if (!p.parseComma(true)) - return enabled == 1; - } - else - p.parseComma(); - - if ( p.parseInt() == (int)cl ) - return enabled == 1; - } - return false; - -// Parser p(_at->chat("+CLCK=\"" + facility + "\",2,," + intToStr((int)cl), -// "+CLCK:")); -// return p.parseInt() == 1; -} - -void MeTa::lockFacility(string facility, FacilityClass cl, string passwd) - throw(GsmException) -{ - if (passwd == "") - _at->chat("+CLCK=\"" + facility + "\",1,," + intToStr((int)cl)); - else - _at->chat("+CLCK=\"" + facility + "\",1,\"" + passwd + "\"," - + intToStr((int)cl)); -} - -void MeTa::unlockFacility(string facility, FacilityClass cl, string passwd) - throw(GsmException) -{ - if (passwd == "") - _at->chat("+CLCK=\"" + facility + "\",0,," + intToStr((int)cl)); - else - _at->chat("+CLCK=\"" + facility + "\",0,\"" + passwd + "\"," - + intToStr((int)cl)); -} - -vector MeTa::getPasswords() throw(GsmException) -{ - vector result; - Parser p(_at->chat("+CPWD=?", "+CPWD:")); - while (1) - { - PWInfo pwi; - if (!p.parseChar('(', true)) break; // exit if no new tuple - pwi._facility = p.parseString(); - p.parseComma(); - pwi._maxPasswdLen = p.parseInt(); - p.parseChar(')'); - p.parseComma(true); - result.push_back(pwi); - } - return result; -} - -void MeTa::setPassword(string facility, string oldPasswd, string newPasswd) - throw(GsmException) -{ - _at->chat("+CPWD=\"" + facility + "\",\"" + oldPasswd + "\",\"" + - newPasswd + "\""); -} - -bool MeTa::getNetworkCLIP() throw(GsmException) -{ - Parser p(_at->chat("+CLIP?", "+CLIP:")); - p.parseInt(); // ignore result code presentation - p.parseComma(); - return p.parseInt() == 1; -} - -void MeTa::setCLIPPresentation(bool enable) throw(GsmException) -{ - if (enable) - _at->chat("+CLIP=1"); - else - _at->chat("+CLIP=0"); -} - -bool MeTa::getCLIPPresentation() throw(GsmException) -{ - Parser p(_at->chat("+CLIP?", "+CLIP:")); - return p.parseInt() == 1; // ignore rest of line -} - -void MeTa::setCallForwarding(ForwardReason reason, - ForwardMode mode, - string number, - string subaddr, - FacilityClass cl, - int forwardTime) throw(GsmException) -{ - // FIXME subaddr is currently ignored - if (forwardTime != NOT_SET && (forwardTime < 0 || forwardTime > 30)) - throw GsmException(_("call forward time must be in the range 0..30"), - ParameterError); - - int numberType; - number = removeWhiteSpace(number); - if (number.length() > 0 && number[0] == '+') - { - numberType = InternationalNumberFormat; - number = number.substr(1); // skip the '+' at the beginning - } - else - numberType = UnknownNumberFormat; - _at->chat("+CCFC=" + intToStr(reason) + "," + intToStr(mode) + "," - "\"" + number + "\"," + - (number.length() > 0 ? intToStr(numberType) : "") + - "," + intToStr(cl) + - // FIXME subaddr and type - (forwardTime == NOT_SET ? "" : - (",,," + intToStr(forwardTime)))); -} - -void MeTa::getCallForwardInfo(ForwardReason reason, - ForwardInfo &voice, - ForwardInfo &fax, - ForwardInfo &data) throw(GsmException) -{ - // Initialize to some sensible values: - voice._active = false; - voice._cl = VoiceFacility; - voice._time = -1; - voice._reason = NoReason; - data._active = false; - data._cl = DataFacility; - data._time = -1; - data._reason = NoReason; - fax._active = false; - fax._cl = FaxFacility; - fax._time = -1; - fax._reason = NoReason; - - vector responses = - _at->chatv("+CCFC=" + intToStr(reason) + ",2", "+CCFC:"); - if (responses.size() == 1) - { - // only one line was returned. We have to ask for all three classes - // (voice, data, fax) separately - responses.clear(); - responses.push_back(_at->chat("+CCFC=" + intToStr(reason) + - ",2,,,1", "+CCFC:")); - responses.push_back(_at->chat("+CCFC=" + intToStr(reason) + - ",2,,,2", "+CCFC:")); - responses.push_back(_at->chat("+CCFC=" + intToStr(reason) + - ",2,,,4", "+CCFC:")); - } - - for (vector::iterator i = responses.begin(); - i != responses.end(); ++i) - { - Parser p(*i); - int status = p.parseInt(); - p.parseComma(); - FacilityClass cl = (FacilityClass)p.parseInt(); - string number; - string subAddr; - int forwardTime = NOT_SET; - - // parse number - if (p.parseComma(true)) - { - number = p.parseString(); - p.parseComma(); - unsigned int numberType = p.parseInt(); - if (numberType == InternationalNumberFormat) number = "+" + number; - - // parse subaddr - if (p.parseComma(true)) - { - // FIXME subaddr type not handled - subAddr = p.parseString(true); - p.parseComma(); - p.parseInt(true); - - // parse forwardTime - if (p.parseComma(true)) - { - forwardTime = p.parseInt(); - } - } - } - switch (cl) - { - case VoiceFacility: - voice._active = (status == 1); - voice._cl = VoiceFacility; - voice._number = number; - voice._subAddr = subAddr; - voice._time = forwardTime; - voice._reason = reason; - break; - case DataFacility: - data._active = (status == 1); - data._cl = DataFacility; - data._number = number; - data._subAddr = subAddr; - data._time = forwardTime; - data._reason = reason; - break; - case FaxFacility: - fax._active = (status == 1); - fax._cl = FaxFacility; - fax._number = number; - fax._subAddr = subAddr; - fax._time = forwardTime; - fax._reason = reason; - break; - } - } -} - -int MeTa::getBatteryChargeStatus() throw(GsmException) -{ - Parser p(_at->chat("+CBC", "+CBC:")); - return p.parseInt(); -} - -int MeTa::getBatteryCharge() throw(GsmException) -{ - Parser p(_at->chat("+CBC", "+CBC:")); - p.parseInt(); - p.parseComma(); - return p.parseInt(); -} - -int MeTa::getFunctionalityLevel() throw(GsmException) -{ - try { - Parser p(_at->chat("+CFUN?", "+CFUN:")); - // some phones return functionality level like "(2)" - bool expectClosingParen = p.parseChar('(', true); - int result = p.parseInt(); - if (expectClosingParen) - p.parseChar(')'); - return result; - } - catch (GsmException &x) - { - if (x.getErrorClass() == ChatError) - { - throw GsmException(_("Functionality Level commands not supported by ME"), - MeTaCapabilityError); - } else { - throw; - } - } -} - -void MeTa::setFunctionalityLevel(int level) throw(GsmException) -{ - try { - Parser p(_at->chat("+CFUN=" + intToStr(level))); - } catch (GsmException &x) { - if (x.getErrorClass() == ChatError) - { - // If the command AT+CFUN commands really aren't supported by the ME, - // then this will throw an appropriate exception for us. - getFunctionalityLevel(); - // If the number was just out of range, we get here. - throw GsmException(_("Requested Functionality Level out of range"), - ParameterError); - } - throw; - } -} - -int MeTa::getSignalStrength() throw(GsmException) -{ - Parser p(_at->chat("+CSQ", "+CSQ:")); - return p.parseInt(); -} - -int MeTa::getBitErrorRate() throw(GsmException) -{ - Parser p(_at->chat("+CSQ", "+CSQ:")); - p.parseInt(); - p.parseComma(); - return p.parseInt(); -} - -vector MeTa::getPhoneBookStrings() throw(GsmException) -{ - Parser p(_at->chat("+CPBS=?", "+CPBS:")); - return p.parseStringList(); -} - -PhonebookRef MeTa::getPhonebook(string phonebookString, - bool preload) throw(GsmException) -{ - for (PhonebookVector::iterator i = _phonebookCache.begin(); - i != _phonebookCache.end(); ++i) - { - if ((*i)->name() == phonebookString) - return *i; - } - PhonebookRef newPb(new Phonebook(phonebookString, _at, *this, preload)); - _phonebookCache.push_back(newPb); - return newPb; -} - -string MeTa::getServiceCentreAddress() throw(GsmException) -{ - Parser p(_at->chat("+CSCA?", "+CSCA:")); - return p.parseString(); -} - -void MeTa::setServiceCentreAddress(string sca) throw(GsmException) -{ - int type; - sca = removeWhiteSpace(sca); - if (sca.length() > 0 && sca[0] == '+') - { - type = InternationalNumberFormat; - sca = sca.substr(1, sca.length() - 1); - } - else - type = UnknownNumberFormat; - Parser p(_at->chat("+CSCA=\"" + sca + "\"," + intToStr(type))); -} - -vector MeTa::getSMSStoreNames() throw(GsmException) -{ - Parser p(_at->chat("+CPMS=?", "+CPMS:")); - // only return values - return p.parseStringList(); -} - -SMSStoreRef MeTa::getSMSStore(string storeName) throw(GsmException) -{ - for (SMSStoreVector::iterator i = _smsStoreCache.begin(); - i != _smsStoreCache.end(); ++i) - { - if ((*i)->name() == storeName) - return *i; - } - SMSStoreRef newSs(new SMSStore(storeName, _at, *this)); - _smsStoreCache.push_back(newSs); - return newSs; -} - -void MeTa::sendSMS(Ref smsMessage) throw(GsmException) -{ - smsMessage->setAt(_at); - smsMessage->send(); -} - -void MeTa::sendSMSs(Ref smsTemplate, string text, - bool oneSMS, - int concatenatedMessageId) - throw(GsmException) -{ - assert(! smsTemplate.isnull()); - - // compute maximum text length for normal SMSs and concatenated SMSs - unsigned int maxTextLength, concMaxTextLength; - switch (smsTemplate->dataCodingScheme().getAlphabet()) - { - case DCS_DEFAULT_ALPHABET: - maxTextLength = 160; - concMaxTextLength = 152; - break; - case DCS_EIGHT_BIT_ALPHABET: - maxTextLength = 140; - concMaxTextLength = 134; - break; - case DCS_SIXTEEN_BIT_ALPHABET: - maxTextLength = 70; - concMaxTextLength = 67; - break; - default: - throw GsmException(_("unsupported alphabet for SMS"), - ParameterError); - break; - } - - // simple case, only send one SMS - if (oneSMS || text.length() <= maxTextLength) - { - if (text.length() > maxTextLength) - throw GsmException(_("SMS text is larger than allowed"), - ParameterError); - smsTemplate->setUserData(text); - sendSMS(smsTemplate); - } - else // send multiple SMSs - { - if (concatenatedMessageId != -1) - maxTextLength = concMaxTextLength; - - int numMessages = (text.length() + maxTextLength - 1) / maxTextLength; - if (numMessages > 255) - throw GsmException(_("not more than 255 concatenated SMSs allowed"), - ParameterError); - unsigned char numMessage = 0; - while (true) - { - if (concatenatedMessageId != -1) - { - unsigned char udhs[] = {0x00, 0x03, concatenatedMessageId, - numMessages, ++numMessage}; - UserDataHeader udh(string((char*)udhs, 5)); - smsTemplate->setUserDataHeader(udh); - } - smsTemplate->setUserData(text.substr(0, maxTextLength)); - sendSMS(smsTemplate); - if (text.length() < maxTextLength) - break; - text.erase(0, maxTextLength); - } - } -} - -void MeTa::setMessageService(int serviceLevel) throw(GsmException) -{ - string s; - switch (serviceLevel) - { - case 0: - s = "0"; - break; - case 1: - s = "1"; - break; - default: - throw GsmException(_("only serviceLevel 0 or 1 supported"), - ParameterError); - } - // some devices (eg. Origo 900) don't support service level setting - _at->chat("+CSMS=" + s, "+CSMS:", true); -} - -unsigned int MeTa::getMessageService() throw(GsmException) -{ - Parser p(_at->chat("+CSMS?", "+CSMS:")); - return p.parseInt(); -} - -void MeTa::getSMSRoutingToTA(bool &smsRouted, - bool &cbsRouted, - bool &statusReportsRouted) throw(GsmException) -{ - Parser p(_at->chat("+CNMI?", "+CNMI:")); - p.parseInt(); - int smsMode = 0; - int cbsMode = 0; - int statMode = 0; - int bufferMode = 0; - - if (p.parseComma(true)) - { - smsMode = p.parseInt(); - if (p.parseComma(true)) - { - cbsMode = p.parseInt(); - if (p.parseComma(true)) - { - statMode = p.parseInt(); - if (p.parseComma(true)) - { - bufferMode = p.parseInt(); - } - } - } - } - - smsRouted = (smsMode == 2) || (smsMode == 3); - cbsRouted = (cbsMode == 2) || (cbsMode == 3); - statusReportsRouted = (statMode == 1); -} - -void MeTa::setSMSRoutingToTA(bool enableSMS, bool enableCBS, - bool enableStatReport, - bool onlyReceptionIndication) - throw(GsmException) -{ - bool smsModesSet = false; - bool cbsModesSet = false; - bool statModesSet = false; - bool bufferModesSet = false; - - // find out capabilities - Parser p(_at->chat("+CNMI=?", "+CNMI:")); - vector modes = p.parseIntList(); - vector smsModes(1); - vector cbsModes(1); - vector statModes(1); - vector bufferModes(1); - if (p.parseComma(true)) - { - smsModes = p.parseIntList(); - smsModesSet = true; - if (p.parseComma(true)) - { - cbsModes = p.parseIntList(); - cbsModesSet = true; - if (p.parseComma(true)) - { - statModes = p.parseIntList(); - statModesSet = true; - if (p.parseComma(true)) - { - bufferModes = p.parseIntList(); - bufferModesSet = true; - } - } - } - } - - // now set the mode vectors to the default if not set - if (! smsModesSet) smsModes[0] = true; - if (! cbsModesSet) cbsModes[0] = true; - if (! statModesSet) statModes[0] = true; - if (! bufferModesSet) bufferModes[0] = true; - - string chatString; - - // now try to set some optimal combination depending on - // ME/TA's capabilities - - // handle modes - if (isSet(modes, 2)) - chatString = "2"; - else if (isSet(modes, 1)) - chatString = "1"; - else if (isSet(modes, 0)) - chatString = "0"; - else if (isSet(modes, 3)) - chatString = "3"; - - if (onlyReceptionIndication) - { - // handle sms mode - if (enableSMS) - { - if (isSet(smsModes, 1)) - chatString += ",1"; - else - throw GsmException(_("cannot route SMS messages to TE"), - MeTaCapabilityError); - } - else - chatString += ",0"; - - // handle cbs mode - if (enableCBS) - { - if (isSet(cbsModes, 1)) - chatString += ",1"; - else if (isSet(cbsModes, 2)) - chatString += ",2"; - else - throw GsmException(_("cannot route cell broadcast messages to TE"), - MeTaCapabilityError); - } - else - chatString += ",0"; - - // handle stat mode - if (enableStatReport) - { - if (isSet(statModes, 2)) - chatString += ",2"; - else - throw GsmException(_("cannot route status reports messages to TE"), - MeTaCapabilityError); - } - else - chatString += ",0"; - } - else - { - // handle sms mode - if (enableSMS) - { - if (isSet(smsModes, 2)) - chatString += ",2"; - else if (isSet(smsModes, 3)) - chatString += ",3"; - else - throw GsmException(_("cannot route SMS messages to TE"), - MeTaCapabilityError); - } - else - chatString += ",0"; - - // handle cbs mode - if (enableCBS) - { - if (isSet(cbsModes, 2)) - chatString += ",2"; - else if (isSet(cbsModes, 3)) - chatString += ",3"; - else - throw GsmException(_("cannot route cell broadcast messages to TE"), - MeTaCapabilityError); - } - else - chatString += ",0"; - - // handle stat mode - if (enableStatReport) - { - if (isSet(statModes, 1)) - chatString += ",1"; - else if (isSet(statModes, 2)) - chatString += ",2"; - else - throw GsmException(_("cannot route status report messages to TE"), - MeTaCapabilityError); - } - else - chatString += ",0"; - } - - // handle buffer mode but only if it was reported by the +CNMI=? command - // the Ericsson GM12 GSM modem does not like it otherwise - if (bufferModesSet) - if (isSet(bufferModes, 1)) - chatString += ",1"; - else - chatString += ",0"; - - _at->chat("+CNMI=" + chatString); -} - -bool MeTa::getCallWaitingLockStatus(FacilityClass cl) - throw(GsmException) -{ - // some TA return always multiline response with all classes - // (Option FirstFone) - // !!! errors handling is correct (responses.empty() true) ? - vector responses = - _at->chatv("+CCWA=0,2," + intToStr((int)cl),"+CCWA:",true); - for (vector::iterator i = responses.begin(); - i != responses.end(); ++i) - { - Parser p(*i); - int enabled = p.parseInt(); - - // if the first time and there is no comma this - // return direct state of classes - // else return all classes - if (i == responses.begin()) - { - if (! p.parseComma(true)) - return enabled == 1; - } - else - p.parseComma(); - - if (p.parseInt() == (int)cl) - return enabled == 1; - } - return false; - -} -void MeTa::setCallWaitingLockStatus(FacilityClass cl, bool lock) - throw(GsmException) -{ - if(lock) - _at->chat("+CCWA=0,1," + intToStr((int)cl)); - else - _at->chat("+CCWA=0,0," + intToStr((int)cl)); -} - -void MeTa::setCLIRPresentation(bool enable) throw(GsmException) -{ - if (enable) - _at->chat("+CLIR=1"); - else - _at->chat("+CLIR=0"); -} - -int MeTa::getCLIRPresentation() throw(GsmException) -{ - // 0:according to the subscription of the CLIR service - // 1:CLIR invocation - // 2:CLIR suppression - Parser p(_at->chat("+CLIR?", "+CLIR:")); - return p.parseInt(); -} - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_me_ta.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_me_ta.h deleted file mode 100644 index f397e84695..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_me_ta.h +++ /dev/null @@ -1,402 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_me_ta.h -// * -// * Purpose: Mobile Equipment/Terminal Adapter and SMS functions -// * (ETSI GSM 07.07 and 07.05) -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 3.5.1999 -// ************************************************************************* - -#ifndef GSM_ME_TA_H -#define GSM_ME_TA_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; - -namespace gsmlib -{ - // *** phone capability description (you could also call it phone quirks) - - struct Capabilities - { - bool _hasSMSSCAprefix; // SMS have service centre address prefix - int _cpmsParamCount; // number of SMS store parameters to - // CPMS command - bool _omitsColon; // omits trailing ':' in AT responses - bool _veryShortCOPSanswer; // Falcom A2-1 - bool _wrongSMSStatusCode; // Motorola Timeport 260 - bool _CDSmeansCDSI; // Nokia Cellular Card Phone RPE-1 GSM900 - bool _sendAck; // send ack for directly routed SMS - Capabilities(); // constructor, set default behaviours - }; - - // *** auxiliary structs - - // Static ME information (AT command sequences given in brackets) - struct MEInfo - { - string _manufacturer; // (+CGMI) - string _model; // (+CGMM) - string _revision; // (+CGMR) - string _serialNumber; // (+CGSN), IMEI - }; - - // modes for network operation selection - enum OPModes {AutomaticOPMode = 0, ManualOPMode = 1, - DeregisterOPMode = 2, ManualAutomaticOPMode = 4}; - - // status codes or network operaton selection - enum OPStatus {UnknownOPStatus = 0, AvailableOPStatus = 1, - CurrentOPStatus = 2, ForbiddenOPStatus = 3}; - - // network operator info - struct OPInfo - { - OPModes _mode; - OPStatus _status; - string _longName; - string _shortName; - int _numericName; // may be NOT_SET - - OPInfo() : _status(UnknownOPStatus), _numericName(NOT_SET) {} - }; - - // facility classes - enum FacilityClass {VoiceFacility = 1, DataFacility = 2, FaxFacility = 4}; - const int ALL_FACILITIES = VoiceFacility | DataFacility | FaxFacility; - - // struct to hold password info - struct PWInfo - { - string _facility; - int _maxPasswdLen; - }; - - // call forward reasons - // AllReasons encompasses 0..3 - // AllConditionalReasons encompasses 1..3 - enum ForwardReason {UnconditionalReason = 0, MobileBusyReason = 1, - NoReplyReason = 2, NotReachableReason = 3, - AllReasons = 4, AllConditionalReasons = 5, NoReason = 6}; - - // call forward modes - enum ForwardMode {DisableMode = 0, EnableMode = 1, - RegistrationMode = 3, ErasureMode = 4}; - - // call forward info - struct ForwardInfo - { - bool _active; // status in the network - FacilityClass _cl; // voice, fax, or data - string _number; // telephone number - string _subAddr; // subaddress - int _time; // time in the range 1..30 (for NoReplyReason) - ForwardReason _reason; // reason for the forwarding - }; - - // SMS types - typedef Ref SMSStoreRef; - typedef vector SMSStoreVector; - - // this class allows access to all functions of a ME/TA as described - // in sections 5-8 of ETSI GSM 07.07 - // Note: If the ME is changed (ie. disconnected an another one connected - // to the TA), a new ME object must be created - // (Mobile equipment = ME, terminal adapter = TA) - class MeTa : public RefBase - { - protected: - Ref _port; // port the ME/TA is connected to - Ref _at; // chat object for the port - PhonebookVector _phonebookCache; // cache of all used phonebooks - SMSStoreVector _smsStoreCache; // cache of all used phonebooks - string _lastPhonebookName; // remember last phonebook set on ME/TA - string _lastSMSStoreName; // remember last SMS store set on ME/TA - Capabilities _capabilities; // ME/TA quirks - GsmEvent _defaultEventHandler; // default event handler - // see comments in MeTa::init() - string _lastCharSet; // remember last character set - - // init ME/TA to sensible defaults - void init() throw(GsmException); - - public: - // initialize a new MeTa object given the port - MeTa(Ref port) throw(GsmException); - - // initialize a new MeTa object given the AT handler - //MeTa(Ref at) throw(GsmException); - - // set the current phonebook in the ME - // remember the last phonebook set for optimisation - void setPhonebook(string phonebookName) throw(GsmException); - - // set the current SMS store in the ME - // set storeTypes to - // 1 to set store for reading and deleting - // 2 to set store for writing and sending (includes type 1) - // 3 to preferred store for receiving SMS (includes types 1 and 2) - // remember the last SMS store set for optimisation - // if needResultCode is set this optimisation is not done - string setSMSStore(string smsStore, int storeTypes, - bool needResultCode = false) - throw(GsmException); - - // get current SMS store settings - void getSMSStore(string &readDeleteStore, - string &writeSendStore, - string &receiveStore) throw(GsmException); - - // get capabilities of this ME/TA - Capabilities getCapabilities() const {return _capabilities;} - - // return my port - Ref getPort() {return _port;} - - // return my at handler - Ref getAt() {return _at;} - - // set event handler for unsolicited result codes - GsmEvent *setEventHandler(GsmEvent *newHandler) - {return _at->setEventHandler(newHandler);} - - // wait for an event - void waitEvent(GsmTime timeout) throw(GsmException); - - // *** ETSI GSM 07.07 Section 5: "General Commands" - - // return ME information - MEInfo getMEInfo() throw(GsmException); - - // return available character sets - vector getSupportedCharSets() throw(GsmException);// (+CSCS=?) - - // return current character set (default: GSM) - string getCurrentCharSet() throw(GsmException);// (+CSCS?) - - // set character set to use - void setCharSet(string charSetName) throw(GsmException);// (+CSCS=) - - // *** ETSI GSM 07.07 Section 6: "Call control commands and methods" - - // get extended error report - string getExtendedErrorReport() throw(GsmException);// (+CEER) - - // dial a number, CLI presentation as defined in network - void dial(string number) throw(GsmException);// (ATD) - - // answer - void answer() throw(GsmException); // (ATA) - - // hangup - void hangup() throw(GsmException); // (ATH) - - // set Personal Identification Number - void setPIN(string number) throw(GsmException);// (+CPIN) - - // get PIN Status - string getPINStatus() throw(GsmException);// (+CPIN?) - - // *** ETSI GSM 07.07 Section 7: "Network service related commands" - - // return available network operators - // this fills in all fields of OPInfo with the exception of _mode - vector getAvailableOPInfo() throw(GsmException); // (+COPS=?) - - // return current network operators - // this fills in all the fields of OPInfo with the exception of _status - OPInfo getCurrentOPInfo() throw(GsmException); - - // set network operator - // caller must fill in ALL names it has read from previous calls - // of getCurrentOPInfo() or getAvailableOPInfo() - // (because ME/TA might not implement all names) - void setCurrentOPInfo(OPModes mode, - string longName = "", - string shortName = "", - int numericName = NOT_SET) throw(GsmException); - - // get facility lock capabilities (+CLCK) - vector getFacilityLockCapabilities() throw(GsmException); - - // query facility lock status for named facility - bool getFacilityLockStatus(string facility, FacilityClass cl) - throw(GsmException); - - // lock facility - void lockFacility(string facility, FacilityClass cl, string passwd = "") - throw(GsmException); - - // unlock facility - void unlockFacility(string facility, FacilityClass cl, string passwd = "") - throw(GsmException); - - // return names of facility for which a password can be set - // and the maximum length of the respective password - vector getPasswords() throw(GsmException);// (+CPWD=?) - - // set password for the given facility - void setPassword(string facility, string oldPasswd, string newPasswd) - throw(GsmException); - // (+CPWD=) - - // get CLIP (caller line identification presentation) in the network - bool getNetworkCLIP() throw(GsmException);// (+CLIP?) - - // set CLIP presentation on or off - // enables GsmEvent::callerLineID - void setCLIPPresentation(bool enable) throw(GsmException);// (+CLIP=) - - // returns if the above is enable - bool getCLIPPresentation() throw(GsmException);// (+CLIP?) - - // set call forwarding - void setCallForwarding(ForwardReason reason, - ForwardMode mode, - string number, - string subaddr, - FacilityClass cl = (FacilityClass)ALL_FACILITIES, - int forwardTime = NOT_SET) - throw(GsmException); // (+CCFC=) - - // get Information of currently set CF in the network - // the caller must give the reason to query - void getCallForwardInfo(ForwardReason reason, - ForwardInfo &voice, - ForwardInfo &fax, - ForwardInfo &data) - throw(GsmException); // (+CCFC=) - - - // *** ETSI GSM 07.07 Section 8: "Mobile Equipment control - // and status commands" - - // return/set ME functionality level (+CFUN): - // 0 Minimum functionality - // 1 full functionality - // 2 disable phone transmit RF circuits only - // 3 disable phone receive RF circuits only - // 4 disable phone both transmit and receive RF circuits - // 5...127 implementation-defined - int getFunctionalityLevel() throw(GsmException); - void setFunctionalityLevel(int level) throw(GsmException); - - // return battery charge status (+CBC): - // 0 ME is powered by the battery - // 1 ME has a battery connected, but is not powered by it - // 2 ME does not have a battery connected - // 3 Recognized power fault, calls inhibited - int getBatteryChargeStatus() throw(GsmException); - - // return battery charge (range 0..100) (+CBC) - int getBatteryCharge() throw(GsmException); - - // get signal strength indication (+CSQ): - // 0 -113 dBm or less - // 1 -111 dBm - // 2...30 -109... -53 dBm - // 31 -51 dBm or greater - // 99 not known or not detectable - int getSignalStrength() throw(GsmException); - - // get channel bit error rate (+CSQ): - // 0...7 as RXQUAL values in the table in GSM 05.08 [20] subclause 8.2.4 - // 99 not known or not detectable - int getBitErrorRate() throw(GsmException); - - // get available phone book memory storage strings (+CPBS=?) - vector getPhoneBookStrings() throw(GsmException); - - // get phone book given the phone book memory storage string - PhonebookRef getPhonebook(string phonebookString, - bool preload = false) throw(GsmException); - - - // *** ETSI GSM 07.05 SMS functions - - // return service centre address (+CSCA?) - string getServiceCentreAddress() throw(GsmException); - - // set service centre address (+CSCA=) - void setServiceCentreAddress(string sca) throw(GsmException); - - // return names of available message stores (, +CPMS=?) - vector getSMSStoreNames() throw(GsmException); - - // return SMS store given the name - SMSStoreRef getSMSStore(string storeName) throw(GsmException); - - // send a single SMS message - void sendSMS(Ref smsMessage) throw(GsmException); - - // send one or several (concatenated) SMS messages - // The SUBMIT message template must have all options set, only - // the userData and the userDataHeader are changed. - // If oneSMS is true, only one SMS is sent. Otherwise several SMSs - // are sent. If concatenatedMessageId is != -1 this is used as the message - // ID for concatenated SMS (for this a user data header as defined in - // GSM GTS 3.40 is used, the old UDH in the template is overwritten). - void sendSMSs(Ref smsTemplate, string text, - bool oneSMS = false, - int concatenatedMessageId = -1) - throw(GsmException); - - // set SMS service level - // if set to 1 send commands return ACK PDU, 0 is the default - void setMessageService(int serviceLevel) throw(GsmException); - - // return SMS service level - unsigned int getMessageService() throw(GsmException); - - // return true if any of the thre message types GsmEvent::SMSMessageType - // is routed directly to the TA and not stored in the ME - void getSMSRoutingToTA(bool &smsRouted, // (+CNMI?) - bool &cbsRouted, - bool &statusReportsRouted) throw(GsmException); - - // sets routing of SMS to TA to true for all supported SMSMessageTypes - // if onlyReceptionIndication is set to true - // only GsmEvent::SMSReceptionIndication is called - // this has two reasons: GSM 07.05 section 3.4.1 does not recommend - // direct routing of new SMS to the TA - // I cannot test direct routing of SMS because it does not work with - // my hardware - void setSMSRoutingToTA(bool enableSMS, bool enableCBS, - bool enableStatReport, - bool onlyReceptionIndication = true) - throw(GsmException); - // (+CNMI=) - - bool getCallWaitingLockStatus(FacilityClass cl) - throw(GsmException); - - void setCallWaitingLockStatus(FacilityClass cl, - bool lock)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 getCLIRPresentation() throw(GsmException); - - friend class Phonebook; - friend class SMSStore; - }; -}; - -#endif // GSM_ME_TA_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_nls.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_nls.cc deleted file mode 100644 index 5eb205bf81..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_nls.cc +++ /dev/null @@ -1,32 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_nls.cc -// * -// * Purpose: Groups macros, initialization and includes -// * for National Language Support (NLS) -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 3.11.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include - -using namespace std; - -#ifdef ENABLE_NLS - -using namespace gsmlib; - -#ifdef HAVE_LOCALE_H -#include -#endif - -bool InitNLS::initialized = false; - -#endif // ENABLE_NLS diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_nls.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_nls.h deleted file mode 100644 index 6bfa6eb2f7..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_nls.h +++ /dev/null @@ -1,71 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_nls.h -// * -// * Purpose: Groups macros, initialization and includes -// * for National Language Support (NLS) -// * -// * Warning: Only include this header from gsmlib .cc-files -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 3.11.1999 -// ************************************************************************* - -#ifndef GSM_NLS_H -#define GSM_NLS_H - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef ENABLE_NLS - -#ifdef HAVE_LIBINTL_H -#include -#else -#include "../intl/libintl.h" -#endif -#ifdef HAVE_LOCALE_H -#include -#endif - -#define _(String) dgettext(PACKAGE, String) - -// this causes automatic NLS initialization if one file of the library -// includes gsm_nls.h - -namespace gsmlib -{ - const class InitNLS - { - static bool initialized; - - public: - InitNLS() - { - if (! initialized) // do only once - { - setlocale(LC_ALL, ""); -#ifdef LOCAL_TRANSLATIONS - bindtextdomain(PACKAGE, "../po"); -#else - bindtextdomain(PACKAGE, LOCALEDIR); -#endif - textdomain(PACKAGE); - initialized = true; - } - } - } initNLS; -}; - -#else - -#define _(String) (String) - -#endif // ENABLE_NLS - -#define N_(String) (String) - -#endif // GSM_NLS_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_parser.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_parser.cc deleted file mode 100644 index 38a21cd515..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_parser.cc +++ /dev/null @@ -1,381 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_parser.cc -// * -// * Purpose: Parser to parse MA/TA result strings -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 13.5.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -// Parser members - -int Parser::nextChar(bool skipWhiteSpace) -{ - if (skipWhiteSpace) - while (_i < _s.length() && isspace(_s[_i])) ++_i; - - if (_i == _s.length()) - { - _eos = true; - return -1; - } - - return _s[_i++]; -} - -bool Parser::checkEmptyParameter(bool allowNoParameter) throw(GsmException) -{ - int c = nextChar(); - if (c == ',' || c == -1) - if (allowNoParameter) - { - putBackChar(); - return true; - } - else - throwParseException(_("expected parameter")); - - putBackChar(); - return false; -} - -string Parser::parseString2(bool stringWithQuotationMarks) - throw(GsmException) -{ - int c; - string result; - if (parseChar('"', true)) // OK, string starts and ends with quotation mark - if (stringWithQuotationMarks) - { - // read till end of line - while ((c = nextChar(false)) != -1) - result += c; - - // check for """ at end of line - if (result.length() == 0 || result[result.length() - 1] != '"') - throwParseException(_("expected '\"'")); - - // remove """ at the end - result.resize(result.length() - 1); - } - else - { - // read till next """ - while ((c = nextChar(false)) != '"') - if (c == -1) - throwParseException(); - else - result += c; - } - else // string ends with "," or EOL - { - c = nextChar(false); - while (c != ',' && c != -1) - { - result += c; - c = nextChar(false); - } - if (c == ',') putBackChar(); - } - - return result; -} - -int Parser::parseInt2() throw(GsmException) -{ - string s; - int c; - int result; - - while (isdigit(c = nextChar())) s += c; - - putBackChar(); - if (s.length() == 0) - throwParseException(_("expected number")); - - istrstream is(s.c_str()); - is >> result; - return result; -} - -void Parser::throwParseException(string message) throw(GsmException) -{ - ostrstream os; - if (message.length() == 0) - throw GsmException(stringPrintf(_("unexpected end of string '%s'"), - _s.c_str()), ParserError); - else - throw GsmException(message + - stringPrintf(_(" (at position %d of string '%s')"), _i, - _s.c_str()), ParserError); -} - -Parser::Parser(string s) : _i(0), _s(s), _eos(false) -{ -} - -bool Parser::parseChar(char c, bool allowNoChar) throw(GsmException) -{ - if (nextChar() != c) - if (allowNoChar) - { - putBackChar(); - return false; - } - else - throwParseException(stringPrintf(_("expected '%c'"), c)); - return true; -} - -vector Parser::parseStringList(bool allowNoList) - throw(GsmException) -{ - // handle case of empty parameter - vector result; - if (checkEmptyParameter(allowNoList)) return result; - - parseChar('('); - if (nextChar() != ')') - { - putBackChar(); - while (1) - { - result.push_back(parseString()); - int c = nextChar(); - if (c == ')') - break; - if (c == -1) - throwParseException(); - if (c != ',') - throwParseException(_("expected ')' or ','")); - } - } - - return result; -} - -vector Parser::parseIntList(bool allowNoList) - throw(GsmException) -{ - // handle case of empty parameter - bool isRange = false; - vector result; - int resultCapacity = 0; - unsigned int saveI = _i; - - if (checkEmptyParameter(allowNoList)) return result; - - // check for the case of a integer list consisting of only one parameter - // some TAs omit the parentheses in this case - if (isdigit(nextChar())) - { - putBackChar(); - int num = parseInt(); - result.resize(num + 1, false); - result[num] = true; - return result; - } - putBackChar(); - - // run in two passes - // pass 0: find capacity needed for result - // pass 1: resize result and fill it in - for (int pass = 0; pass < 2; ++pass) - { - if (pass == 1) - { - _i = saveI; - result.resize(resultCapacity + 1, false); - } - - parseChar('('); - if (nextChar() != ')') - { - putBackChar(); - int lastInt = -1; - while (1) - { - int thisInt = parseInt(); - - if (isRange) - { - assert(lastInt != -1); - if (lastInt <= thisInt) - for (int i = lastInt; i < thisInt; ++i) - { - if (i > resultCapacity) - resultCapacity = i; - if (pass == 1) - result[i] = true; - } - else - for (int i = thisInt; i < lastInt; ++i) - { - if (i > resultCapacity) - resultCapacity = i; - if (pass == 1) - result[i] = true; - } - isRange = false; - } - - if (thisInt > resultCapacity) - resultCapacity = thisInt; - if (pass == 1) - result[thisInt] = true; - lastInt = thisInt; - - int c = nextChar(); - if (c == ')') - break; - - if (c == -1) - throwParseException(); - - if (c != ',' && c != '-') - throwParseException(_("expected ')', ',' or '-'")); - - if (c == ',') - isRange = false; - else // is '-' - if (isRange) - throwParseException(_("range of the form a-b-c not allowed")); - else - isRange = true; - } - } - } - if (isRange) - throwParseException(_("range of the form a- no allowed")); - return result; -} - -vector Parser::parseParameterRangeList(bool allowNoList) - throw(GsmException) -{ - // handle case of empty parameter - vector result; - if (checkEmptyParameter(allowNoList)) return result; - - result.push_back(parseParameterRange()); - while (parseComma(true)) - { - result.push_back(parseParameterRange()); - } - - return result; -} - -ParameterRange Parser::parseParameterRange(bool allowNoParameterRange) - throw(GsmException) -{ - // handle case of empty parameter - ParameterRange result; - if (checkEmptyParameter(allowNoParameterRange)) return result; - - parseChar('('); - result._parameter = parseString(); - parseComma(); - result._range = parseRange(false, true); - parseChar(')'); - - return result; -} - -IntRange Parser::parseRange(bool allowNoRange, bool allowNonRange) - throw(GsmException) -{ - // handle case of empty parameter - IntRange result; - if (checkEmptyParameter(allowNoRange)) return result; - - parseChar('('); - result._low = parseInt(); - // allow non-ranges is allowNonRange == true - if (parseChar('-', allowNonRange)) - result._high = parseInt(); - parseChar(')'); - - return result; -} - -int Parser::parseInt(bool allowNoInt) throw(GsmException) -{ - // handle case of empty parameter - int result = NOT_SET; - if (checkEmptyParameter(allowNoInt)) return result; - - result = parseInt2(); - - return result; -} - -string Parser::parseString(bool allowNoString, - bool stringWithQuotationMarks) - throw(GsmException) -{ - // handle case of empty parameter - string result; - if (checkEmptyParameter(allowNoString)) return result; - - result = parseString2(stringWithQuotationMarks); - - return result; -} - -bool Parser::parseComma(bool allowNoComma) throw(GsmException) -{ - if (nextChar() != ',') - if(allowNoComma) - { - putBackChar(); - return false; - } - else - throwParseException(_("expected comma")); - return true; -} - -string Parser::parseEol() throw(GsmException) -{ - string result; - int c; - while ((c = nextChar()) != -1) result += c; - return result; -} - -void Parser::checkEol() throw(GsmException) -{ - if (nextChar() != -1) - { - putBackChar(); - throwParseException(_("expected end of line")); - } -} - -string Parser::getEol() -{ - string result; - int c; - unsigned int saveI = _i; - bool saveEos = _eos; - while ((c = nextChar()) != -1) result += c; - _i = saveI; - _eos = saveEos; - return result; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_parser.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_parser.h deleted file mode 100644 index 8404f9f1cb..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_parser.h +++ /dev/null @@ -1,125 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_parser.h -// * -// * Purpose: Parser to parse MA/TA result strings -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 13.5.1999 -// ************************************************************************* - -#ifndef GSM_PARSER_H -#define GSM_PARSER_H - -#include -#include -#include -#include - -using namespace std; - -namespace gsmlib -{ - class Parser : public RefBase - { - private: - unsigned int _i; // index into _s, next character - string _s; // string to parse - bool _eos; // true if end-of-string reached in nextChar() - - // return next character or -1 if end of string - int nextChar(bool skipWhiteSpace = true); - - // "puts back" a character - void putBackChar() {if (! _eos) --_i;} - - // check for empty parameter (ie. "," or end of string) - // skips white space - // returns true if no parameter - // or throw an GsmException if allowNoParameter == false - bool checkEmptyParameter(bool allowNoParameter) throw(GsmException); - - // parse a string (like "string") - // throw an exception if not well-formed - string parseString2(bool stringWithQuotationMarks) throw(GsmException); - - // parse a int (like 1234) - // throw an exception if not well-formed - int parseInt2() throw(GsmException); - - // throw a parser exception - void throwParseException(string message = "") throw(GsmException); - - public: - Parser(string s); - - // the following functions skip white space - // parse a character, if absent throw a GsmException - // return false if allowNoChar == true and character not encountered - bool parseChar(char c, bool allowNoChar = false) throw(GsmException); - - // parse a list of the form "("ABC", DEF")" - // the list can be empty (ie. == "" ) if allowNoList == true - vector parseStringList(bool allowNoList = false) - throw(GsmException); - - // parse a list of the form "(12, 14)" or "(1-4, 10)" - // the result is returned as a bit vector where for each integer - // in the list and/or range(s) a bit is set - // the list can be empty (ie. == "") if allowNoList == true - vector parseIntList(bool allowNoList = false) - throw(GsmException); - - // parse a list of parameter ranges (see below) - // the list can be empty (ie. == "" ) if allowNoList == true - vector parseParameterRangeList(bool allowNoList = false) - throw(GsmException); - - // parse a string plus its valid integer range of the - // form "("string",(1-125))" - // the parameter range may be absent if allowNoParameterRange == true - ParameterRange parseParameterRange(bool allowNoParameterRange = false) - throw(GsmException); - - // parse an integer range of the form "(1-125)" - // the range may be absent if allowNoRange == true - // then IntRange::_high and _low are set to NOT_SET - // the range may be short if allowNonRange == true - // then IntRange::_high is set to NOT_SET - IntRange parseRange(bool allowNoRange = false, bool allowNonRange = false) - throw(GsmException); - - // parse an integer of the form "1234" - // allow absent int if allowNoInt == true - // then it returns NOT_SET - int parseInt(bool allowNoInt = false) throw(GsmException); - - // parse a string of the form ""string"" - // allow absent string if allowNoString == true - // then it returns "" - // if stringWithQuotationMarks == true the string may contain """ - // the string is then parsed till the end of the line - string parseString(bool allowNoString = false, - bool stringWithQuotationMarks = false) - throw(GsmException); - - // parse a single "," - // the comma may be absent if allowNoComma == true - // returns true if there was a comma - bool parseComma(bool allowNoComma = false) throw(GsmException); - - // parse till end of line, return result without whitespace - string parseEol() throw(GsmException); - - // check that end of line is reached - void checkEol() throw(GsmException); - - // return string till end of line without whitespace - // (does not change internal state) - string getEol(); - }; -}; - -#endif // GSM_PARSER_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_phonebook.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_phonebook.cc deleted file mode 100644 index 24d89e805d..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_phonebook.cc +++ /dev/null @@ -1,585 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_phonebook.cc -// * -// * Purpose: Phonebook management functions -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 6.5.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -// PhonebookEntry members - -PhonebookEntry::PhonebookEntry(const PhonebookEntryBase &e) - throw(GsmException) : _cached(true), _myPhonebook(NULL) -{ - set(e.telephone(), e.text(), e.index(), e.useIndex()); -} - -void PhonebookEntry::set(string telephone, string text, int index, - bool useIndex) - throw(GsmException) -{ - checkTextAndTelephone(text, telephone); - - if (_myPhonebook != NULL) - { - if (text.length() > _myPhonebook->getMaxTextLen()) - throw GsmException( - stringPrintf(_("length of text '%s' exceeds maximum text " - "length (%d characters) of phonebook '%s'"), - text.c_str(), _myPhonebook->getMaxTextLen(), - _myPhonebook->name().c_str()), - ParameterError); - - if (telephone.length() > _myPhonebook->getMaxTelephoneLen()) - throw GsmException( - stringPrintf(_("length of telephone number '%s' " - "exceeds maximum telephone number " - "length (%d characters) of phonebook '%s'"), - telephone.c_str(), _myPhonebook->getMaxTelephoneLen(), - _myPhonebook->name().c_str()), - ParameterError); - - _myPhonebook->writeEntry(_index, telephone, text); - } - else - _index = index; - - _useIndex = useIndex; - _cached = true; - _telephone = telephone; - _text = text; - _changed = true; -} - -string PhonebookEntry::text() const throw(GsmException) -{ - if (! cached()) - { - assert(_myPhonebook != NULL); - // these operations are at least "logically const" - PhonebookEntry *thisEntry = const_cast(this); - _myPhonebook->readEntry(_index, thisEntry->_telephone, thisEntry->_text); - thisEntry->_cached = true; - } - return _text; -} - -string PhonebookEntry::telephone() const throw(GsmException) -{ - if (! cached()) - { - assert(_myPhonebook != NULL); - // these operations are at least "logically const" - PhonebookEntry *thisEntry = const_cast(this); - _myPhonebook->readEntry(_index, thisEntry->_telephone, thisEntry->_text); - thisEntry->_cached = true; - } - return _telephone; -} - -bool PhonebookEntry::cached() const -{ - if (_myPhonebook == NULL) - return _cached; - else - return _cached && _myPhonebook->_useCache; -} - -PhonebookEntry::PhonebookEntry(const PhonebookEntry &e) throw(GsmException) -{ - set(e._telephone, e._text, e._index, e._useIndex); -} - -PhonebookEntry &PhonebookEntry::operator=(const PhonebookEntry &e) - throw(GsmException) -{ - set(e._telephone, e._text, e._index, e._useIndex); - return *this; -} - -// Phonebook members - -int Phonebook::parsePhonebookEntry(string response, - string &telephone, string &text) -{ - // this is a workaround for a bug that occurs with my ME/TA combination - // some texts are truncated and don't have a trailing " - if (response.length() > 0 && response[response.length() - 1] != '"') - response += '"'; - Parser p(response); - - int index = p.parseInt(); - p.parseComma(); - - // handle case of empty entry - if (p.getEol().substr(0, 5) == "EMPTY") - { - telephone = ""; - text = ""; - return index; - } - - telephone = p.parseString(); - p.parseComma(); - unsigned int numberFormat = p.parseInt(); - if (numberFormat != UnknownNumberFormat && - numberFormat != InternationalNumberFormat) - cerr << "*** GSMLIB WARNING: Unexpected number format when reading from " - << "phonebook: " << numberFormat << " ***" << endl; - p.parseComma(); - text = p.parseString(false, true); - if (lowercase(_myMeTa.getCurrentCharSet()) == "gsm") - text = gsmToLatin1(text); - if (numberFormat == InternationalNumberFormat) - { - // skip leading "+" signs that may already exist - while (telephone.length() > 0 && telephone[0] == '+') - telephone = telephone.substr(1); - telephone = "+" + telephone; - } - - return index; -} - -void Phonebook::readEntry(int index, string &telephone, string &text) - throw(GsmException) -{ - // select phonebook - _myMeTa.setPhonebook(_phonebookName); - - // read entry - string response = _at->chat("+CPBR=" + intToStr(index), "+CPBR:", - false, // dont't ignore errors - true); // but accept empty responses - // (the latter is necessary for some mobile phones that return nothing - // if the entry is empty) - - if (response.length() == 0) // OK phone returned empty response - { - telephone = text = ""; // then the entry is empty as well - } - else - parsePhonebookEntry(response, telephone, text); - -#ifndef NDEBUG - if (debugLevel() >= 1) - cerr << "*** Reading PB entry " << index << " number " << telephone - << " text " << text << endl; -#endif -} - -void Phonebook::findEntry(string text, int &index, string &telephone) - throw(GsmException) -{ - // select phonebook - _myMeTa.setPhonebook(_phonebookName); - - // read entry - string response = _at->chat("+CPBF=\"" + text + "\"", "+CPBF:", - false, // dont't ignore errors - true); // but accept empty responses - // (the latter is necessary for some mobile phones that return nothing - // if the entry is empty) - - if (response.length() == 0) // OK phone returned empty response - { - telephone = ""; // then the entry is empty as well - index = 0; - } - else - index=parsePhonebookEntry(response, telephone, text); - -#ifndef NDEBUG - if (debugLevel() >= 1) - cerr << "*** Finding PB entry " << text << " number " << telephone - << " index " << index << endl; -#endif -} - -void Phonebook::writeEntry(int index, string telephone, string text) - throw(GsmException) -{ -#ifndef NDEBUG - if (debugLevel() >= 1) - cerr << "*** Writing PB entry #" << index << " number '" << telephone - << "' text '" << text << "'" << endl; -#endif - // select phonebook - _myMeTa.setPhonebook(_phonebookName); - - // write entry - string s; - if (telephone == "" && text == "") - { - ostrstream os; - os << "+CPBW=" << index; - os << ends; - char *ss = os.str(); - s = string(ss); - delete[] ss; - } - else - { - int type; - if (telephone.find('+') == string::npos) - type = UnknownNumberFormat; - else - type = InternationalNumberFormat; - string gsmText = text; - if (lowercase(_myMeTa.getCurrentCharSet()) == "gsm") - gsmText = latin1ToGsm(gsmText); - ostrstream os; - os << "+CPBW=" << index << ",\"" << telephone << "\"," << type - << ",\""; - os << ends; - char *ss = os.str(); - s = string(ss); - delete[] ss; - // this cannot be added with ostrstream because the gsmText can - // contain a zero (GSM default alphabet for '@') - s += gsmText + "\""; - } - _at->chat(s); -} - -Phonebook::iterator Phonebook::insertFirstEmpty(string telephone, string text) - throw(GsmException) -{ - for (int i = 0; i < _maxSize; i++) - if (_phonebook[i].empty()) - { - _phonebook[i].set(telephone, text); - adjustSize(1); - return begin() + i; - } - throw GsmException(_("phonebook full"), OtherError); -} - -Phonebook::iterator Phonebook::insert(const string telephone, - const string text, - const int index) -{ - for (int i = 0; i < _maxSize; i++) - if (_phonebook[i].index() == index) - if (_phonebook[i].empty()) - { - _phonebook[i].set(telephone, text); - adjustSize(1); - return begin() + i; - } - else - throw GsmException(_("attempt to overwrite phonebook entry"), - OtherError); - return end(); -} - -Phonebook::Phonebook(string phonebookName, Ref at, MeTa &myMeTa, - bool preload) throw(GsmException) : - _phonebookName(phonebookName), _at(at), _myMeTa(myMeTa), _useCache(true) -{ - // select phonebook - _myMeTa.setPhonebook(_phonebookName); - - // query size and maximum capacity of phonebook - _size = -1; // -1 means not known yet - _maxSize = -1; - Parser q(_at->chat("+CPBS?", "+CPBS:")); - string dummy = q.parseString(); - if (q.parseComma(true)) // this means that - { // used and total result is supported by ME - _size = q.parseInt(); - q.parseComma(); - _maxSize = q.parseInt(); - } - - // get basic phonebook info from ME - Parser p(_at->chat("+CPBR=?", "+CPBR:")); - - // get index of actually available entries in the phonebook - vector availablePositions = p.parseIntList(); - p.parseComma(); - _maxNumberLength = p.parseInt(); - p.parseComma(); - _maxTextLength = p.parseInt(); - - // find out capacity of phonebook in ME - // Note: The phonebook in the ME may be sparse, eg. the range of - // allowed index numbers may be something like (3-4, 20-100, 120). - // The standard allows this, even though it is unlikely to be - // implemented like that by anyone. - // In memory we store only phonebook entries that may actually be - // used, ie. the phonebook in memory is not sparse. - // Each entry has a member _index that corresponds to the index in the ME. - if (_maxSize == -1) - { - _maxSize = 0; - for (vector::iterator i = availablePositions.begin(); - i != availablePositions.end(); ++i) - if (*i) ++_maxSize; - } - - // for use with preload below - int *meToPhonebookIndexMap = - (int*)alloca(sizeof(int) * (availablePositions.size() + 1)); - - // initialize phone book entries - if (_maxSize == 0) - _phonebook = NULL; - else - _phonebook = new PhonebookEntry[_maxSize]; - int nextAvailableIndex = 0; - int i; - for (i = 0; i < _maxSize; i++) - { - while (! availablePositions[nextAvailableIndex]) - nextAvailableIndex++; - _phonebook[i]._index = nextAvailableIndex; - _phonebook[i]._cached = false; - _phonebook[i]._myPhonebook = this; - meToPhonebookIndexMap[nextAvailableIndex++] = i; - } - - // find out first index number of phonebook - int firstIndex = -1; - for (i = 0; i < _maxSize; i++) - if (availablePositions[i]) - { - firstIndex = i; - break; - } - - // preload phonebook - // Note: this contains a workaround for the bug that - // some MEs can not return the entire phonebook with one AT command - // To detect this condition, _size must be known - // also, this code only handles non-sparse phonebooks - if (preload && _size != -1 && - (int)availablePositions.size() == _maxSize + firstIndex) - { - int entriesRead = 0; - int startIndex = firstIndex; - - while (entriesRead < _size) - { - reportProgress(0, _maxSize); // chatv also calls reportProgress() - vector responses = - _at->chatv("+CPBR=" + intToStr(startIndex) + - "," + intToStr(_maxSize + firstIndex - 1), - "+CPBR:", true); - - // this means that we have read nothing even though not all - // entries have been retrieved (entriesRead < _size) - // this could be due to a malfunction of the ME... - // anyway, missing entries can be read later by readEntry() - if (responses.size() == 0) - { -#ifndef NDEBUG - if (debugLevel() >= 1) - cerr << "*** error when preloading phonebook: " - "not all entries returned" << endl; -#endif - break; - } - - for (vector::iterator i = responses.begin(); - i != responses.end(); ++i) - { - string telephone, text; - int meIndex = parsePhonebookEntry(*i, telephone, text); - _phonebook[meToPhonebookIndexMap[meIndex]]._cached = true; - _phonebook[meToPhonebookIndexMap[meIndex]]._telephone = telephone; - _phonebook[meToPhonebookIndexMap[meIndex]]._text = text; - assert(_phonebook[meToPhonebookIndexMap[meIndex]]._index == meIndex); - - ++entriesRead; - startIndex = meIndex + 1; -#ifndef NDEBUG - if (debugLevel() >= 1) - cerr << "*** Preloading PB entry " << meIndex - << " number " << telephone - << " text " << text << endl; -#endif - } - } - } -} - -Phonebook::iterator Phonebook::begin() -{ - return &_phonebook[0]; -} - -Phonebook::const_iterator Phonebook::begin() const -{ - return &_phonebook[0]; -} - -Phonebook::iterator Phonebook::end() -{ - return &_phonebook[_maxSize]; -} - -Phonebook::const_iterator Phonebook::end() const -{ - return &_phonebook[_maxSize]; -} - -Phonebook::reference Phonebook::operator[](int n) -{ - return _phonebook[n]; -} - -Phonebook::const_reference Phonebook::operator[](int n) const -{ - return _phonebook[n]; -} - -Phonebook::reference Phonebook::front() -{ - return _phonebook[0]; -} - -Phonebook::const_reference Phonebook::front() const -{ - return _phonebook[0]; -} - -Phonebook::reference Phonebook::back() -{ - return _phonebook[_maxSize - 1]; -} - -Phonebook::const_reference Phonebook::back() const -{ - return _phonebook[_maxSize - 1]; -} - -int Phonebook::size() const throw(GsmException) -{ - if (_size != -1) - return _size; - else - { - int result = 0; - for (int i = 0; i < _maxSize; i++) - if (! _phonebook[i].empty()) - result++; - Phonebook *thisPhonebook = const_cast(this); - thisPhonebook->_size = result; - return result; - } -} - -Phonebook::iterator Phonebook::insert(iterator position, - const PhonebookEntry& x) - throw(GsmException) -{ - if (x.useIndex() && x.index() != -1) - return insert(x.telephone(), x.text(), x.index()); - else - return insertFirstEmpty(x.telephone(), x.text()); -} - -void Phonebook::insert (iterator pos, int n, const PhonebookEntry& x) - throw(GsmException) -{ - for (int i = 0; i < n; i++) - if (x.useIndex() && x.index() != -1) - insert(x.telephone(), x.text(), x.index()); - else - insertFirstEmpty(x.telephone(), x.text()); -} - -void Phonebook::insert (iterator pos, long n, const PhonebookEntry& x) - throw(GsmException) -{ - for (long i = 0; i < n; i++) - if (x.useIndex() && x.index() != -1) - insert(x.telephone(), x.text(), x.index()); - else - insertFirstEmpty(x.telephone(), x.text()); -} - -Phonebook::iterator Phonebook::erase(iterator position) - throw(GsmException) -{ - if (! position->empty()) - { - position->set("", ""); - adjustSize(-1); - } - return position + 1; -} - -Phonebook::iterator Phonebook::erase(iterator first, iterator last) - throw(GsmException) -{ - iterator i; - for (i = first; i != last; ++i) - erase(i); - return i; -} - -void Phonebook::clear() throw(GsmException) -{ - for (iterator i = begin(); i != end(); ++i) - erase(i); -} - -Phonebook::iterator Phonebook::find(string text) throw(GsmException) -{ - int index; - string telephone; - - int i; - for (i = 0; i < _maxSize; i++) - if (_phonebook[i].text() == text) - return begin() + i; - - findEntry(text, index, telephone); - - for (i = 0; i < _maxSize; i++) - if (_phonebook[i].index() == index) - if (_phonebook[i].cached()) - { - // if entry was already (= cached) and is now different - // the SIM card or it's contents were changed - if (_phonebook[i]._telephone != telephone || - _phonebook[i]._text != text) - throw GsmException(_("SIM card changed while accessing phonebook"), - OtherError); - } - else - { - _phonebook[i]._cached = true; - _phonebook[i]._telephone = telephone; - _phonebook[i]._text = text; - return begin() + i; - } - return end(); -} - -Phonebook::~Phonebook() -{ - delete []_phonebook; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_phonebook.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_phonebook.h deleted file mode 100644 index 4999da532e..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_phonebook.h +++ /dev/null @@ -1,195 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_phonebook.h -// * -// * Purpose: Phonebook management functions -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 4.5.1999 -// ************************************************************************* - -#ifndef GSM_PHONEBOOK_H -#define GSM_PHONEBOOK_H - -#include -#include -#include -#include -#include -#include - -using namespace std; - -namespace gsmlib -{ - // forward declarations - class Phonebook; - - // a single entry in the phonebook that corresponds to an ME entry - - class PhonebookEntry : public PhonebookEntryBase - { - private: - // this constructor is only used by Phonebook - PhonebookEntry() {} - bool _cached; // true, if this entry corresponds to info - // in the ME - Phonebook *_myPhonebook; - - public: - PhonebookEntry(string telephone, string text) : - PhonebookEntryBase(telephone, text), - _cached(true), _myPhonebook(NULL) {} - PhonebookEntry(const PhonebookEntryBase &e) throw(GsmException); - - // accessor functions, inherited from PhonebookEntryBase - // set() does not use the index argument - void set(string telephone, string text, int index = -1, - bool useIndex = false) - throw(GsmException); - string text() const throw(GsmException); - string telephone() const throw(GsmException); - - // return true if entry is cached (and caching is enabled) - bool cached() const; - - PhonebookEntry(const PhonebookEntry &e) throw(GsmException); - PhonebookEntry &operator=(const PhonebookEntry &e) throw(GsmException); - - virtual ~PhonebookEntry() {} - - friend class Phonebook; - }; - - // this class corresponds to a phonebook in the ME - // all functions directly update storage in the ME - // if the ME is exchanged, the storage may become corrupted because - // of internal buffering in the Phonebook class - - class Phonebook : public RefBase, public NoCopy - { - public: - // iterator defs - typedef PhonebookEntry *iterator; - typedef const PhonebookEntry *const_iterator; - typedef PhonebookEntry &reference; - typedef const PhonebookEntry &const_reference; - - private: - PhonebookEntry *_phonebook; // array of size _maxSize of entries - int _maxSize; // maximum size of pb (-1 == not known yet) - int _size; // current size of pb (-1 == not known yet) - string _phonebookName; // name of the phonebook, 2-byte like "ME" - unsigned int _maxNumberLength; // maximum length of telephone number - unsigned int _maxTextLength; // maximum length of descriptive text - Ref _at; // my GsmAt class - vector _positionMap; // maps in-memory index to ME index - MeTa &_myMeTa; // the MeTa object that created this Phonebook - bool _useCache; // true if entries should be cached - - // helper function, parse phonebook response returned by ME/TA - // returns index of entry - int parsePhonebookEntry(string response, string &telephone, string &text); - - // internal access functions - // read/write/find entry from/to ME - void readEntry(int index, string &telephone, string &text) - throw(GsmException); - void writeEntry(int index, string telephone, string text) - throw(GsmException); - void findEntry(string text, int &index, string &telephone) - throw(GsmException); - - // adjust size only if it was set once - void adjustSize(int sizeAdjust) - { - if (_size != -1) _size += sizeAdjust; - } - - // insert into first empty position and return position where inserted - iterator insertFirstEmpty(const string telephone, const string text) - throw(GsmException); - - // insert into specified index position - iterator insert(const string telephone, const string text, - const int index); - - // used my class MeTa - // load phonebook name phonebookName, use AT handler at - // preload entire phonebook if preload == true - Phonebook(string phonebookName, Ref at, - MeTa &myMeTa, bool preload = false) throw(GsmException); - - public: - // set cache mode on or off - void setCaching(bool useCache) {_useCache = useCache;} - - // return name of this phonebook (2-character string) - string name() const {return _phonebookName;} - - // return maximum telephone number length - unsigned int getMaxTelephoneLen() const {return _maxNumberLength;} - - // return maximum entry description length - unsigned int getMaxTextLen() const { return _maxTextLength;} - - // phonebook traversal commands - // these are suitable to use stdc++ lib algorithms and iterators - // ME have fixed storage space implemented as memory slots - // that may either be empty or used - - // traversal commands - iterator begin(); - const_iterator begin() const; - iterator end(); - const_iterator end() const; - reference front(); - const_reference front() const; - reference back(); - const_reference back() const; - reference operator[](int n); - const_reference operator[](int n) const; - - // the size macros return the number of used entries - int size() const throw(GsmException); - int max_size() const {return _maxSize;} - int capacity() const {return _maxSize;} - bool empty() const throw(GsmException) {return size() == 0;} - - // insert iterators insert into the first empty cell regardless of position - // - existing iterators are not invalidated after an insert operation - // - return position where it was actually inserted (may be != position) - // - insert only writes to available positions - // - throw an exception if size() == max_size() (ie. not empty slots) - iterator insert(iterator position, const PhonebookEntry& x) - throw(GsmException); - - // insert n times, same procedure as above - void insert(iterator pos, int n, const PhonebookEntry& x) - throw(GsmException); - void insert(iterator pos, long n, const PhonebookEntry& x) - throw(GsmException); - - // erase operators set used slots to "empty" - iterator erase(iterator position) throw(GsmException); - iterator erase(iterator first, iterator last) throw(GsmException); - void clear() throw(GsmException); - - // finds an entry given the text - iterator find(string text) throw(GsmException); - - // destructor - virtual ~Phonebook(); - - friend class PhonebookEntry; - friend class MeTa; - }; - - // useful phonebook types - typedef Ref PhonebookRef; - typedef vector PhonebookVector; -}; - -#endif // GSM_PHONEBOOK_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_port.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_port.h deleted file mode 100644 index 83c4edf60e..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_port.h +++ /dev/null @@ -1,58 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_port.h -// * -// * Purpose: Abstract port definition -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 3.5.1999 -// ************************************************************************* - -#ifndef GSM_PORT_H -#define GSM_PORT_H - -#include -#include -#include - -using namespace std; - -namespace gsmlib -{ - // TA defaults - const int TIMEOUT_SECS = 60; - const char DEFAULT_INIT_STRING[] = "E0"; - const int DEFAULT_BAUD_RATE = 38400; - - class Port : public RefBase - { - public: - // read line from port(including eol characters) - virtual string getLine() throw(GsmException) =0; - - // write line to port - virtual void putLine(string line, - bool carriageReturn = true) throw(GsmException) =0; - - // wait for new data to become available, return after timeout - // if timeout == 0, wait forever - // return true if data available - virtual bool wait(GsmTime timeout) throw(GsmException) =0; - - // put back one byte that can be read by a subsequent call to readByte() - virtual void putBack(unsigned char c) =0; - - // read a single byte, return -1 if error or file closed - virtual int readByte() throw(GsmException) =0; - - // set timeout for the readByte(), getLine(), and putLine() functions - // (globally for ALL ports) - virtual void setTimeOut(unsigned int timeout) =0; - - virtual ~Port() {} - }; -}; - -#endif // GSM_PORT_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms.cc deleted file mode 100644 index e150423add..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms.cc +++ /dev/null @@ -1,863 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_sms.cc -// * -// * Purpose: SMS functions -// * (ETSI GSM 07.05) -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 16.5.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -// local constants - -static const string dashes = -"---------------------------------------------------------------------------"; - -// SMSMessage members - -Ref SMSMessage::decode(string pdu, - bool SCtoMEdirection, - GsmAt *at) throw(GsmException) -{ - Ref result; - SMSDecoder d(pdu); - d.getAddress(true); - MessageType messageTypeIndicator = (MessageType)d.get2Bits(); // bits 0..1 - if (SCtoMEdirection) - // TPDUs from SC to ME - switch (messageTypeIndicator) - { - case SMS_DELIVER: - result = new SMSDeliverMessage(pdu); - break; - - case SMS_STATUS_REPORT: - result = new SMSStatusReportMessage(pdu); - break; - - case SMS_SUBMIT_REPORT: - // observed with Motorola Timeport 260, the SCtoMEdirection can - // be wrong in this case - if (at != NULL && at->getMeTa().getCapabilities()._wrongSMSStatusCode) - result = new SMSSubmitMessage(pdu); - else - result = new SMSSubmitReportMessage(pdu); - break; - - default: - throw GsmException(_("unhandled SMS TPDU type"), OtherError); - } - else - // TPDUs from ME to SC - switch (messageTypeIndicator) - { - case SMS_SUBMIT: - result = new SMSSubmitMessage(pdu); - break; - - case SMS_DELIVER_REPORT: - result = new SMSDeliverReportMessage(pdu); - break; - - case SMS_COMMAND: - result = new SMSCommandMessage(pdu); - break; - - default: - throw GsmException(_("unhandled SMS TPDU type"), OtherError); - } - result->_at = at; - return result; -} - -Ref SMSMessage::decode(istream& s) throw(gsmlib::GsmException) -{ - string pdu; - unsigned char ScToMe; - - s >> ScToMe; - s >> pdu; - - return decode(pdu,ScToMe=='S'); -} - -unsigned char SMSMessage::send(Ref &ackPdu) - throw(GsmException) -{ - if (_messageTypeIndicator != SMS_SUBMIT && - _messageTypeIndicator != SMS_COMMAND) - throw GsmException(_("can only send SMS-SUBMIT and SMS-COMMAND TPDUs"), - ParameterError); - - if (_at.isnull()) - throw GsmException(_("no device given for sending SMS"), ParameterError); - - string pdu = encode(); - Parser p(_at->sendPdu("+CMGS=" + - intToStr(pdu.length() / 2 - getSCAddressLen()), - "+CMGS:", pdu)); - unsigned char messageReference = p.parseInt(); - - if (p.parseComma(true)) - { - string pdu = p.parseEol(); - - // add missing service centre address if required by ME - if (! _at->getMeTa().getCapabilities()._hasSMSSCAprefix) - pdu = "00" + pdu; - - ackPdu = SMSMessage::decode(pdu); - } - else - ackPdu = SMSMessageRef(); - - return messageReference; -} - -unsigned char SMSMessage::send() throw(GsmException) -{ - SMSMessageRef mref; - return send(mref); -} - -unsigned int SMSMessage::getSCAddressLen() -{ - SMSEncoder e; - e.setAddress(_serviceCentreAddress, true); - return e.getLength(); -} - -unsigned char SMSMessage::userDataLength() const -{ - unsigned int udhl = _userDataHeader.length(); - if (_dataCodingScheme.getAlphabet() == DCS_DEFAULT_ALPHABET) - return _userData.length() + (udhl ? ((1 + udhl) * 8 + 6) / 7 : 0); - else - return _userData.length() + (udhl ? (1 + udhl) : 0); -} - -ostream& SMSMessage::operator<<(ostream& s) -{ - unsigned char ScToMe; - - if (dynamic_cast(this) || - dynamic_cast(this) || - dynamic_cast(this)) - { - ScToMe = 'S'; - } - else if (dynamic_cast(this) || - dynamic_cast(this) || - dynamic_cast(this)) - { - ScToMe = 'M'; - } - else - { - throw GsmException(_("unhandled SMS TPDU type"), OtherError); - } - - s << ScToMe; - return s << encode(); -} - -// SMSMessage::SMSMessage(SMSMessage &m) -// { -// _at = m._at; - -// } - -// SMSMessage &SMSMessage::operator=(SMSMessage &m) -// { -// } - -SMSMessage::~SMSMessage() {} - -// SMSDeliverMessage members - -void SMSDeliverMessage::init() -{ - _messageTypeIndicator = SMS_DELIVER; - _moreMessagesToSend = false; - _replyPath = false; - _statusReportIndication = false; - _protocolIdentifier = 0; -} - -SMSDeliverMessage::SMSDeliverMessage() -{ - init(); -} - -SMSDeliverMessage::SMSDeliverMessage(string pdu) throw(GsmException) -{ - SMSDecoder d(pdu); - _serviceCentreAddress = d.getAddress(true); - _messageTypeIndicator = (MessageType)d.get2Bits(); // bits 0..1 - assert(_messageTypeIndicator == SMS_DELIVER); - _moreMessagesToSend = d.getBit(); // bit 2 - d.getBit(); // bit 3 - d.getBit(); // bit 4 - _statusReportIndication = d.getBit(); // bit 5 - bool userDataHeaderIndicator = d.getBit(); // bit 6 - _replyPath = d.getBit(); // bit 7 - _originatingAddress = d.getAddress(); - _protocolIdentifier = d.getOctet(); - _dataCodingScheme = d.getOctet(); - _serviceCentreTimestamp = d.getTimestamp(); - unsigned char userDataLength = d.getOctet(); - d.markSeptet(); - - if (userDataHeaderIndicator) - { - _userDataHeader.decode(d); - if (_dataCodingScheme.getAlphabet() == DCS_DEFAULT_ALPHABET) - userDataLength -= ((_userDataHeader.length() + 1) * 8 + 6) / 7; - else - userDataLength -= ((string)_userDataHeader).length() + 1; - } - else - _userDataHeader = UserDataHeader(); - - if (_dataCodingScheme.getAlphabet() == DCS_DEFAULT_ALPHABET) - { // userDataLength is length in septets - _userData = d.getString(userDataLength); - _userData = gsmToLatin1(_userData); - } - else - { // userDataLength is length in octets - unsigned char *s = - (unsigned char*)alloca(sizeof(unsigned char) * userDataLength); - d.getOctets(s, userDataLength); - _userData.assign((char*)s, (unsigned int)userDataLength); - } -} - -string SMSDeliverMessage::encode() -{ - SMSEncoder e; - e.setAddress(_serviceCentreAddress, true); - e.set2Bits(_messageTypeIndicator); // bits 0..1 - e.setBit(_moreMessagesToSend); // bit 2 - e.setBit(); // bit 3 - e.setBit(); // bit 4 - e.setBit(_statusReportIndication); // bit 5 - e.setBit(_userDataHeader.length() != 0); // bit 6 - e.setBit(_replyPath); // bit 7 - e.setAddress(_originatingAddress); - e.setOctet(_protocolIdentifier); - e.setOctet(_dataCodingScheme); - e.setTimestamp(_serviceCentreTimestamp); - e.setOctet(userDataLength()); - e.markSeptet(); - if (_userDataHeader.length()) _userDataHeader.encode(e); - if (_dataCodingScheme.getAlphabet() == DCS_DEFAULT_ALPHABET) - e.setString(latin1ToGsm(_userData)); - else - e.setOctets((unsigned char*)_userData.data(), _userData.length()); - return e.getHexString(); -} - -string SMSDeliverMessage::toString() const -{ - ostrstream os; - os << dashes << endl - << _("Message type: SMS-DELIVER") << endl - << _("SC address: '") << _serviceCentreAddress._number << "'" << endl - << _("More messages to send: ") << _moreMessagesToSend << endl - << _("Reply path: ") << _replyPath << endl - << _("User data header indicator: ") - << (_userDataHeader.length()!=0) << endl - << _("Status report indication: ") << _statusReportIndication << endl - << _("Originating address: '") << _originatingAddress._number - << "'" << endl - << _("Protocol identifier: 0x") << hex - << (unsigned int)_protocolIdentifier << dec << endl - << _("Data coding scheme: ") << _dataCodingScheme.toString() << endl - << _("SC timestamp: ") << _serviceCentreTimestamp.toString() << endl - << _("User data length: ") << (int)userDataLength() << endl - << _("User data header: 0x") - << bufToHex((unsigned char*) - ((string)_userDataHeader).data(), - ((string)_userDataHeader).length()) - << endl - << _("User data: '") << _userData << "'" << endl - << dashes << endl << endl - << ends; - char *ss = os.str(); - string result(ss); - delete[] ss; - return result; -} - -Address SMSDeliverMessage::address() const -{ - return _originatingAddress; -} - -Ref SMSDeliverMessage::clone() -{ - Ref result = new SMSDeliverMessage(*this); - return result; -} - -// SMSSubmitMessage members - -void SMSSubmitMessage::init() -{ - // set everything to sensible default values - _messageTypeIndicator = SMS_SUBMIT; - _validityPeriodFormat = TimePeriod::Relative; - _validityPeriod._format = TimePeriod::Relative; - _validityPeriod._relativeTime = 168; // 2 days - _statusReportRequest = false; - _replyPath = false; - _rejectDuplicates = true; - _messageReference = 0; - _protocolIdentifier = 0; -} - -SMSSubmitMessage::SMSSubmitMessage() -{ - init(); -} - -SMSSubmitMessage::SMSSubmitMessage(string pdu) throw(GsmException) -{ - SMSDecoder d(pdu); - _serviceCentreAddress = d.getAddress(true); - _messageTypeIndicator = (MessageType)d.get2Bits(); // bits 0..1 - assert(_messageTypeIndicator == SMS_SUBMIT); - _rejectDuplicates = d.getBit(); // bit 2 - _validityPeriodFormat = (TimePeriod::Format)d.get2Bits(); // bits 3..4 - _statusReportRequest = d.getBit(); // bit 5 - bool userDataHeaderIndicator = d.getBit(); // bit 6 - _replyPath = d.getBit(); // bit 7 - _messageReference = d.getOctet(); - _destinationAddress = d.getAddress(); - _protocolIdentifier = d.getOctet(); - _dataCodingScheme = d.getOctet(); - if (_validityPeriodFormat != TimePeriod::NotPresent) - _validityPeriod = d.getTimePeriod(_validityPeriodFormat); - unsigned char userDataLength = d.getOctet(); - d.markSeptet(); - - if (userDataHeaderIndicator) - { - _userDataHeader.decode(d); - if (_dataCodingScheme.getAlphabet() == DCS_DEFAULT_ALPHABET) - userDataLength -= ((_userDataHeader.length() + 1) * 8 + 6) / 7; - else - userDataLength -= ((string)_userDataHeader).length() + 1; - } - else - _userDataHeader = UserDataHeader(); - - if (_dataCodingScheme.getAlphabet() == DCS_DEFAULT_ALPHABET) - { // userDataLength is length in septets - _userData = d.getString(userDataLength); - _userData = gsmToLatin1(_userData); - } - else - { // _userDataLength is length in octets - unsigned char *s = - (unsigned char*)alloca(sizeof(unsigned char) * userDataLength); - d.getOctets(s, userDataLength); - _userData.assign((char*)s, userDataLength); - } -} - -SMSSubmitMessage::SMSSubmitMessage(string text, string number) -{ - init(); - _destinationAddress = Address(number); - _userData = text; -} - -string SMSSubmitMessage::encode() -{ - SMSEncoder e; - e.setAddress(_serviceCentreAddress, true); - e.set2Bits(_messageTypeIndicator); // bits 0..1 - e.setBit(_rejectDuplicates); // bit 2 - e.set2Bits(_validityPeriodFormat); // bits 3..4 - e.setBit(_statusReportRequest); // bit 5 - bool userDataHeaderIndicator = _userDataHeader.length() != 0; - e.setBit(userDataHeaderIndicator); // bit 6 - e.setBit(_replyPath); // bit 7 - e.setOctet(_messageReference); - e.setAddress(_destinationAddress); - e.setOctet(_protocolIdentifier); - e.setOctet(_dataCodingScheme); - e.setTimePeriod(_validityPeriod); - e.setOctet(userDataLength()); - e.markSeptet(); - if (userDataHeaderIndicator) _userDataHeader.encode(e); - if (_dataCodingScheme.getAlphabet() == DCS_DEFAULT_ALPHABET) - e.setString(latin1ToGsm(_userData)); - else - e.setOctets((unsigned char*)_userData.data(), _userData.length()); - return e.getHexString(); -} - -string SMSSubmitMessage::toString() const -{ - ostrstream os; - os << dashes << endl - << _("Message type: SMS-SUBMIT") << endl - << _("SC address: '") << _serviceCentreAddress._number << "'" << endl - << _("Reject duplicates: ") << _rejectDuplicates << endl - << _("Validity period format: "); - switch (_validityPeriodFormat) - { - case TimePeriod::NotPresent: - os << _("not present"); - break; - case TimePeriod::Relative: - os << _("relative"); - break; - case TimePeriod::Absolute: - os << _("absolute"); - break; - default: - os << _("unknown"); - break; - } - os << endl - << _("Reply path: ") << _replyPath << endl - << _("User data header indicator: ") - << (_userDataHeader.length()!=0) << endl - << _("Status report request: ") << _statusReportRequest << endl - << _("Message reference: ") << (unsigned int)_messageReference << endl - << _("Destination address: '") << _destinationAddress._number - << "'" << endl - << _("Protocol identifier: 0x") << hex - << (unsigned int)_protocolIdentifier << dec << endl - << _("Data coding scheme: ") << _dataCodingScheme.toString() << endl - << _("Validity period: ") << _validityPeriod.toString() << endl - << _("User data length: ") << (int)userDataLength() << endl - << _("User data header: 0x") << bufToHex((unsigned char*) - ((string)_userDataHeader).data(), - _userDataHeader.length()) - << endl - << _("User data: '") << _userData << "'" << endl - << dashes << endl << endl - << ends; - char *ss = os.str(); - string result(ss); - delete[] ss; - return result; -} - -Address SMSSubmitMessage::address() const -{ - return _destinationAddress; -} - -Ref SMSSubmitMessage::clone() -{ - Ref result = new SMSSubmitMessage(*this); - return result; -} - -// SMSStatusReportMessage members - -void SMSStatusReportMessage::init() -{ - _messageTypeIndicator = SMS_STATUS_REPORT; - _moreMessagesToSend = false; - _statusReportQualifier = false; - _messageReference = 0; - _status = SMS_STATUS_RECEIVED; -} - -SMSStatusReportMessage::SMSStatusReportMessage(string pdu) throw(GsmException) -{ - SMSDecoder d(pdu); - _serviceCentreAddress = d.getAddress(true); - _messageTypeIndicator = (MessageType)d.get2Bits(); // bits 0..1 - assert(_messageTypeIndicator == SMS_STATUS_REPORT); - _moreMessagesToSend = d.getBit(); // bit 2 - d.getBit(); // bit 3 - d.getBit(); // bit 4 - _statusReportQualifier = d.getBit(); // bit 5 - _messageReference = d.getOctet(); - _recipientAddress = d.getAddress(); - _serviceCentreTimestamp = d.getTimestamp(); - _dischargeTime = d.getTimestamp(); - _status = d.getOctet(); -} - -string SMSStatusReportMessage::encode() -{ - SMSEncoder e; - e.setAddress(_serviceCentreAddress, true); - e.set2Bits(_messageTypeIndicator); // bits 0..1 - e.setBit(_moreMessagesToSend); // bit 2 - e.setBit(); // bit 3 - e.setBit(); // bit 4 - e.setBit(_statusReportQualifier); // bit 5 - e.setOctet(_messageReference); - e.setAddress(_recipientAddress); - e.setTimestamp(_serviceCentreTimestamp); - e.setTimestamp(_dischargeTime); - e.setOctet(_status); - return e.getHexString(); -} - -string SMSStatusReportMessage::toString() const -{ - ostrstream os; - os << dashes << endl - << _("Message type: SMS-STATUS-REPORT") << endl - << _("SC address: '") << _serviceCentreAddress._number << "'" << endl - << _("More messages to send: ") << _moreMessagesToSend << endl - << _("Status report qualifier: ") << _statusReportQualifier << endl - << _("Message reference: ") << (unsigned int)_messageReference << endl - << _("Recipient address: '") << _recipientAddress._number << "'" << endl - << _("SC timestamp: ") << _serviceCentreTimestamp.toString() << endl - << _("Discharge time: ") << _dischargeTime.toString() << endl - << _("Status: 0x") << hex << (unsigned int)_status << dec - << " '" << getSMSStatusString(_status) << "'" << endl - << dashes << endl << endl - << ends; - char *ss = os.str(); - string result(ss); - delete[] ss; - return result; -} - -Address SMSStatusReportMessage::address() const -{ - return _recipientAddress; -} - -Ref SMSStatusReportMessage::clone() -{ - Ref result = new SMSStatusReportMessage(*this); - return result; -} - -// SMSCommandMessage members - -void SMSCommandMessage::init() -{ - _messageTypeIndicator = SMS_COMMAND; - _messageReference = 0; - _statusReportRequest = true; - _protocolIdentifier = 0; - _commandType = EnquireSM; - _messageNumber = 0; - _commandDataLength = 0; -} - -SMSCommandMessage::SMSCommandMessage(string pdu) throw(GsmException) -{ - SMSDecoder d(pdu); - _serviceCentreAddress = d.getAddress(true); - _messageTypeIndicator = (MessageType)d.get2Bits(); // bits 0..1 - assert(_messageTypeIndicator == SMS_COMMAND); - d.getBit(); // bit 2 - d.getBit(); // bit 3 - d.getBit(); // bit 4 - _statusReportRequest = d.getBit(); // bit 5 - _messageReference = d.getOctet(); - _protocolIdentifier = d.getOctet(); - _commandType = d.getOctet(); - _messageNumber = d.getOctet(); - _destinationAddress = d.getAddress(); - _commandDataLength = d.getOctet(); - unsigned char *s = - (unsigned char*)alloca(sizeof(unsigned char) * _commandDataLength); - d.getOctets(s, _commandDataLength); -} - -string SMSCommandMessage::encode() -{ - SMSEncoder e; - e.setAddress(_serviceCentreAddress, true); - e.set2Bits(_messageTypeIndicator); // bits 0..1 - e.setBit(); // bit 2 - e.setBit(); // bit 3 - e.setBit(); // bit 4 - e.setBit(_statusReportRequest); // bit 5 - e.setOctet(_messageReference); - e.setOctet(_protocolIdentifier); - e.setOctet(_commandType); - e.setOctet(_messageNumber); - e.setAddress(_destinationAddress); - e.setOctet(_commandData.length()); - e.setOctets((const unsigned char*)_commandData.data(), - (short unsigned int)_commandData.length()); - return e.getHexString(); -} - -string SMSCommandMessage::toString() const -{ - ostrstream os; - os << dashes << endl - << _("Message type: SMS-COMMAND") << endl - << _("SC address: '") << _serviceCentreAddress._number << "'" << endl - << _("Message reference: ") << (unsigned int)_messageReference << endl - << _("Status report request: ") << _statusReportRequest << endl - << _("Protocol identifier: 0x") << hex - << (unsigned int)_protocolIdentifier << dec << endl - << _("Command type: 0x") << hex << (unsigned int)_commandType - << dec << endl - << _("Message number: ") << (unsigned int)_messageNumber << endl - << _("Destination address: '") << _destinationAddress._number - << "'" << endl - << _("Command data length: ") << (unsigned int)_commandDataLength << endl - << _("Command data: '") << _commandData << "'" << endl - << dashes << endl << endl - << ends; - char *ss = os.str(); - string result(ss); - delete[] ss; - return result; -} - -Address SMSCommandMessage::address() const -{ - return _destinationAddress; -} - -Ref SMSCommandMessage::clone() -{ - Ref result = new SMSCommandMessage(*this); - return result; -} - -// SMSDeliverReportMessage members - -void SMSDeliverReportMessage::init() -{ - _messageTypeIndicator = SMS_DELIVER_REPORT; - _protocolIdentifierPresent = false; - _dataCodingSchemePresent = false; - _userDataLengthPresent = false; -} - -SMSDeliverReportMessage::SMSDeliverReportMessage(string pdu) - throw(GsmException) -{ - SMSDecoder d(pdu); - _serviceCentreAddress = d.getAddress(true); - _messageTypeIndicator = (MessageType)d.get2Bits(); // bits 0..1 - assert(_messageTypeIndicator == SMS_DELIVER_REPORT); - d.alignOctet(); // skip to parameter indicator - _protocolIdentifierPresent = d.getBit(); // bit 0 - _dataCodingSchemePresent = d.getBit(); // bit 1 - _userDataLengthPresent = d.getBit(); // bit 2 - if (_protocolIdentifierPresent) - _protocolIdentifier = d.getOctet(); - if (_dataCodingSchemePresent) - _dataCodingScheme = d.getOctet(); - if (_userDataLengthPresent) - { - unsigned char userDataLength = d.getOctet(); - d.markSeptet(); - if (_dataCodingScheme.getAlphabet() == DCS_DEFAULT_ALPHABET) - { - _userData = d.getString(userDataLength); - _userData = gsmToLatin1(_userData); - } - else - { // userDataLength is length in octets - unsigned char *s = - (unsigned char*)alloca(sizeof(unsigned char) * userDataLength); - d.getOctets(s, userDataLength); - _userData.assign((char*)s, userDataLength); - } - } -} - -string SMSDeliverReportMessage::encode() -{ - SMSEncoder e; - e.setAddress(_serviceCentreAddress, true); - e.set2Bits(_messageTypeIndicator); // bits 0..1 - e.alignOctet(); // skip to parameter indicator - e.setBit(_protocolIdentifierPresent); // bit 0 - e.setBit(_dataCodingSchemePresent); // bit 1 - e.setBit(_userDataLengthPresent); // bit 2 - if (_protocolIdentifierPresent) - e.setOctet(_protocolIdentifier); - if (_dataCodingSchemePresent) - e.setOctet(_dataCodingScheme); - if (_userDataLengthPresent) - { - unsigned char userDataLength = _userData.length(); - e.setOctet(userDataLength); - if (_dataCodingScheme.getAlphabet() == DCS_DEFAULT_ALPHABET) - e.setString(latin1ToGsm(_userData)); - else - e.setOctets((unsigned char*)_userData.data(), userDataLength); - } - return e.getHexString(); -} - -string SMSDeliverReportMessage::toString() const -{ - ostrstream os; - os << dashes << endl - << _("Message type: SMS-DELIVER-REPORT") << endl - << _("SC address: '") << _serviceCentreAddress._number << "'" << endl - << _("Protocol identifier present: ") << _protocolIdentifierPresent - << endl - << _("Data coding scheme present: ") << _dataCodingSchemePresent << endl - << _("User data length present: ") << _userDataLengthPresent << endl; - if (_protocolIdentifierPresent) - os << _("Protocol identifier: 0x") << hex - << (unsigned int)_protocolIdentifier - << dec << endl; - if (_dataCodingSchemePresent) - os << _("Data coding scheme: ") << _dataCodingScheme.toString() << endl; - if (_userDataLengthPresent) - os << _("User data length: ") << (int)userDataLength() << endl - << _("User data: '") << _userData << "'" << endl; - os << dashes << endl << endl - << ends; - char *ss = os.str(); - string result(ss); - delete[] ss; - return result; -} - -Address SMSDeliverReportMessage::address() const -{ - assert(0); // not address, should not be in SMS store - return Address(); -} - -Ref SMSDeliverReportMessage::clone() -{ - Ref result = new SMSDeliverReportMessage(*this); - return result; -} - -// SMSSubmitReportMessage members - -void SMSSubmitReportMessage::init() -{ - _messageTypeIndicator = SMS_SUBMIT_REPORT; - _protocolIdentifierPresent = false; - _dataCodingSchemePresent = false; - _userDataLengthPresent = false; -} - -SMSSubmitReportMessage::SMSSubmitReportMessage(string pdu) throw(GsmException) -{ - SMSDecoder d(pdu); - _serviceCentreAddress = d.getAddress(true); - _messageTypeIndicator = (MessageType)d.get2Bits(); // bits 0..1 - assert(_messageTypeIndicator == SMS_SUBMIT_REPORT); - _serviceCentreTimestamp = d.getTimestamp(); - _protocolIdentifierPresent = d.getBit(); // bit 0 - _dataCodingSchemePresent = d.getBit(); // bit 1 - _userDataLengthPresent = d.getBit(); // bit 2 - if (_protocolIdentifierPresent) - _protocolIdentifier = d.getOctet(); - if (_dataCodingSchemePresent) - _dataCodingScheme = d.getOctet(); - if (_userDataLengthPresent) - { - unsigned char userDataLength = d.getOctet(); - d.markSeptet(); - if (_dataCodingScheme.getAlphabet() == DCS_DEFAULT_ALPHABET) - { - _userData = d.getString(userDataLength); - _userData = gsmToLatin1(_userData); - } - else - { // _userDataLength is length in octets - unsigned char *s = - (unsigned char*)alloca(sizeof(unsigned char) * userDataLength); - d.getOctets(s, userDataLength); - _userData.assign((char*)s, userDataLength); - } - } -} - -string SMSSubmitReportMessage::encode() -{ - SMSEncoder e; - e.setAddress(_serviceCentreAddress, true); - e.set2Bits(_messageTypeIndicator); // bits 0..1 - e.setTimestamp(_serviceCentreTimestamp); - e.setBit(_protocolIdentifierPresent); // bit 0 - e.setBit(_dataCodingSchemePresent); // bit 1 - e.setBit(_userDataLengthPresent); // bit 2 - if (_protocolIdentifierPresent) - e.setOctet(_protocolIdentifier); - if (_dataCodingSchemePresent) - e.setOctet(_dataCodingScheme); - if (_userDataLengthPresent) - { - e.setOctet(userDataLength()); - if (_dataCodingScheme.getAlphabet() == DCS_DEFAULT_ALPHABET) - e.setString(latin1ToGsm(_userData)); - else - e.setOctets((unsigned char*)_userData.data(), _userData.length()); - } - return e.getHexString(); -} - -string SMSSubmitReportMessage::toString() const -{ - ostrstream os; - os << dashes << endl - << _("Message type: SMS-SUBMIT-REPORT") << endl - << _("SC address: '") << _serviceCentreAddress._number << "'" << endl - << _("SC timestamp: ") << _serviceCentreTimestamp.toString() << endl - << _("Protocol identifier present: ") << _protocolIdentifierPresent - << endl - << _("Data coding scheme present: ") << _dataCodingSchemePresent << endl - << _("User data length present: ") << _userDataLengthPresent << endl; - if (_protocolIdentifierPresent) - os << _("Protocol identifier: 0x") << hex - << (unsigned int)_protocolIdentifier - << dec << endl; - if (_dataCodingSchemePresent) - os << _("Data coding scheme: ") << _dataCodingScheme.toString() << endl; - if (_userDataLengthPresent) - os << _("User data length: ") << (int)userDataLength() << endl - << _("User data: '") << _userData << "'" << endl; - os << dashes << endl << endl - << ends; - char *ss = os.str(); - string result(ss); - delete[] ss; - return result; -} - -Address SMSSubmitReportMessage::address() const -{ - assert(0); // not address, should not be in SMS store - return Address(); -} - -Ref SMSSubmitReportMessage::clone() -{ - Ref result = new SMSSubmitReportMessage(*this); - return result; -} - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms.h deleted file mode 100644 index bd871391bb..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms.h +++ /dev/null @@ -1,480 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_sms.h -// * -// * Purpose: SMS functions -// * (ETSI GSM 07.05) -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 16.5.1999 -// ************************************************************************* - -#ifndef GSM_SMS_H -#define GSM_SMS_H - -#include -#include -#include -#include -#include -#include - -using namespace std; - -namespace gsmlib -{ - // forward declarations - class SMSStore; - class SMSMessage; - - // this class represents a single SMS message - class SMSMessage : public RefBase - { - private: - Ref _at; // connection to the device - - public: - // possible values for message type indicator - enum MessageType {SMS_DELIVER = 0, SMS_DELIVER_REPORT = 0, - SMS_STATUS_REPORT = 2, SMS_COMMAND = 2, - SMS_SUBMIT = 1, SMS_SUBMIT_REPORT = 1}; - - protected: - // fields of the different TPDUs - // all PDUs - string _userData; - UserDataHeader _userDataHeader; - Address _serviceCentreAddress; - MessageType _messageTypeIndicator;// 2 bits - DataCodingScheme _dataCodingScheme; - - public: - // decode hexadecimal pdu string - // return SMSMessage of the appropriate type - // differentiate between SMS transfer directions SC to ME, ME to SC - // also give GsmAt object for send() - static Ref decode(string pdu, - bool SCtoMEdirection = true, - GsmAt *at = NULL) - throw(GsmException); - - static Ref decode(istream& s) throw(GsmException); - - // encode pdu, return hexadecimal pdu string - virtual string encode() = 0; - - // send this PDU - // returns message reference and ACK-PDU (if requested) - // only applicate to SMS-SUBMIT and SMS-COMMAND - unsigned char send(Ref &ackPdu) throw(GsmException); - - // same as above, but ACK-PDU is discarded - unsigned char send() throw(GsmException); - - // create textual representation of SMS - virtual string toString() const = 0; - - // return deep copy of this message - virtual Ref clone() = 0; - - // return length of SC address when encoded - unsigned int getSCAddressLen(); - - // accessor functions - MessageType messageType() const {return _messageTypeIndicator;} - Address serviceCentreAddress() const {return _serviceCentreAddress;} - - // provided for sorting messages by timestamp - virtual Timestamp serviceCentreTimestamp() const {return Timestamp();} - - // return recipient, destination etc. address (for sorting by address) - virtual Address address() const = 0; - - virtual void setUserData(string x) {_userData = x;} - virtual string userData() const {return _userData;} - - // return the size of user data (including user data header) - unsigned char userDataLength() const; - - // accessor functions - virtual void setUserDataHeader(UserDataHeader x) {_userDataHeader = x;} - virtual UserDataHeader userDataHeader() const {return _userDataHeader;} - - virtual DataCodingScheme dataCodingScheme() const - {return _dataCodingScheme;} - virtual void setDataCodingScheme(DataCodingScheme x) - {_dataCodingScheme = x;} - - void setServiceCentreAddress(Address &x) {_serviceCentreAddress = x;} - void setAt(Ref at) {_at = at;} - - virtual ~SMSMessage(); - - // print ASCII hex representation of message - ostream& operator<<(ostream& s); - - // copy constructor and assignment -// SMSMessage(SMSMessage &m); -// SMSMessage &operator=(SMSMessage &m); - - friend class SMSStore; - }; - - // SMS-DELIVER TPDU - class SMSDeliverMessage : public SMSMessage - { - private: - // SMS-DELIVER PDU members (see GSM 03.40 section 9.2.2.1) - bool _moreMessagesToSend; - bool _replyPath; - bool _statusReportIndication; - Address _originatingAddress; - unsigned char _protocolIdentifier; // octet - Timestamp _serviceCentreTimestamp; - - // initialize members to sensible values - void init(); - - public: - // constructor, sets sensible default values - SMSDeliverMessage(); - - // constructor with given pdu - SMSDeliverMessage(string pdu) throw(GsmException); - - // encode pdu, return hexadecimal pdu string - virtual string encode(); - - // create textual representation of SMS - virtual string toString() const; - - // inherited from SMSMessage - Address address() const; - Ref clone(); - - // accessor functions - bool moreMessagesToSend() const {return _moreMessagesToSend;} - bool replyPath() const {return _replyPath;} - bool statusReportIndication() const {return _statusReportIndication;} - Address originatingAddress() const {return _originatingAddress;} - unsigned char protocolIdentifier() const {return _protocolIdentifier;} - Timestamp serviceCentreTimestamp() const {return _serviceCentreTimestamp;} - - void setMoreMessagesToSend(bool x) {_moreMessagesToSend = x;} - void setReplyPath(bool x) {_replyPath = x;} - void setStatusReportIndication(bool x) {_statusReportIndication = x;} - void setOriginatingAddress(Address &x) {_originatingAddress = x;} - void setProtocolIdentifier(unsigned char x) {_protocolIdentifier = x;} - void setServiceCentreTimestamp(Timestamp &x) {_serviceCentreTimestamp = x;} - - virtual ~SMSDeliverMessage() {} - }; - - // SMS-SUBMIT TPDU - class SMSSubmitMessage : public SMSMessage - { - private: - // SMS-SUBMIT PDU (see GSM 03.40 section 9.2.2.2) - bool _rejectDuplicates; - TimePeriod::Format _validityPeriodFormat; // 2 bits - bool _replyPath; - bool _statusReportRequest; - unsigned char _messageReference; // integer - Address _destinationAddress; - unsigned char _protocolIdentifier; - TimePeriod _validityPeriod; - - // initialize members to sensible values - void init(); - - public: - // constructor, sets sensible default values - SMSSubmitMessage(); - - // constructor with given pdu - SMSSubmitMessage(string pdu) throw(GsmException); - - // convenience constructor - // given the text and recipient telephone number - SMSSubmitMessage(string text, string number); - - // encode pdu, return hexadecimal pdu string - virtual string encode(); - - // create textual representation of SMS - virtual string toString() const; - - // inherited from SMSMessage - Address address() const; - Ref clone(); - - // accessor functions - bool rejectDuplicates() const {return _rejectDuplicates;} - TimePeriod::Format validityPeriodFormat() const - {return _validityPeriodFormat;} - bool replyPath() const {return _replyPath;} - bool statusReportRequest() const {return _statusReportRequest;} - unsigned char messageReference() const {return _messageReference;} - Address destinationAddress() const {return _destinationAddress;} - unsigned char protocolIdentifier() const {return _protocolIdentifier;} - TimePeriod validityPeriod() const {return _validityPeriod;} - - void setRejectDuplicates(bool x) {_rejectDuplicates = x;} - void setValidityPeriodFormat(TimePeriod::Format &x) - {_validityPeriodFormat = x;} - void setReplyPath(bool x) {_replyPath = x;} - void setStatusReportRequest(bool x) {_statusReportRequest = x;} - void setMessageReference(unsigned char x) {_messageReference = x;} - void setDestinationAddress(Address &x) {_destinationAddress = x;} - void setProtocolIdentifier(unsigned char x) {_protocolIdentifier = x;} - void setValidityPeriod(TimePeriod &x) {_validityPeriod = x;} - - virtual ~SMSSubmitMessage() {} - }; - - // SMS-STATUS-REPORT TPDU - class SMSStatusReportMessage : public SMSMessage - { - private: - // SMS-STATUS-REPORT PDU (see GSM 03.40 section 9.2.2.3) - bool _moreMessagesToSend; - bool _statusReportQualifier; - unsigned char _messageReference; - Address _recipientAddress; - Timestamp _serviceCentreTimestamp; - Timestamp _dischargeTime; - unsigned char _status; // octet - - // initialize members to sensible values - void init(); - - public: - // constructor, sets sensible default values - SMSStatusReportMessage() {init();} - - // constructor with given pdu - SMSStatusReportMessage(string pdu) throw(GsmException); - - // encode pdu, return hexadecimal pdu string - virtual string encode(); - - // create textual representation of SMS - virtual string toString() const; - - // inherited from SMSMessage - Address address() const; - Ref clone(); - - // accessor functions - bool moreMessagesToSend() const {return _moreMessagesToSend;} - bool statusReportQualifier() const {return _statusReportQualifier;} - unsigned char messageReference() const {return _messageReference;} - Address recipientAddress() const {return _recipientAddress;} - Timestamp serviceCentreTimestamp() const {return _serviceCentreTimestamp;} - Timestamp dischargeTime() const {return _dischargeTime;} - unsigned char status() const {return _status;} - - void setMoreMessagesToSend(bool x) {_moreMessagesToSend = x;} - void setStatusReportQualifier(bool x) {_statusReportQualifier = x;} - void setMessageReference(unsigned char x) {_messageReference = x;} - void setRecipientAddress(Address x) {_recipientAddress = x;} - void setServiceCentreTimestamp(Timestamp x) {_serviceCentreTimestamp = x;} - void setDischargeTime(Timestamp x) {_serviceCentreTimestamp = x;} - void setStatus(unsigned char x) {_status = x;} - - virtual ~SMSStatusReportMessage() {} - }; - - // SMS-COMMAND TPDU - class SMSCommandMessage : public SMSMessage - { - public: - // command types, other values are reserved or SC-specific - enum CommandType {EnquireSM = 0, CancelStatusReportRequest = 1, - DeleteSubmittedSM = 2, EnalbeStatusReportRequest = 3}; - - private: - // SMS-COMMAND PDU (see GSM 03.40 section 9.2.2.4) - unsigned char _messageReference; - bool _statusReportRequest; - unsigned char _protocolIdentifier; - unsigned char _commandType; - unsigned char _messageNumber; - Address _destinationAddress; - unsigned char _commandDataLength; - string _commandData; - - // initialize members to sensible values - void init(); - - public: - // constructor, sets sensible default values - SMSCommandMessage() {init();} - - // constructor with given pdu - SMSCommandMessage(string pdu) throw(GsmException); - - // encode pdu, return hexadecimal pdu string - virtual string encode(); - - // create textual representation of SMS - virtual string toString() const; - - // inherited from SMSMessage - Address address() const; - Ref clone(); - - // accessor functions - unsigned char messageReference() const {return _messageReference;} - bool statusReportRequest() const {return _statusReportRequest;} - unsigned char protocolIdentifier() const {return _protocolIdentifier;} - unsigned char commandType() const {return _commandType;} - unsigned char messageNumber() const {return _messageNumber;} - Address destinationAddress() const {return _destinationAddress;} - unsigned char commandDataLength() const {return _commandDataLength;} - string commandData() const {return _commandData;} - - void setMessageReference(unsigned char x) {_messageReference = x;} - void setStatusReportRequest(bool x) {_statusReportRequest = x;} - void setProtocolIdentifier(unsigned char x) {_protocolIdentifier = x;} - void setCommandType(unsigned char x) {_commandType = x;} - void setMessageNumber(unsigned char x) {_messageNumber = x;} - void setDestinationAddress(Address &x) {_destinationAddress = x;} - void setCommandDataLength(unsigned char x) {_commandDataLength = x;} - void setCommandData(string x) {_commandData = x;} - - virtual ~SMSCommandMessage() {} - }; - - // SMS-DELIVER-REPORT TPDU for RP-ACK - class SMSDeliverReportMessage : public SMSMessage - { - private: - // SMS-DELIVER-REPORT PDU (see GSM 03.40 section 9.2.2.1a (II)) - bool _protocolIdentifierPresent; // parameter indicator - bool _dataCodingSchemePresent; - bool _userDataLengthPresent; - unsigned char _protocolIdentifier; - - // initialize members to sensible values - void init(); - - public: - // constructor, sets sensible default values - SMSDeliverReportMessage() {init();} - - // constructor with given pdu - SMSDeliverReportMessage(string pdu) throw(GsmException); - - // encode pdu, return hexadecimal pdu string - virtual string encode(); - - // create textual representation of SMS - virtual string toString() const; - - // inherited from SMSMessage - Address address() const; - Ref clone(); - - // accessor functions - bool protocolIdentifierPresent() const {return _protocolIdentifierPresent;} - bool dataCodingSchemePresent() const {return _dataCodingSchemePresent;} - bool userDataLengthPresent() const {return _userDataLengthPresent;} - unsigned char protocolIdentifier() const - {assert(_protocolIdentifierPresent); return _protocolIdentifier;} - DataCodingScheme dataCodingScheme() const - {assert(_dataCodingSchemePresent); return _dataCodingScheme;} - UserDataHeader userDataHeader() const - {assert(_userDataLengthPresent); return _userDataHeader;} - string userData() const - {assert(_userDataLengthPresent); return _userData;} - - void setProtocolIdentifier(unsigned char x) - {_protocolIdentifierPresent = true; _protocolIdentifier = x;} - void setDataCodingScheme(DataCodingScheme x) - {_dataCodingSchemePresent = true; _dataCodingScheme = x;} - void setUserDataHeader(UserDataHeader x) - { - _userDataLengthPresent = true; - _userDataHeader = x; - } - void setUserData(string x) - { - _userDataLengthPresent = true; - _userData = x; - } - - virtual ~SMSDeliverReportMessage() {} - }; - - // SMS-SUBMIT-REPORT TPDU for RP-ACK - class SMSSubmitReportMessage : public SMSMessage - { - private: - // SMS-SUBMIT-REPORT PDU (see GSM 03.40 section 9.2.2.2a (II)) - Timestamp _serviceCentreTimestamp; - bool _protocolIdentifierPresent; // parameter indicator - bool _dataCodingSchemePresent; - bool _userDataLengthPresent; - unsigned char _protocolIdentifier; - DataCodingScheme _dataCodingScheme; - - // initialize members to sensible values - void init(); - - public: - // constructor, sets sensible default values - SMSSubmitReportMessage() {init();} - - // constructor with given pdu - SMSSubmitReportMessage(string pdu) throw(GsmException); - - // encode pdu, return hexadecimal pdu string - virtual string encode(); - - // create textual representation of SMS - virtual string toString() const; - - // inherited from SMSMessage - Address address() const; - Ref clone(); - - // accessor functions - Timestamp serviceCentreTimestamp() const {return _serviceCentreTimestamp;} - bool protocolIdentifierPresent() const {return _protocolIdentifierPresent;} - bool dataCodingSchemePresent() const {return _dataCodingSchemePresent;} - bool userDataLengthPresent() const {return _userDataLengthPresent;} - unsigned char protocolIdentifier() const - {assert(_protocolIdentifierPresent); return _protocolIdentifier;} - DataCodingScheme dataCodingScheme() const - {assert(_dataCodingSchemePresent); return _dataCodingScheme;} - UserDataHeader userDataHeader() const - {assert(_userDataLengthPresent); return _userDataHeader;} - string userData() const - {assert(_userDataLengthPresent); return _userData;} - - void setServiceCentreTimestamp(Timestamp &x) {_serviceCentreTimestamp = x;} - void setProtocolIdentifier(unsigned char x) - {_protocolIdentifierPresent = true; _protocolIdentifier = x;} - void setDataCodingScheme(DataCodingScheme x) - {_dataCodingSchemePresent = true; _dataCodingScheme = x;} - void setUserDataHeader(UserDataHeader x) - { - _userDataLengthPresent = true; - _userDataHeader = x; - } - void setUserData(string x) - { - _userDataLengthPresent = true; - _userData = x; - } - virtual ~SMSSubmitReportMessage() {} - }; - - // some useful typdefs - typedef Ref SMSMessageRef; -}; - -#endif // GSM_SMS_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_codec.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_codec.cc deleted file mode 100644 index cdcb0032bc..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_codec.cc +++ /dev/null @@ -1,702 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_sms_codec.cc -// * -// * Purpose: Coder and Encoder for SMS TPDUs -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 17.5.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#ifdef HAVE_STRING_H -#include -#endif -#include -#include -using namespace std; -using namespace gsmlib; - -// Address members - -Address::Address(string number) : _plan(ISDN_Telephone) -{ - number = removeWhiteSpace(number); - if (number.length() > 0 && number[0] == '+') - { - _type = International; - _number = number.substr(1, number.length() - 1); - } - else - { - _type = Unknown; - _number = number; - } -} - -string Address::toString() const -{ - if (_type == International) - return "+" + _number; - else - return _number; -} - -bool gsmlib::operator<(const Address &x, const Address &y) -{ - // normalize numbers according to the following two rules: - // - prepend "+" if international number - // - append 0s to the shorter number so that both numbers have equal length - string xnumber = x._number; - string ynumber = y._number; - static string twenty0s = "00000000000000000000"; - - if (x._type == Address::International) xnumber = "+" + xnumber; - if (y._type == Address::International) ynumber = "+" + ynumber; - - while (xnumber.length() != ynumber.length()) - if (xnumber.length() < ynumber.length()) - { - int diff = ynumber.length() - xnumber.length(); - xnumber += twenty0s.substr(0, (diff > 20 ? 20 : diff)); - } - else - { - int diff = xnumber.length() - ynumber.length(); - ynumber += twenty0s.substr(0, (diff > 20 ? 20 : diff)); - } - - return xnumber < ynumber; -} - -bool gsmlib::operator==(const Address &x, const Address &y) -{ - return x._number == y._number && x._plan == y._plan; -} - -// Timestamp members - -bool Timestamp::empty() const -{ - return _year == 0 && _month == 0 && _day == 0 && _hour == 0 && - _minute == 0 && _seconds == 0 && _timeZoneMinutes == 0; -} - -string Timestamp::toString(bool appendTimeZone) const -{ - short timeZoneMinutes = _timeZoneMinutes; - short timeZoneHours = timeZoneMinutes / 60; - timeZoneMinutes %= 60; - - // format date and time in a locale-specific way - struct tm t; - t.tm_sec = _seconds; - t.tm_min = _minute; - t.tm_hour = _hour; - t.tm_mon = _month - 1; - // year 2000 heuristics, SMSs cannot be older than start of GSM network - t.tm_year = _year < 80 ? _year + 100 : _year; - t.tm_mday = _day; - t.tm_isdst = -1; - t.tm_yday = 0; - t.tm_wday = 0; - -#ifdef BROKEN_STRFTIME - char formattedTime[1024]; - strftime(formattedTime, 1024, "%x %X", &t); -#else - int formattedTimeSize = strftime(NULL, INT_MAX, "%x %X", &t) + 1; - char *formattedTime = (char*)alloca(sizeof(char) * formattedTimeSize); - strftime(formattedTime, formattedTimeSize, "%x %X", &t); -#endif - - if (! appendTimeZone) - return formattedTime; - - ostrstream os; - os << formattedTime << " (" << (_negativeTimeZone ? '-' : '+') - << setfill('0') << setw(2) << timeZoneHours - << setw(2) << timeZoneMinutes << ')' << ends; - char *ss = os.str(); - string result(ss); - delete[] ss; - return result; -} - -bool gsmlib::operator<(const Timestamp &x, const Timestamp &y) -{ - // we don't take time zone info into account because - // - it's more complicated to compute - // - it might confuse the user for whom it's also too complicated - if (x._year < y._year) - return true; - else if (x._year > y._year) - return false; - - if (x._month < y._month) - return true; - else if (x._month > y._month) - return false; - - if (x._day < y._day) - return true; - else if (x._day > y._day) - return false; - - if (x._hour < y._hour) - return true; - else if (x._hour > y._hour) - return false; - - if (x._minute < y._minute) - return true; - else if (x._minute > y._minute) - return false; - - return x._seconds < y._seconds; -} - -bool gsmlib::operator==(const Timestamp &x, const Timestamp &y) -{ - // we don't take time zone info in order to be consistent with operator< - return x._year == y._year && x._month == y._month && x._day == y._day && - x._hour == y._hour && x._minute == y._minute && x._seconds == y._seconds; -} - -// TimePeriod members - -string TimePeriod::toString() const -{ - switch (_format) - { - case NotPresent: - return _("not present"); - case Relative: - { - ostrstream os; - if (_relativeTime <= 143) - os << ((int)_relativeTime + 1) * 5 << _(" minutes"); - else if (_relativeTime <= 167) - os << 12 * 60 + ((int)_relativeTime - 143) * 30 << _(" minutes"); - else if (_relativeTime <= 196) - os << (int)_relativeTime - 166 << _(" days"); - else if (_relativeTime <= 143) - os << (int)_relativeTime - 192 << _(" weeks"); - os << ends; - char *ss = os.str(); - string result(ss); - delete[] ss; - return result; - } - case Absolute: - return _absoluteTime.toString(); - default: - return _("unknown"); - } -} - -// DataCodingScheme members - -string DataCodingScheme::toString() const -{ - string result; - if (compressed()) result += _("compressed "); - if (messageWaitingIndication()) - switch (getMessageWaitingType()) - { - case DCS_VOICEMAIL_MESSAGE_WAITING: - result += _("voicemail message waiting"); - break; - case DCS_FAX_MESSAGE_WAITING: - result += _("fax message waiting"); - break; - case DCS_ELECTRONIC_MAIL_MESSAGE_WAITING: - result += _("electronic mail message waiting"); - break; - case DCS_OTHER_MESSAGE_WAITING: - result += _("other message waiting"); - break; - } - else - switch (getAlphabet()) - { - case DCS_DEFAULT_ALPHABET: - result += _("default alphabet"); - break; - case DCS_EIGHT_BIT_ALPHABET: - result += _("8-bit alphabet"); - break; - case DCS_SIXTEEN_BIT_ALPHABET: - result += _("16-bit alphabet"); - break; - case DCS_RESERVED_ALPHABET: - result += _("reserved alphabet"); - break; - } - return result; -} - -// SMSDecoder members - -SMSDecoder::SMSDecoder(string pdu) : _bi(0), _septetStart(NULL) -{ - _p = new unsigned char[pdu.length() / 2]; - _op = _p; - if (! hexToBuf(pdu, _p)) - throw GsmException(_("bad hexadecimal PDU format"), SMSFormatError); - _maxop = _op + pdu.length() / 2; -} - -void SMSDecoder::alignOctet() -{ - if (_bi != 0) - { - _bi = 0; - ++_op; - } -} - -void SMSDecoder::alignSeptet() -{ - assert(_septetStart != NULL); - while (((_op - _septetStart) * 8 + _bi) % 7 != 0) getBit(); -} - -unsigned char SMSDecoder::get2Bits() -{ - unsigned char result = getBit(); - return result | (getBit() << 1); -} - -unsigned char SMSDecoder::getOctet() -{ - alignOctet(); - if (_op >= _maxop) - throw GsmException(_("premature end of PDU"), SMSFormatError); - return *_op++; -} - -void SMSDecoder::getOctets(unsigned char* octets, unsigned short length) -{ - alignOctet(); - for (unsigned short i = 0; i < length; ++i) - { - if (_op >= _maxop) - throw GsmException(_("premature end of PDU"), SMSFormatError); - *octets++ = *_op++; - } -} - -string SMSDecoder::getSemiOctets(unsigned short length) -{ - string result; - result.reserve(length); - alignOctet(); - for (unsigned short i = 0; i < length; ++i) - { - if (_bi == 0) - { - if (_op >= _maxop) - throw GsmException(_("premature end of PDU"), SMSFormatError); - // bits 0..3 are most significant - result += '0' + (*_op & 0xf); - _bi = 4; - } - else - { - if (_op >= _maxop) - throw GsmException(_("premature end of PDU"), SMSFormatError); - // bits 4..7 are least significant, skip 0xf digit - if ((*_op & 0xf0) != 0xf0) - result += '0' + (*_op >> 4); - _bi = 0; - ++_op; - } - } - alignOctet(); - return result; -} - -unsigned long SMSDecoder::getSemiOctetsInteger(unsigned short length) -{ - unsigned long result = 0; - alignOctet(); - for (unsigned short i = 0; i < length; ++i) - { - if (_bi == 0) - { - if (_op >= _maxop) - throw GsmException(_("premature end of PDU"), SMSFormatError); - // bits 0..3 are most significant - result = result * 10 + (*_op & 0xf); - _bi = 4; - } - else - { - if (_op >= _maxop) - throw GsmException(_("premature end of PDU"), SMSFormatError); - // bits 4..7 are least significant, skip 0xf digit - if ((*_op & 0xf0) != 0xf0) - result = result * 10 + (*_op >> 4); - _bi = 0; - ++_op; - } - } - alignOctet(); - return result; -} - -unsigned long SMSDecoder::getTimeZone(bool &negativeTimeZone) -{ - unsigned long result = 0; - alignOctet(); - for (unsigned short i = 0; i < 2; ++i) - { - if (_bi == 0) - { - if (_op >= _maxop) - throw GsmException(_("premature end of PDU"), SMSFormatError); - // bits 0..3 are most significant - if (i == 0) - { // get sign - result = result * 10 + (*_op & 0x7); - negativeTimeZone = (*_op & 0x8 == 0); - } - else - result = result * 10 + (*_op & 0xf); - _bi = 4; - } - else - { - if (_op >= _maxop) - throw GsmException(_("premature end of PDU"), SMSFormatError); - // bits 4..7 are least significant - result = result * 10 + (*_op >> 4); - _bi = 0; - ++_op; - } - } - alignOctet(); - return result * 15; // compute minutes -} - -unsigned long SMSDecoder::getInteger(unsigned short length) -{ - unsigned long result = 0; - for (unsigned short i = 0; i < length; ++i) - result |= (getBit() << i); - return result; -} - -string SMSDecoder::getString(unsigned short length) -{ - string result; - alignSeptet(); - for (unsigned short i = 0; i < length; ++i) - { - unsigned char c = 0; - for (unsigned short j = 0; j < 7; ++j) - c |= getBit() << j; - result += c; - } - return result; -} - -Address SMSDecoder::getAddress(bool scAddressFormat) -{ - Address result; - alignOctet(); - - unsigned char addressLength = getOctet(); - if (addressLength == 0 && scAddressFormat) - return result; // special case for SUBMIT-PDUs - - // parse Type-of-Address - result._plan = (Address::NumberingPlan)getInteger(4); - result._type = (Address::Type)getInteger(3); - - // get address - if (result._type == Address::Alphanumeric) - { - markSeptet(); - // addressLength is number of semi-octets - // (addressLength / 2) * 8 is number of available bits - // divided by 7 is number of 7-bit characters - result._number = gsmToLatin1(getString(addressLength * 4 / 7)); - alignOctet(); - } - else - result._number = getSemiOctets(scAddressFormat ? - (addressLength - 1) * 2 : addressLength); - return result; -} - -Timestamp SMSDecoder::getTimestamp() -{ - Timestamp result; - - result._year = getSemiOctetsInteger(2); - result._month = getSemiOctetsInteger(2); - result._day = getSemiOctetsInteger(2); - result._hour = getSemiOctetsInteger(2); - result._minute = getSemiOctetsInteger(2); - result._seconds = getSemiOctetsInteger(2); - result._timeZoneMinutes = getTimeZone(result._negativeTimeZone); - return result; -} - -TimePeriod SMSDecoder::getTimePeriod(TimePeriod::Format format) -{ - TimePeriod result; - result._format = format; - switch (format) - { - case TimePeriod::NotPresent: - break; - case TimePeriod::Relative: - result._relativeTime = getOctet(); - break; - case TimePeriod::Absolute: - result._absoluteTime = getTimestamp(); - break; - default: - throw GsmException(_("unknown time period format"), SMSFormatError); - break; - } - return result; -} - -SMSDecoder::~SMSDecoder() -{ - delete _p; -} - -// SMSEncoder members - -SMSEncoder::SMSEncoder() : _bi(0), _op(_p) -{ - memset((void*)_p, 0, sizeof(_p)); -} - -void SMSEncoder::alignOctet() -{ - if (_bi != 0) - { - _bi = 0; - ++_op; - } -} - -void SMSEncoder::alignSeptet() -{ - while (((_op - _septetStart) * 8 + _bi) % 7 != 0) setBit(); -} - -void SMSEncoder::set2Bits(unsigned char twoBits) -{ - setBit(twoBits & 1); - setBit((twoBits & 2) == 2); -} - -void SMSEncoder::setOctet(unsigned char octet) -{ - alignOctet(); - *_op++ = octet; -} - -void SMSEncoder::setOctets(const unsigned char* octets, unsigned short length) -{ - alignOctet(); - for (unsigned short i = 0; i < length; ++i) - *_op++ = octets[i]; -} - -void SMSEncoder::setSemiOctets(string semiOctets) -{ - alignOctet(); - for (unsigned int i = 0; i < semiOctets.length(); ++i) - { - if (_bi == 0) - { - *_op = semiOctets[i] - '0'; - _bi = 4; - } - else - { - *_op++ |= (semiOctets[i] - '0') << 4; - _bi = 0; - } - } - if (_bi == 4) - *_op++ |= 0xf0; - _bi = 0; -} - -void SMSEncoder::setSemiOctetsInteger(unsigned long intValue, - unsigned short length) -{ - ostrstream os; - os << intValue << ends; - char *ss = os.str(); - string s(ss); - delete[] ss; - assert(s.length() <= length); - while (s.length() < length) s = '0' + s; - setSemiOctets(s); -} - -void SMSEncoder::setTimeZone(bool negativeTimeZone, unsigned long timeZone) -{ - setSemiOctetsInteger(timeZone / 15, 2); - if (!negativeTimeZone) - *(_op - 1) |= 8; -} - -void SMSEncoder::setInteger(unsigned long intvalue, unsigned short length) -{ - for (unsigned short i = 0; i < length; ++i) - setBit((intvalue & (1 << i)) != 0); -} - -void SMSEncoder::setString(string stringValue) -{ - alignSeptet(); - for (unsigned int i = 0; i < stringValue.length(); ++i) - { - unsigned char c = stringValue[i]; - for (unsigned short j = 0; j < 7; ++j) - setBit(((1 << j) & c) != 0); - } -} - -void SMSEncoder::setAddress(Address &address, bool scAddressFormat) -{ - alignOctet(); - if (scAddressFormat) - { - unsigned int numberLen = address._number.length(); - if (numberLen == 0) - { - setOctet(0); // special case: use default SC address - return; // (set by +CSCA=) - } - setOctet(numberLen / 2 + numberLen % 2 + 1); - // not supported for SCA format - assert(address._type != Address::Alphanumeric); - } - else - if (address._type == Address::Alphanumeric) - // address in GSM default encoding, see also comment in getAddress() - setOctet((address._number.length() * 7 + 6) / 8 * 2); - else - setOctet(address._number.length()); - - setInteger(address._plan, 4); - setInteger(address._type, 3); - setBit(1); - - if (address._number.length() > 0) - if (address._type == Address::Alphanumeric) - { - markSeptet(); - setString(latin1ToGsm(address._number)); - } - else - setSemiOctets(address._number); - alignOctet(); -} - -void SMSEncoder::setTimestamp(Timestamp timestamp) -{ - setSemiOctetsInteger(timestamp._year, 2); - setSemiOctetsInteger(timestamp._month, 2); - setSemiOctetsInteger(timestamp._day, 2); - setSemiOctetsInteger(timestamp._hour, 2); - setSemiOctetsInteger(timestamp._minute, 2); - setSemiOctetsInteger(timestamp._seconds, 2); - setTimeZone(timestamp._negativeTimeZone, timestamp._timeZoneMinutes); -} - -void SMSEncoder::setTimePeriod(TimePeriod period) -{ - switch (period._format) - { - case TimePeriod::NotPresent: - break; - case TimePeriod::Relative: - setOctet(period._relativeTime); - break; - case TimePeriod::Absolute: - setTimestamp(period._absoluteTime); - break; - default: - assert(0); - break; - } -} - -string SMSEncoder::getHexString() -{ - short bi = _bi; - unsigned char *op = _op; - alignOctet(); - string result = bufToHex(_p, _op - _p); - _bi = bi; - _op = op; - return result; -} - -unsigned int SMSEncoder::getLength() -{ - short bi = _bi; - unsigned char *op = _op; - alignOctet(); - unsigned int result = _op - _p; - _bi = bi; - _op = op; - return result; -} - -// UserDataHeader members - -void UserDataHeader::encode(SMSEncoder &e) -{ - e.setOctet(_udh.length()); - e.setOctets((unsigned char*)_udh.data(), _udh.length()); -} - -void UserDataHeader::decode(SMSDecoder &d) -{ - unsigned char udhLen = d.getOctet(); - unsigned char *s = - (unsigned char*)alloca(sizeof(unsigned char) * udhLen); - d.getOctets(s, udhLen); - string ss((char*)s, (unsigned int)udhLen); - _udh = ss; -} - -string UserDataHeader::getIE(unsigned char id) -{ - int udhl, pos = 0; - - udhl = _udh.length(); - while (pos < udhl) - { - unsigned char iei = _udh[pos++]; - unsigned char ieidl = _udh[pos++]; - if (iei == id) return _udh.substr(pos, ieidl); - pos += ieidl; - } - return ""; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_codec.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_codec.h deleted file mode 100644 index 692b424561..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_codec.h +++ /dev/null @@ -1,329 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_sms_codec.h -// * -// * Purpose: Coder and Encoder for SMS TPDUs -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 16.5.1999 -// ************************************************************************* - -#ifndef GSM_SMS_CODEC_H -#define GSM_SMS_CODEC_H - -#include -#include - -using namespace std; - -namespace gsmlib -{ - // this struct represents a telephone number - // usually _type == Unknown or International - // and _number == ISDN_Telephone - struct Address - { - enum Type {Unknown = 0, International = 1, National = 2, - NetworkSpecific = 3, Subscriber = 4, - Alphanumeric = 5, Abbreviated = 6, Reserved = 7}; - enum NumberingPlan {UnknownPlan = 0, ISDN_Telephone = 1, - Data = 3, Telex = 4, NationalPlan = 8, - PrivatePlan = 9, Ermes = 10, ReservedPlan = 15}; - Type _type; - NumberingPlan _plan; - string _number; - - Address() : _type(Unknown), _plan(UnknownPlan) {} - // the constructor sets _type and _plan to defaults - // _plan == ISDN_Telephone - // _type == International if number starts with "+" - // _type == unknown otherwise - // number must be of the form "+123456" or "123456" - Address(string number); - - // return string representation - string toString() const; - - friend bool operator<(const Address &x, const Address &y); - friend bool operator==(const Address &x, const Address &y); - }; - - // compare two addresses - extern bool operator<(const Address &x, const Address &y); - extern bool operator==(const Address &x, const Address &y); - - // representation of a SMS timestamp - struct Timestamp - { - short _year, _month, _day, _hour, _minute, _seconds, _timeZoneMinutes; - bool _negativeTimeZone; - - Timestamp() : _year(0), _month(0), _day(0), _hour(0), - _minute(0), _seconds(0), _timeZoneMinutes(0), _negativeTimeZone(false) {} - - // return true if the time stamp is empty (ie. contains only zeroes) - bool empty() const; - - // return string representation - string toString(bool appendTimeZone = true) const; - - friend bool operator<(const Timestamp &x, const Timestamp &y); - friend bool operator==(const Timestamp &x, const Timestamp &y); - }; - - // compare two timestamps - extern bool operator<(const Timestamp &x, const Timestamp &y); - extern bool operator==(const Timestamp &x, const Timestamp &y); - - // representation of time period - struct TimePeriod - { - // possible values for validity period format - enum Format {NotPresent = 0, Relative = 2, Absolute = 3}; - Format _format; - Timestamp _absoluteTime; - unsigned char _relativeTime; - - TimePeriod() : _format(NotPresent), _relativeTime(0) {} - - // return string representation (already translated) - string toString() const; - }; - - // representation of DataCodingScheme - // the data coding scheme is described in detail in ETSI GSM 03.38, section 4 - const unsigned char DCS_COMPRESSED = 0x20; // bit 5 - - const unsigned char DCS_DEFAULT_ALPHABET = 0 << 2; // bit 2..3 == 0 - const unsigned char DCS_EIGHT_BIT_ALPHABET = 1 << 2; // bit 2..3 == 01 - const unsigned char DCS_SIXTEEN_BIT_ALPHABET = 2 << 2; // bit 2..3 == 10 - const unsigned char DCS_RESERVED_ALPHABET = 3 << 2; // bit 2..3 == 11 - - const unsigned char DCS_MESSAGE_WAITING_INDICATION = 0xc0; // bit 7..6 == 11 - const unsigned char DCS_VOICEMAIL_MESSAGE_WAITING = 0; - const unsigned char DCS_FAX_MESSAGE_WAITING = 1; - const unsigned char DCS_ELECTRONIC_MAIL_MESSAGE_WAITING = 2; - const unsigned char DCS_OTHER_MESSAGE_WAITING = 3; - - class DataCodingScheme - { - private: - unsigned char _dcs; - - public: - // initialize with data coding scheme octet - DataCodingScheme(unsigned char dcs) : _dcs(dcs) {} - - // set to default values (no message waiting, no message class indication, - // default 7-bit alphabet) - DataCodingScheme() : _dcs(DCS_DEFAULT_ALPHABET) {} - - // return type of alphabet used (if messageWaitingIndication == false) - unsigned char getAlphabet() const {return _dcs & (3 << 2);} - - // return true if message compressed - // (if messageWaitingIndication == false) - bool compressed() const {return _dcs & DCS_COMPRESSED == DCS_COMPRESSED;} - - // return true if message waiting indication - bool messageWaitingIndication() const - {return _dcs & DCS_MESSAGE_WAITING_INDICATION == - DCS_MESSAGE_WAITING_INDICATION;} - - // return type of waiting message (if messageWaitingIndication == true) - unsigned char getMessageWaitingType() const {return _dcs & 3;} - - // return string representation (already translated) - string toString() const; - - operator unsigned char() const {return _dcs;} - }; - - // utility class facilitate SMS TPDU decoding - class SMSDecoder - { - private: - unsigned char *_p; // buffer to hold pdu - short _bi; // bit index (0..7) - unsigned char *_op; // current octet pointer - unsigned char *_septetStart; // start of septet string - - unsigned char *_maxop; // pointer to last byte after _p - - public: - // initialize with a hexadecimal octet string containing SMS TPDU - SMSDecoder(string pdu); - - // align to octet border - void alignOctet(); - - // remember starting point of septets (important for alignSeptet()) - void markSeptet() {alignOctet(); _septetStart = _op;} - - // align to septet border - void alignSeptet(); - - // get single bit - bool getBit() - { - assert(_op < _maxop); - bool result = ((*_op >> _bi) & 1); - if (_bi == 7) - { - _bi = 0; - ++_op; - } - else - ++_bi; - return result; - } - - // get two bits - unsigned char get2Bits(); - - // get one octet - unsigned char getOctet(); - - // get string of octets of specified length - void getOctets(unsigned char* octets, unsigned short length); - - // get length semi-octets (bcd-coded number) as ASCII string of numbers - string getSemiOctets(unsigned short length); - - // get length semi-octets (bcd-coded number) as integer - unsigned long getSemiOctetsInteger(unsigned short length); - - // get time zone (in minutes) and time zone sign - unsigned long getTimeZone(bool &negativeTimeZone); - - // get integer with length number of bits - unsigned long getInteger(unsigned short length); - - // get length number of alphanumeric 7-bit characters - // markSeptet() must be called before this function - string getString(unsigned short length); - - // get address/telephone number - // service centre address has special format - Address getAddress(bool scAddressFormat = false); - - // get Timestamp - Timestamp getTimestamp(); - - // get TimePeriod of given format - TimePeriod getTimePeriod(TimePeriod::Format format); - - // destructor - ~SMSDecoder(); - }; - - // utility class for SMS TPDU encoding - class SMSEncoder - { - private: - unsigned char _p[2000]; // buffer to hold pdu (2000 should be enough) - short _bi; // bit index (0..7) - unsigned char *_op; // current octet pointer - unsigned char *_septetStart; // start of septet string - - public: - // constructor - SMSEncoder(); - - // align to octet border - void alignOctet(); - - // remember starting point of septets (important for alignSeptet()) - void markSeptet() {alignOctet(); _septetStart = _op;} - - // align to septet border - void alignSeptet(); - - // set single bit - void setBit(bool bit = false) - { - if (bit) - *_op |= (1 << _bi); - if (_bi == 7) - { - _bi = 0; - ++_op; - } - else - ++_bi; - } - - // set two bits - void set2Bits(unsigned char twoBits); - - // set one octet - void setOctet(unsigned char octet); - - // set string of octets of specified length - void setOctets(const unsigned char* octets, unsigned short length); - - // set semi-octets semiOctets (given as ASCII string of numbers) - void setSemiOctets(string semiOctets); - - // set semi-octets (given as integer) - void setSemiOctetsInteger(unsigned long intValue, unsigned short length); - - // set time zone (in minutes) and time zone sign - void setTimeZone(bool negativeTimeZone, unsigned long timeZone); - - // set integer with length number of bits - void setInteger(unsigned long intvalue, unsigned short length); - - // set alphanumeric 7-bit characters - void setString(string stringValue); - - // set address/telephone number - // service centre address has special format - void setAddress(Address &address, bool scAddressFormat = false); - - // set Timestamp - void setTimestamp(Timestamp timestamp); - - // set TimePeriod - void setTimePeriod(TimePeriod period); - - // return constructed TPDU as hex-encoded string - string getHexString(); - - // return current length of TPDU - unsigned int getLength(); - }; - - // class to handle user data header - class UserDataHeader - { - private: - string _udh; - - public: - // empty user data header - UserDataHeader() {} - - // initialize with user data header - UserDataHeader (string udh) : _udh(udh) {} - - // encode header - void encode(SMSEncoder &e); - - // decode header - void decode(SMSDecoder &d); - - // return a given information element, if present, or an empty string - string getIE(unsigned char id); - - // return the size of the header - unsigned int length() const {return _udh.length();} - - // return user data header as octet string - operator string() const {return _udh;} - }; -}; - -#endif // GSM_SMS_CODEC_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_store.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_store.cc deleted file mode 100644 index 91e15ce3a8..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_store.cc +++ /dev/null @@ -1,489 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_sms_store.cc -// * -// * Purpose: SMS functions, SMS store -// * (ETSI GSM 07.05) -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 20.5.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -// SMSStoreEntry members - -SMSStoreEntry::SMSStoreEntry() : - _status(Unknown), _cached(false), _mySMSStore(NULL), _index(0) -{ -} - - -SMSMessageRef SMSStoreEntry::message() const throw(GsmException) -{ - if (! cached()) - { - assert(_mySMSStore != NULL); - // these operations are at least "logically const" - SMSStoreEntry *thisEntry = const_cast(this); - _mySMSStore->readEntry(_index, thisEntry->_message, thisEntry->_status); - thisEntry->_cached = true; - } - return _message; -} - -CBMessageRef SMSStoreEntry::cbMessage() const throw(GsmException) -{ - assert(_mySMSStore != NULL); - - // these operations are at least "logically const" - SMSStoreEntry *thisEntry = const_cast(this); - // don't cache CB message for now - thisEntry->_cached = false; - - CBMessageRef result; - _mySMSStore->readEntry(_index, result); - return result; -} - -SMSStoreEntry::SMSMemoryStatus SMSStoreEntry::status() const - throw(GsmException) -{ - if (! cached()) - { - assert(_mySMSStore != NULL); - // these operations are at least "logically const" - SMSStoreEntry *thisEntry = const_cast(this); - _mySMSStore->readEntry(_index, thisEntry->_message, thisEntry->_status); - thisEntry->_cached = true; - } - return _status; -} - -bool SMSStoreEntry::empty() const throw(GsmException) -{ - return message().isnull(); -} - -unsigned char SMSStoreEntry::send(Ref &ackPdu) - throw(GsmException) -{ - return _mySMSStore->send(_index, ackPdu); -} - -unsigned char SMSStoreEntry::send() throw(GsmException) -{ - SMSMessageRef mref; - return send(mref); -} - -bool SMSStoreEntry::cached() const -{ - if (_mySMSStore == NULL) - return _cached; - else - return _cached && _mySMSStore->_useCache; -} - -Ref SMSStoreEntry::clone() -{ - Ref result = new SMSStoreEntry(_message->clone()); - result->_status = _status; - result->_index = _index; - return result; -} - -bool SMSStoreEntry::operator==(const SMSStoreEntry &e) const -{ - if (_message.isnull() || e._message.isnull()) - return _message.isnull() && e._message.isnull(); - else - return _message->encode() == e._message->encode(); -} - -SMSStoreEntry::SMSStoreEntry(const SMSStoreEntry &e) -{ - _message = e._message; - _status = e._status; - _cached = e._cached; - _mySMSStore = e._mySMSStore; - _index = e._index; -} - -SMSStoreEntry &SMSStoreEntry::operator=(const SMSStoreEntry &e) -{ - _message = e._message; - _status = e._status; - _cached = e._cached; - _mySMSStore = e._mySMSStore; - _index = e._index; - return *this; -} - -// iterator members - -SMSStoreEntry &SMSStoreIterator::operator*() -{ - return (*_store)[_index]; -} - -SMSStoreEntry *SMSStoreIterator::operator->() -{ - return &(*_store)[_index]; -} - -SMSStoreIterator::operator SMSStoreEntry*() -{ - return &(*_store)[_index]; -} - -SMSStoreIterator &SMSStoreIterator::operator=(const SMSStoreIterator &i) -{ - _index = i._index; - _store = i._store; - return *this; -} - -const SMSStoreEntry &SMSStoreConstIterator::operator*() -{ - return (*_store)[_index]; -} - -const SMSStoreEntry *SMSStoreConstIterator::operator->() -{ - return &(*_store)[_index]; -} - -// SMSStore members - -void SMSStore::readEntry(int index, SMSMessageRef &message, - SMSStoreEntry::SMSMemoryStatus &status) - throw(GsmException) -{ - // select SMS store - _meTa.setSMSStore(_storeName, 1); - -#ifndef NDEBUG - if (debugLevel() >= 1) - cerr << "*** Reading SMS entry " << index << endl; -#endif // NDEBUG - - string pdu; - Ref p; - try - { - p = new Parser(_at->chat("+CMGR=" + intToStr(index + 1), "+CMGR:", - pdu, false, true, true)); - } - catch (GsmException &ge) - { - if (ge.getErrorCode() != SMS_INVALID_MEMORY_INDEX) - throw ge; - else - { - message = SMSMessageRef(); - status = SMSStoreEntry::Unknown; - return; - } - } - - if (pdu.length() == 0) - { - message = SMSMessageRef(); - status = SMSStoreEntry::Unknown; - } - else - { - // add missing service centre address if required by ME - if (! _at->getMeTa().getCapabilities()._hasSMSSCAprefix) - pdu = "00" + pdu; - - status = (SMSStoreEntry::SMSMemoryStatus)p->parseInt(); - - // ignore the rest of the line - message = SMSMessageRef( - SMSMessage::decode(pdu, - !(status == SMSStoreEntry::StoredUnsent || - status == SMSStoreEntry::StoredSent), - _at.getptr())); - } -} - -void SMSStore::readEntry(int index, CBMessageRef &message) - throw(GsmException) -{ - // select SMS store - _meTa.setSMSStore(_storeName, 1); - -#ifndef NDEBUG - if (debugLevel() >= 1) - cerr << "*** Reading CB entry " << index << endl; -#endif // NDEBUG - - string pdu; - Ref p; - try - { - // this is just one row splitted in two part - // (msvc6 fail with internal compiler error) - string s = _at->chat("+CMGR=" + intToStr(index + 1), "+CMGR:", - pdu, false, true, true); - p = new Parser(s); - } - catch (GsmException &ge) - { - if (ge.getErrorCode() != SMS_INVALID_MEMORY_INDEX) - throw ge; - else - { - message = CBMessageRef(); - return; - } - } - - if (pdu.length() == 0) - message = CBMessageRef(); - else - message = CBMessageRef(new CBMessage(pdu)); -} - -void SMSStore::writeEntry(int &index, SMSMessageRef message) - throw(GsmException) -{ - // select SMS store - _meTa.setSMSStore(_storeName, 2); - -#ifndef NDEBUG - if (debugLevel() >= 1) - cerr << "*** Writing SMS entry " << index << endl; -#endif - - // compute length of pdu - string pdu = message->encode(); - - // set message status to "RECEIVED READ" for SMS_DELIVER, SMS_STATUS_REPORT - string statusString; - - // Normally the ",1" sets the message status to "REC READ" (received read) - // which is appropriate for all non-submit messages - // Motorola Timeport 260 does not like this code, though - // DELIVER messages are magically recognized anyway - if (message->messageType() != SMSMessage::SMS_SUBMIT && - ! _at->getMeTa().getCapabilities()._wrongSMSStatusCode) - statusString = ",1"; - - Parser p(_at->sendPdu("+CMGW=" + - intToStr(pdu.length() / 2 - - message->getSCAddressLen()) + statusString, - "+CMGW:", pdu)); - index = p.parseInt() - 1; -} - -void SMSStore::eraseEntry(int index) throw(GsmException) -{ - // Select SMS store - _meTa.setSMSStore(_storeName, 1); - -#ifndef NDEBUG - if (debugLevel() >= 1) - cerr << "*** Erasing SMS entry " << index << endl; -#endif - - _at->chat("+CMGD=" + intToStr(index + 1)); -} - -unsigned char SMSStore::send(int index, Ref &ackPdu) - throw(GsmException) -{ - Parser p(_at->chat("+CMSS=" + intToStr(index + 1), "+CMSS:")); - unsigned char messageReference = p.parseInt(); - - if (p.parseComma(true)) - { - string pdu = p.parseEol(); - - // add missing service centre address if required by ME - if (! _at->getMeTa().getCapabilities()._hasSMSSCAprefix) - pdu = "00" + pdu; - - ackPdu = SMSMessage::decode(pdu); - } - else - ackPdu = SMSMessageRef(); - - return messageReference; -} - -int SMSStore::doInsert(SMSMessageRef message) - throw(GsmException) -{ - int index; - writeEntry(index, message); - // it is safer to force reading back the SMS from the ME - resizeStore(index + 1); - _store[index]->_cached = false; - return index; -} - -SMSStore::SMSStore(string storeName, Ref at, MeTa &meTa) - throw(GsmException) : - _storeName(storeName), _at(at), _meTa(meTa), _useCache(true) -{ - // select SMS store - Parser p(_meTa.setSMSStore(_storeName, true, true)); - - p.parseInt(); // skip number of used mems - p.parseComma(); - - resizeStore(p.parseInt()); // ignore rest of line -} - -void SMSStore::resizeStore(int newSize) -{ - int oldSize = _store.size(); - if (newSize > oldSize) - { - // cout << "*** Resizing from " << oldSize << " to " << newSize << endl; - _store.resize(newSize); - - // initialize store entries - for (int i = oldSize; i < newSize; i++) - { - _store[i] = new SMSStoreEntry(); - _store[i]->_index = i; - _store[i]->_cached = false; - _store[i]->_mySMSStore = this; - } - } -} - -SMSStore::iterator SMSStore::begin() -{ - return SMSStoreIterator(0, this); -} - -SMSStore::const_iterator SMSStore::begin() const -{ - return SMSStoreConstIterator(0, this); -} - -SMSStore::iterator SMSStore::end() -{ - return SMSStoreIterator(_store.size(), this); -} - -SMSStore::const_iterator SMSStore::end() const -{ - return SMSStoreConstIterator(_store.size(), this); -} - -SMSStore::reference SMSStore::operator[](int n) -{ - resizeStore(n + 1); - return *_store[n]; -} - -SMSStore::const_reference SMSStore::operator[](int n) const -{ - const_cast(this)->resizeStore(n + 1); - return *_store[n]; -} - -SMSStore::reference SMSStore::front() -{ - return *_store[0]; -} - -SMSStore::const_reference SMSStore::front() const -{ - return *_store[0]; -} - -SMSStore::reference SMSStore::back() -{ - return *_store.back(); -} - -SMSStore::const_reference SMSStore::back() const -{ - return *_store.back(); -} - -int SMSStore::size() const throw(GsmException) -{ - // select SMS store - Parser p(_meTa.setSMSStore(_storeName, 1, true)); - - return p.parseInt(); -} - -SMSStore::iterator SMSStore::insert(iterator position, - const SMSStoreEntry& x) - throw(GsmException) -{ - int index = doInsert(x.message()); - return SMSStoreIterator(index, this); -} - -SMSStore::iterator SMSStore::insert(const SMSStoreEntry& x) - throw(GsmException) -{ - int index = doInsert(x.message()); - return SMSStoreIterator(index, this); -} - -void SMSStore::insert (iterator pos, int n, const SMSStoreEntry& x) - throw(GsmException) -{ - for (int i = 0; i < n; i++) - doInsert(x.message()); -} - -void SMSStore::insert (iterator pos, long n, const SMSStoreEntry& x) - throw(GsmException) -{ - for (long i = 0; i < n; i++) - doInsert(x.message()); -} - -SMSStore::iterator SMSStore::erase(iterator position) - throw(GsmException) -{ - eraseEntry(position->_index); - position->_cached = false; - return position + 1; -} - -SMSStore::iterator SMSStore::erase(iterator first, iterator last) - throw(GsmException) -{ - iterator i(0, this); - for (i = first; i != last; ++i) - erase(i); - return i; -} - -void SMSStore::clear() throw(GsmException) -{ - for (iterator i = begin(); i != end(); ++i) - erase(i); -} - -SMSStore::~SMSStore() -{ - for (vector::iterator i = _store.begin(); - i != _store.end(); ++i) - delete *i; -} - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_store.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_store.h deleted file mode 100644 index 59d0ec8eac..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sms_store.h +++ /dev/null @@ -1,295 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_sms_store.h -// * -// * Purpose: SMS functions, SMS store -// * (ETSI GSM 07.05) -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 20.5.1999 -// ************************************************************************* - -#ifndef GSM_SMS_STORE_H -#define GSM_SMS_STORE_H - -#include -#include -#include -#include -#include -#include - -using namespace std; - -namespace gsmlib -{ - // forward declarations - class SMSStore; - class MeTa; - - // a single entry in the SMS store - - class SMSStoreEntry : public RefBase - { - public: - // status in ME memory - enum SMSMemoryStatus {ReceivedUnread = 0, ReceivedRead = 1, - StoredUnsent = 2, StoredSent = 3, - All = 4, Unknown = 5}; - - private: - SMSMessageRef _message; - SMSMemoryStatus _status; - bool _cached; - SMSStore *_mySMSStore; - int _index; - - public: - // this constructor is only used by SMSStore - SMSStoreEntry(); - - // create new entry given a SMS message - SMSStoreEntry(SMSMessageRef message) : - _message(message), _status(Unknown), _cached(true), _mySMSStore(NULL), - _index(0) {} - - // create new entry given a SMS message and an index - // only to be used for file-based stores (see gsm_sorted_sms_store) - SMSStoreEntry(SMSMessageRef message, int index) : - _message(message), _status(Unknown), _cached(true), _mySMSStore(NULL), - _index(index) {} - - // clear cached flag - void clearCached() { _cached = false; } - - // return SMS message stored in the entry - SMSMessageRef message() const throw(GsmException); - - // return CB message stored in the entry - CBMessageRef cbMessage() const throw(GsmException); - - // return message status in store - SMSMemoryStatus status() const throw(GsmException); - - // return true if empty, ie. no SMS in this entry - bool empty() const throw(GsmException); - - // send this PDU from store - // returns message reference and ACK-PDU (if requested) - // only applicate to SMS-SUBMIT and SMS-COMMAND - unsigned char send(Ref &ackPdu) throw(GsmException); - - // same as above, but ACK-PDU is discarded - unsigned char send() throw(GsmException); - - // return index (guaranteed to be unique, - // can be used for identification in store) - int index() const {return _index;} - - // return true if entry is cached (and caching is enabled) - bool cached() const; - - // return deep copy of this entry - Ref clone(); - - // equality operator - bool operator==(const SMSStoreEntry &e) const; - - // return store reference - SMSStore *getStore() {return _mySMSStore;} - - // copy constructor and assignment - SMSStoreEntry(const SMSStoreEntry &e); - SMSStoreEntry &operator=(const SMSStoreEntry &e); - - friend class SMSStore; - }; - - // iterator for the SMSStore class - -#if __GNUC__ == 2 && __GNUC_MINOR__ == 95 - class SMSStoreIterator : public random_access_iterator -#else - class SMSStoreIterator : public iterator -#endif - { - int _index; - SMSStore *_store; - - SMSStoreIterator(int index, SMSStore *store) : - _index(index), _store(store) {} - - public: - SMSStoreIterator(SMSStoreEntry *entry) : - _index(entry->index()), _store(entry->getStore()) {} - - SMSStoreEntry &operator*(); - SMSStoreEntry *operator->(); - SMSStoreIterator &operator+(int i) - {_index += i; return *this;} - operator SMSStoreEntry*(); - SMSStoreIterator &operator=(const SMSStoreIterator &i); - SMSStoreIterator &operator++() - {++_index; return *this;} - SMSStoreIterator &operator--() - {--_index; return *this;} - SMSStoreIterator &operator++(int i) - {_index += i; return *this;} - SMSStoreIterator &operator--(int i) - {_index -= i; return *this;} - bool operator<(SMSStoreIterator &i) - {return _index < i._index;} - bool operator==(const SMSStoreIterator &i) const - {return _index == i._index;} - bool operator!=(const SMSStoreIterator &i) const - {return _index != i._index;} - - friend class SMSStore; - }; - -#if __GNUC__ == 2 && __GNUC_MINOR__ == 95 - class SMSStoreConstIterator : public random_access_iterator -#else - class SMSStoreConstIterator : public iterator -#endif - { - int _index; - const SMSStore *_store; - - SMSStoreConstIterator(int index, const SMSStore *store) : - _index(index), _store(store) {} - - public: - const SMSStoreEntry &operator*(); - const SMSStoreEntry *operator->(); - SMSStoreConstIterator &operator++() - {++_index; return *this;} - SMSStoreConstIterator &operator--() - {--_index; return *this;} - SMSStoreConstIterator &operator++(int i) - {_index += i; return *this;} - SMSStoreConstIterator &operator--(int i) - {_index -= i; return *this;} - bool operator<(SMSStoreConstIterator &i) - {return _index < i._index;} - bool operator==(const SMSStoreConstIterator &i) const - {return _index == i._index;} - - friend class SMSStore; - }; - - // this class corresponds to a SMS store in the ME - // all functions directly update storage in the ME - // if the ME is exchanged, the storage may become corrupted because - // of internal buffering in the SMSStore class - - class SMSStore : public RefBase, public NoCopy - { - private: - vector _store; // vector of store entries - string _storeName; // name of the store, 2-byte like "SM" - Ref _at; // my GsmAt class - MeTa &_meTa; // my MeTa class - bool _useCache; // true if entries should be cached - - // internal access functions - // read/write entry from/to ME - void readEntry(int index, SMSMessageRef &message, - SMSStoreEntry::SMSMemoryStatus &status) throw(GsmException); - void readEntry(int index, CBMessageRef &message) throw(GsmException); - void writeEntry(int &index, SMSMessageRef message) - throw(GsmException); - // erase entry - void eraseEntry(int index) throw(GsmException); - // send PDU index from store - // returns message reference and ACK-PDU (if requested) - // only applicate to SMS-SUBMIT and SMS-COMMAND - unsigned char send(int index, Ref &ackPdu) throw(GsmException); - - - // do the actual insertion, return index of new element - int doInsert(SMSMessageRef message) throw(GsmException); - - // used by class MeTa - SMSStore(string storeName, Ref at, MeTa &meTa) throw(GsmException); - - // resize store entry vector if necessary - void resizeStore(int newSize); - - public: - // iterator defs - typedef SMSStoreIterator iterator; - typedef SMSStoreConstIterator const_iterator; - typedef SMSStoreEntry &reference; - typedef const SMSStoreEntry &const_reference; - - // set cache mode on or off - void setCaching(bool useCache) {_useCache = useCache;} - - // return name of this store (2-character string) - string name() const {return _storeName;} - - // SMS store traversal commands - // these are suitable to use stdc++ lib algorithms and iterators - // ME have fixed storage space implemented as memory slots - // that may either be empty or used - - // traversal commands - iterator begin(); - const_iterator begin() const; - iterator end(); - const_iterator end() const; - reference front(); - const_reference front() const; - reference back(); - const_reference back() const; - reference operator[](int n); - const_reference operator[](int n) const; - - // The size macros return the number of used entries - // Warning: indices may be _larger_ than size() because of this - // (perhaps this should be changed, because it is unexpected behavior) - - int size() const throw(GsmException); - int max_size() const {return _store.size();} - int capacity() const {return _store.size();} - bool empty() const throw(GsmException) {return size() == 0;} - - // insert iterators insert into the first empty cell regardless of position - // existing iterators may be invalidated after an insert operation - // return position - // insert only writes to available positions - // warning: insert fails silently if size() == max_size() - iterator insert(iterator position, const SMSStoreEntry& x) - throw(GsmException); - iterator insert(const SMSStoreEntry& x) throw(GsmException); - - // insert n times, same procedure as above - void insert (iterator pos, int n, const SMSStoreEntry& x) - throw(GsmException); - void insert (iterator pos, long n, const SMSStoreEntry& x) - throw(GsmException); - - // erase operators set used slots to "empty" - iterator erase(iterator position) throw(GsmException); - iterator erase(iterator first, iterator last) throw(GsmException); - void clear() throw(GsmException); - - // destructor - ~SMSStore(); - - friend class SMSStoreEntry; - friend class MeTa; - }; - - typedef Ref SMSStoreRef; - -}; - -#endif // GSM_SMS_STORE_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook.cc deleted file mode 100644 index e1b265c3f7..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook.cc +++ /dev/null @@ -1,503 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_sorted_phonebook.cc -// * -// * Purpose: Alphabetically sorted phonebook -// * (residing in files or in the ME) -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 25.6.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include -#include - -const int MAX_LINE_SIZE = 1000; - -using namespace std; -using namespace gsmlib; - -string SortedPhonebook::escapeString(string s) -{ - string result; - - for (const char *pp = s.c_str(); *pp != 0; ++pp) - { - if (*pp == CR) - result += "\\r"; - else if (*pp == LF) - result += "\\n"; - else if (*pp == '\\') - result += "\\\\"; - else if (*pp == '|') - result += "\\|"; - else - result += *pp; - } - return result; -} - -string SortedPhonebook::unescapeString(char *line, unsigned int &pos) -{ - string result; - bool escaped = false; - - while (! (line[pos] == '|' && ! escaped) && line[pos] != 0 && - line[pos] != CR && line[pos] != LF) - { - if (escaped) - { - escaped = false; - if (line[pos] == 'r') - result += CR; - else if (line[pos] == 'n') - result += LF; - else if (line[pos] == '\\') - result += '\\'; - else if (line[pos] == '|') - result += '|'; - else - result += line[pos]; - } - else - if (line[pos] == '\\') - escaped = true; - else - result += line[pos]; - - ++pos; - } - return result; -} - -void SortedPhonebook::readPhonebookFile(istream &pbs, string filename) - throw(GsmException) -{ - // read entries - while (! pbs.eof()) - { - char line[MAX_LINE_SIZE]; - pbs.getline(line, MAX_LINE_SIZE); - - if (strlen(line) == 0) - continue; // skip empty lines - - if (pbs.bad()) - throw GsmException(stringPrintf(_("error reading from file '%s"), - filename.c_str()), - OSError); - - // convert line to newEntry (line format : [index] '|' text '|' number - string text, telephone; - unsigned int pos = 0; - - // parse index - string indexS = unescapeString(line, pos); - int index = -1; - if (indexS.length() == 0) - { - if (_useIndices) - throw GsmException(stringPrintf(_("entry '%s' lacks index"), line), - ParserError); - } - else - { - index = checkNumber(indexS); - _useIndices = true; - } - if (line[pos++] != '|') - throw GsmException(stringPrintf(_("line '%s' has invalid format"), line), - ParserError); - - // parse text - text = unescapeString(line, pos); - if (line[pos++] != '|') - throw GsmException(stringPrintf(_("line '%s' has invalid format"), line), - ParserError); - - // parse telephone number - telephone = unescapeString(line, pos); - - insert(PhonebookEntryBase(telephone, text, index)); - } -} - -void SortedPhonebook::sync(bool fromDestructor) throw(GsmException) -{ - // if not in file it already is stored in ME/TA - if (! _fromFile) return; - - // if writing to stdout and not called from destructor ignore - // (avoids writing to stdout multiple times) - if (_filename == "" && ! fromDestructor) return; - - // find out if any of the entries have been updated - if (! _changed) // only look if we're not writing the file anyway - for (iterator i = begin(); i != end(); i++) - if (i->changed()) - { - _changed = true; - break; - } - - if (_changed) - { - checkReadonly(); - // create backup file - but only once - if (! _madeBackupFile && _filename != "") // don't make backup of stdout - { - renameToBackupFile(_filename); - _madeBackupFile = true; - } - - // open stream - ostream *pbs = NULL; - try - { - if (_filename == "") - pbs = &cout; - else - pbs = new ofstream(_filename.c_str()); - - if (pbs->bad()) - throw GsmException( - stringPrintf(_("error opening file '%s' for writing"), - (_filename == "" ? _("") : - _filename.c_str())), - OSError); - - // and write the entries - for (PhonebookMap::iterator i = _sortedPhonebook.begin(); - i != _sortedPhonebook.end(); ++i) - { - // convert entry to output line - string line = - (_useIndices ? intToStr(i->second->index()) : "") + "|" + - escapeString(i->second->text()) + "|" + - escapeString(i->second->telephone()); - - // write out the line - *pbs << line << endl; - if (pbs->bad()) - throw GsmException( - stringPrintf(_("error writing to file '%s'"), - (_filename == "" ? _("") : - _filename.c_str())), - OSError); - } - } - catch(GsmException &e) - { - if (pbs != &cout) delete pbs; - throw; - } - // close file - if (pbs != &cout) delete pbs; - - // reset all changed states - _changed = false; - for (iterator j = begin(); j != end(); j++) - j->resetChanged(); - } -} - -void SortedPhonebook::checkReadonly() throw(GsmException) -{ - if (_readonly) throw GsmException( - _("attempt to change phonebook read from "), - ParameterError); -} - -SortedPhonebook::SortedPhonebook(string filename, bool useIndices) - throw(GsmException) : - _changed(false), _fromFile(true), _madeBackupFile(false), - _sortOrder(ByIndex), _useIndices(useIndices), _readonly(false), - _filename(filename) -{ - // open the file - ifstream pbs(filename.c_str()); - if (pbs.bad()) - throw GsmException(stringPrintf(_("cannot open file '%s'"), - filename.c_str()), - OSError); - // and read the file - readPhonebookFile(pbs, filename); -} - -SortedPhonebook::SortedPhonebook(bool fromStdin, bool useIndices) - throw(GsmException) : - _changed(false), _fromFile(true), _madeBackupFile(false), - _sortOrder(ByIndex), _useIndices(useIndices), _readonly(fromStdin) - // _filename is "" - this means stdout -{ - // read from stdin - if (fromStdin) - readPhonebookFile(cin, (string)_("")); -} - -SortedPhonebook::SortedPhonebook(PhonebookRef mePhonebook) - throw(GsmException) : - _changed(false), _fromFile(false), _madeBackupFile(false), - _sortOrder(ByIndex), _readonly(false), _mePhonebook(mePhonebook) -{ - int entriesRead = 0; - reportProgress(0, _mePhonebook->end() - _mePhonebook->begin()); - - for (Phonebook::iterator i = _mePhonebook->begin(); - i != _mePhonebook->end(); ++i) - { - if (! i->empty()) - { - _sortedPhonebook.insert( - PhonebookMap::value_type(PhoneMapKey(*this, lowercase(i->text())), i)); - ++entriesRead; - if (entriesRead == _mePhonebook->size()) - return; // ready - } - reportProgress(i - _mePhonebook->begin()); - } -} - -void SortedPhonebook::setSortOrder(SortOrder newOrder) -{ - if (newOrder == _sortOrder) return; // nothing to do - - PhonebookMap savedPhonebook = _sortedPhonebook; // save phonebook - _sortedPhonebook = PhonebookMap(); // empty old phonebook - _sortOrder = newOrder; - - // re-insert entries - switch (newOrder) - { - case ByTelephone: - { - for (PhonebookMap::iterator i = savedPhonebook.begin(); - i != savedPhonebook.end(); ++i) - _sortedPhonebook. - insert(PhonebookMap::value_type( - PhoneMapKey(*this, lowercase(i->second->telephone())), i->second)); - break; - } - case ByText: - { - for (PhonebookMap::iterator i = savedPhonebook.begin(); - i != savedPhonebook.end(); ++i) - _sortedPhonebook. - insert(PhonebookMap::value_type( - PhoneMapKey(*this, lowercase(i->second->text())), i->second)); - break; - } - case ByIndex: - { - for (PhonebookMap::iterator i = savedPhonebook.begin(); - i != savedPhonebook.end(); ++i) - _sortedPhonebook. - insert(PhonebookMap::value_type( - PhoneMapKey(*this, i->second->index()), i->second)); - break; - } - default: - assert(0); - break; - } -} - -unsigned int SortedPhonebook::getMaxTelephoneLen() const -{ - if (_fromFile) - return UINT_MAX; - else - return _mePhonebook->getMaxTelephoneLen(); -} - -unsigned int SortedPhonebook::getMaxTextLen() const -{ - if (_fromFile) - return UINT_MAX; - else - return _mePhonebook->getMaxTextLen(); -} - -int SortedPhonebook::max_size() const -{ - if (_fromFile) - return _sortedPhonebook.max_size(); - else - return _mePhonebook->max_size(); -} - -int SortedPhonebook::capacity() const -{ - if (_fromFile) - return _sortedPhonebook.max_size(); - else - return _mePhonebook->capacity(); -} - -SortedPhonebook::iterator -SortedPhonebook::insert(const PhonebookEntryBase& x) throw(GsmException) -{ - checkReadonly(); - _changed = true; - PhonebookEntryBase *newEntry; - - if (_fromFile) - if (_useIndices) - { - if (x.index() != -1) // check that index is unique - { - for (PhonebookMap::iterator i = _sortedPhonebook.begin(); - i != _sortedPhonebook.end(); ++i) - if (i->second->index() == x.index()) - throw GsmException(_("indices must be unique in phonebook"), - ParameterError); - newEntry = new PhonebookEntryBase(x); - } - else // set index - { - SortOrder saveSortOrder = _sortOrder; - setSortOrder(ByIndex); - int index = 0; - for (PhonebookMap::iterator i = _sortedPhonebook.begin(); - i != _sortedPhonebook.end(); ++i, ++index) - if (i->second->index() != index) - break; - setSortOrder(saveSortOrder); - newEntry = new PhonebookEntryBase(); - newEntry->set(x.telephone(), x.text(), index, true); - } - } - else // index info in x is ignored - newEntry = new PhonebookEntryBase(x); - else - { - PhonebookEntry newMEEntry(x); - newEntry = _mePhonebook->insert((PhonebookEntry*)NULL, newMEEntry); - } - switch (_sortOrder) - { - case ByTelephone: - return - _sortedPhonebook. - insert(PhonebookMap::value_type( - PhoneMapKey(*this, lowercase(newEntry->telephone())), newEntry)); - case ByText: - return - _sortedPhonebook. - insert(PhonebookMap::value_type( - PhoneMapKey(*this, lowercase(newEntry->text())), newEntry)); - case ByIndex: - return - _sortedPhonebook. - insert(PhonebookMap::value_type( - PhoneMapKey(*this, newEntry->index()), newEntry)); - default: - assert(0); - break; - } - return SortedPhonebook::iterator(); -} - -SortedPhonebook::iterator -SortedPhonebook::insert(iterator position, const PhonebookEntryBase& x) - throw(GsmException) -{ - return insert(x); -} - -SortedPhonebook::size_type SortedPhonebook::erase(string &key) - throw(GsmException) -{ - // deallocate memory or remove from underlying ME phonebook - for (PhonebookMap::iterator i = - _sortedPhonebook.find(PhoneMapKey(*this, lowercase(key))); - i != _sortedPhonebook.end() && - i->first == PhoneMapKey(*this, lowercase(key)); - ++i) - { - checkReadonly(); - _changed = true; - if (_fromFile) - delete i->second; - else - _mePhonebook->erase((Phonebook::iterator)i->second); - } - - return _sortedPhonebook.erase(PhoneMapKey(*this, lowercase(key))); -} - -SortedPhonebook::size_type SortedPhonebook::erase(int key) - throw(GsmException) -{ - // deallocate memory or remove from underlying ME phonebook - for (PhonebookMap::iterator i = - _sortedPhonebook.find(PhoneMapKey(*this, key)); - i != _sortedPhonebook.end() && i->first == PhoneMapKey(*this, key); - ++i) - { - checkReadonly(); - _changed = true; - if (_fromFile) - delete i->second; - else - _mePhonebook->erase((Phonebook::iterator)i->second); - } - - return _sortedPhonebook.erase(PhoneMapKey(*this, key)); -} - -void SortedPhonebook::erase(iterator position) - throw(GsmException) -{ - checkReadonly(); - _changed = true; - // deallocate memory or remove from underlying ME phonebook - if (_fromFile) - delete ((PhonebookMap::iterator)position)->second; - else - _mePhonebook->erase((Phonebook::iterator) - ((PhonebookMap::iterator)position)->second); - _sortedPhonebook.erase(position); -} - -void SortedPhonebook::erase(iterator first, iterator last) - throw(GsmException) -{ - checkReadonly(); - _changed = true; - for (PhonebookMap::iterator i = first; i != last; ++i) - if (_fromFile) - delete i->second; - else - _mePhonebook->erase((Phonebook::iterator)i->second); - _sortedPhonebook.erase(first, last); -} - -void SortedPhonebook::clear() throw(GsmException) -{ - checkReadonly(); - _changed = true; - for (iterator i = begin(); i != end(); i++) - erase(i); -} - -SortedPhonebook::~SortedPhonebook() -{ - if (_fromFile) - { - sync(true); - for (PhonebookMap::iterator i = _sortedPhonebook.begin(); - i != _sortedPhonebook.end(); ++i) - delete i->second; - } -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook.h deleted file mode 100644 index c0d3b787fe..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook.h +++ /dev/null @@ -1,159 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_sorted_phonebook.h -// * -// * Purpose: Alphabetically sorted phonebook -// * (residing in files or in the ME) -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 25.6.1999 -// ************************************************************************* - -#ifndef GSM_SORTED_PHONEBOOK_H -#define GSM_SORTED_PHONEBOOK_H - -#include -#include -#include -#include -#include -#include -#include - -using namespace std; - -namespace gsmlib -{ - - // The class SortedPhonebook makes the phonebook more manageable: - // - empty slots in the ME phonebook are hidden by the API - // - the class transparently handles phonebooks that reside in files - - class SortedPhonebook : public SortedPhonebookBase - { - private: - bool _changed; // true if file has changed after last save - bool _fromFile; // true if phonebook read from file - bool _madeBackupFile; // true if backup file was created - SortOrder _sortOrder; // sort order for the phonebook - bool _useIndices; // if phonebook from file: input file had - // indices; will write indices, too - bool _readonly; // =true if read from stdin - string _filename; // name of the file if phonebook from file - PhonebookMap _sortedPhonebook; // phonebook from file - PhonebookRef _mePhonebook; // phonebook if from ME - - // convert CR and LF in string to "\r" and "\n" respectively - string escapeString(string s); - - // convert "\r" and "\n" to CR and LF respectively - // start parsing with pos, stop when CR, LF, 0, or '|' is encountered - string unescapeString(char *line, unsigned int &pos); - - // initial read of phonebook file - void readPhonebookFile(istream &pbs, string filename) throw(GsmException); - - // synchronize SortedPhonebook with file (no action if in ME) - void sync(bool fromDestructor) throw(GsmException); - - // throw an exception if _readonly is set - void checkReadonly() throw(GsmException); - - public: - // iterator defs - typedef SortedPhonebookIterator iterator; - typedef PhonebookMap::size_type size_type; - - // constructor for file-based phonebook - // expect indices in file if useIndices == true - // read from file - SortedPhonebook(string filename, bool useIndices) - throw(GsmException); - // read from stdin or start empty and write to stdout - SortedPhonebook(bool fromStdin, bool useIndices) - throw(GsmException); - - // constructor for ME-based phonebook - SortedPhonebook(PhonebookRef mePhonebook) throw(GsmException); - - // return maximum telephone number length - unsigned int getMaxTelephoneLen() const; - - // return maximum entry description length - unsigned int getMaxTextLen() const; - - // handle sorting - void setSortOrder(SortOrder newOrder); - SortOrder sortOrder() const {return _sortOrder;} - - // phonebook traversal commands - // these are suitable to use stdc++ lib algorithms and iterators - // ME have fixed storage space implemented as memory slots - // that may either be empty or used - - // traversal commands - iterator begin() {return _sortedPhonebook.begin();} - iterator end() {return _sortedPhonebook.end();} - - // the size macros return the number of used entries - int size() const {return _sortedPhonebook.size();} - int max_size() const; - int capacity() const; - bool empty() const throw(GsmException) {return size() == 0;} - - // existing iterators remain valid after an insert or erase operation - // note: inserting many entries in indexed mode is inefficient - // if the sort order is not set to indexed before - - // return position - // insert only writes to available positions - // warning: insert fails silently if size() == max_size() - iterator insert(const PhonebookEntryBase& x) throw(GsmException); - iterator insert(iterator position, const PhonebookEntryBase& x) - throw(GsmException); - - PhonebookMap::size_type count(string &key) - {return _sortedPhonebook.count(PhoneMapKey(*this, lowercase(key)));} - iterator find(string &key) - {return _sortedPhonebook.find(PhoneMapKey(*this, lowercase(key)));} - iterator lower_bound(string &key) - {return _sortedPhonebook.lower_bound(PhoneMapKey(*this, - lowercase(key)));} - iterator upper_bound(string &key) - {return _sortedPhonebook.upper_bound(PhoneMapKey(*this, - lowercase(key)));} - pair equal_range(string &key) - {return _sortedPhonebook.equal_range(PhoneMapKey(*this, - lowercase(key)));} - - PhonebookMap::size_type count(int key) - {return _sortedPhonebook.count(PhoneMapKey(*this, key));} - iterator find(int key) - {return _sortedPhonebook.find(PhoneMapKey(*this, key));} - iterator lower_bound(int key) - {return _sortedPhonebook.lower_bound(PhoneMapKey(*this, key));} - iterator upper_bound(int key) - {return _sortedPhonebook.upper_bound(PhoneMapKey(*this, key));} - pair equal_range(int key) - {return _sortedPhonebook.equal_range(PhoneMapKey(*this, key));} - - size_type erase(string &key) throw(GsmException); - size_type erase(int key) throw(GsmException); - void erase(iterator position) throw(GsmException); - void erase(iterator first, iterator last) throw(GsmException); - void clear() throw(GsmException); - - // synchronize SortedPhonebook with file (no action if in ME) - void sync() throw(GsmException) {sync(false);} - - // destructor - // writes back change to file if phonebook is in file - virtual ~SortedPhonebook(); - }; - - // typedef Ref SortedPhonebookRef; -}; - -#endif // GSM_SORTED_PHONEBOOK_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook_base.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook_base.cc deleted file mode 100644 index 1061dc60b9..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook_base.cc +++ /dev/null @@ -1,115 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_sorted_phonebook_base.cc -// * -// * Purpose: Virtual base class for alphabetically sorted phonebook -// * The infrastructure in this module allows custom backends for -// * storing phonebook entries to be integrated into gsmlib -// * (eg. LDAP- or RDBMS-based phonebook stores). -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 5.6.2000 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include - -#include - -using namespace std; -using namespace gsmlib; - -// PhonebookEntryBase members - -void PhonebookEntryBase::set(string telephone, string text, int index, - bool useIndex) - throw(GsmException) -{ - checkTextAndTelephone(text, telephone); - - _changed = true; - _telephone = telephone; - _text = text; - _useIndex = useIndex; - if (index != -1) - _index = index; -} - -bool PhonebookEntryBase::operator==(const PhonebookEntryBase &e) const -{ - assert(! ((_useIndex || e._useIndex) && - (_index == -1 || e._index == -1))); - return _telephone == e._telephone && _text == e._text && - (! (_useIndex || e._useIndex) || _index == e._index); -} - -string PhonebookEntryBase::text() const throw(GsmException) -{ - return _text; -} - -string PhonebookEntryBase::telephone() const throw(GsmException) -{ - return _telephone; -} - -bool PhonebookEntryBase::empty() const throw(GsmException) -{ - return (text() == "") && (telephone() == ""); -} - -Ref PhonebookEntryBase::clone() -{ - Ref result = new PhonebookEntryBase(*this); - return result; -} - -PhonebookEntryBase::PhonebookEntryBase(const PhonebookEntryBase &e) - throw(GsmException) -{ - set(e._telephone, e._text, e._index, e._useIndex); -} - -PhonebookEntryBase &PhonebookEntryBase::operator=(const PhonebookEntryBase &e) - throw(GsmException) -{ - set(e._telephone, e._text, e._index, e._useIndex); - return *this; -} - -// CustomPhonebookRegistry members - -map -*CustomPhonebookRegistry::_factoryList = NULL; - -void CustomPhonebookRegistry:: -registerCustomPhonebookFactory(string backendName, - CustomPhonebookFactory *factory) - throw(GsmException) -{ - if (_factoryList == NULL) - _factoryList = new map; - backendName = lowercase(backendName); - if (_factoryList->find(backendName) != _factoryList->end()) - throw GsmException(stringPrintf(_("backend '%s' already registered"), - backendName.c_str()), ParameterError); -} - -SortedPhonebookRef CustomPhonebookRegistry:: -createPhonebook(string backendName, string source) throw(GsmException) -{ - if (_factoryList == NULL) - _factoryList = new map; - backendName = lowercase(backendName); - if (_factoryList->find(backendName) == _factoryList->end()) - throw GsmException(stringPrintf(_("backend '%s' not registered"), - backendName.c_str()), ParameterError); - return (*_factoryList)[backendName]->createPhonebook(source); -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook_base.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook_base.h deleted file mode 100644 index 166f81f45a..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_phonebook_base.h +++ /dev/null @@ -1,220 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_sorted_phonebook_base.h -// * -// * Purpose: Virtual base class for alphabetically sorted phonebook -// * The infrastructure in this module allows custom backends for -// * storing phonebook entries to be integrated into gsmlib -// * (eg. LDAP- or RDBMS-based phonebook stores). -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 5.6.2000 -// ************************************************************************* - -#ifndef GSM_SORTED_PHONEBOOK_BASE_H -#define GSM_SORTED_PHONEBOOK_BASE_H - -#include -#include -#include -#include -#include - -using namespace std; - -namespace gsmlib -{ - // a single entry in a phonebook - - class PhonebookEntryBase : public RefBase - { - protected: - bool _changed; // set to true if _telephone or _text changed - string _telephone; - string _text; - int _index; // my position in the phonebook - // == -1 if not used (can only happen if - // phonebook is read from file) - bool _useIndex; // compare indices in operator==, - // use _index for inserting into - // Phonebook - - public: - PhonebookEntryBase() : - _changed(false), _index(-1), _useIndex(false) {} - - // convenience constructor - PhonebookEntryBase(string telephone, string text, int index = -1) : - _changed(false), _telephone(telephone), _text(text), - _index(index), _useIndex(false) {} - - // accessor functions - virtual void set(string telephone, string text, int index = -1, - bool useIndex = false) - throw(GsmException); - virtual string text() const throw(GsmException); - virtual string telephone() const throw(GsmException); - - // return true if both telephone and text are empty - bool empty() const throw(GsmException); - - // set to true if operator== should compare the _index as well - void setUseIndex(bool useIndex) - {_useIndex = useIndex;} - bool useIndex() const {return _useIndex;} - - // equality operator - // if one of the operands has _useIndex == true - // takes _index and e._index into account - bool operator==(const PhonebookEntryBase &e) const; - - // return index - int index() const {return _index;} - - // return true if entry changed - bool changed() const {return _changed;} - - // reset the changed status (ie. if synced to file) - void resetChanged() {_changed = false;} - - // return deep copy of this entry - virtual Ref clone(); - - PhonebookEntryBase(const PhonebookEntryBase &e) throw(GsmException); - PhonebookEntryBase &operator=(const PhonebookEntryBase &e) - throw(GsmException); - - virtual ~PhonebookEntryBase() {} - }; - - // MapKey for sortedPhonebook - - class SortedPhonebookBase; - typedef MapKey PhoneMapKey; - - // maps text or telephone to entry - - typedef multimap PhonebookMap; - - // iterator for SortedPhonebook that hides the "second" member of the map - - typedef PhonebookMap::iterator PhonebookMapIterator; - class SortedPhonebookIterator : public PhonebookMapIterator - { - public: - SortedPhonebookIterator() {} - SortedPhonebookIterator(PhonebookMap::iterator i) : - PhonebookMapIterator(i) {} - - PhonebookEntryBase &operator*() - {return *((PhonebookMap::iterator)*this)->second;} - - PhonebookEntryBase *operator->() - {return ((PhonebookMap::iterator)*this)->second;} - }; - - // virtual base class for sorted phonebooks - - class SortedPhonebookBase : public RefBase, public NoCopy - { - public: - // iterator defs - typedef SortedPhonebookIterator iterator; - typedef PhonebookMap::size_type size_type; - - // return maximum telephone number length - virtual unsigned int getMaxTelephoneLen() const = 0; - - // return maximum entry description length - virtual unsigned int getMaxTextLen() const = 0; - - // handle sorting - virtual void setSortOrder(SortOrder newOrder) = 0; - virtual SortOrder sortOrder() const = 0; - - // phonebook traversal commands - // these are suitable to use stdc++ lib algorithms and iterators - - // traversal commands - virtual iterator begin() = 0; - virtual iterator end() = 0; - - // the size macros return the number of used entries - virtual int size() const = 0; - virtual int max_size() const = 0; - virtual int capacity() const = 0; - virtual bool empty() const throw(GsmException) = 0; - - // existing iterators remain valid after an insert or erase operation - - // return position - // insert only writes to available positions - // warning: insert fails silently if size() == max_size() - virtual iterator insert(const PhonebookEntryBase& x) throw(GsmException) - = 0; - virtual iterator insert(iterator position, const PhonebookEntryBase& x) - throw(GsmException) = 0; - - virtual PhonebookMap::size_type count(string &key) = 0; - virtual iterator find(string &key) = 0; - virtual iterator lower_bound(string &key) = 0; - virtual iterator upper_bound(string &key) = 0; - virtual pair equal_range(string &key) = 0; - - virtual PhonebookMap::size_type count(int key) = 0; - virtual iterator find(int key) = 0; - virtual iterator lower_bound(int key) = 0; - virtual iterator upper_bound(int key) = 0; - virtual pair equal_range(int key) = 0; - - virtual size_type erase(string &key) throw(GsmException) = 0; - virtual size_type erase(int key) throw(GsmException) = 0; - virtual void erase(iterator position) throw(GsmException) = 0; - virtual void erase(iterator first, iterator last) throw(GsmException) = 0; - virtual void clear() throw(GsmException) = 0; - - // synchronize SortedPhonebookBase with storage - virtual void sync() throw(GsmException) = 0; - - virtual ~SortedPhonebookBase() {} - }; - - typedef Ref SortedPhonebookRef; - - - // base factory class for custom backends - class CustomPhonebookFactory - { - public: - // return sorted phonebook object given the source specification - // (eg. database name, URL, etc.) - virtual SortedPhonebookRef createPhonebook(string source) - throw(GsmException) = 0; - }; - - // registry for custom backends - - class CustomPhonebookRegistry - { - // registered factories - static map *_factoryList; - - public: - // register a factory class for a specific backend - // (case does not matter for backend name) - static void registerCustomPhonebookFactory(string backendName, - CustomPhonebookFactory *factory) - throw(GsmException); - - - // return a phonebook object given the backend name and the source - // specification - static SortedPhonebookRef - createPhonebook(string backendName, string source) throw(GsmException); - }; - -}; - -#endif // GSM_SORTED_PHONEBOOK_BASE_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_sms_store.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_sms_store.cc deleted file mode 100644 index 7ca9f9f160..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_sms_store.cc +++ /dev/null @@ -1,499 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_sorted_sms_store.cc -// * -// * Purpose: Sorted SMS store (residing in files or in the ME) -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 14.8.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#ifdef HAVE_NETINET_IN_H -#include -#endif - -using namespace std; -using namespace gsmlib; - -// SMS message file format: -// version number of file format, unsigned short int, 2 bytes in network byte -// order -// then comes the message: -// 1. length of PDU (see 4. below): unsigned short int, -// 2 bytes in network byte order -// 2. index of message, unique for this file: unsigned long, -// 4 bytes in network byte order -// 3. MessageType (1 byte), any of: -// 0 SMS_DELIVER -// 1 SMS_SUBMIT -// 2 SMS_STATUS_REPORT -// 4. PDU in hexadecimal format - -static const unsigned short int SMS_STORE_FILE_FORMAT_VERSION = 1; - -// SortedSMSStore members - -// aux function read bytes with error handling -// return false if EOF -static bool readnbytes(string &filename, - istream &is, int len, char *buf, - bool eofIsError = true) throw(GsmException) -{ - is.read(buf, len); - if (is.bad() || (is.eof() && eofIsError)) - throw GsmException(stringPrintf(_("error reading from file '%s'"), - (filename == "" ? _("") : - filename.c_str())), OSError); - return ! is.eof(); -} - -// aux function write bytes with error handling -static void writenbytes(string &filename, ostream &os, - int len, const char *buf) throw(GsmException) -{ - os.write(buf, len); - if (os.bad()) - throw GsmException(stringPrintf(_("error writing to file '%s'"), - (filename == "" ? _("") : - filename.c_str())), OSError); -} - -void SortedSMSStore::readSMSFile(istream &pbs, string filename) - throw(GsmException) -{ - char numberBuf[4]; - - // check the version - try - { - readnbytes(filename, pbs, 2, numberBuf); - } - catch (GsmException &ge) - { - // ignore error, file might be empty initially - } - unsigned_int_2 version = ntohs(*((unsigned_int_2*)numberBuf)); - if (! pbs.eof() && version != SMS_STORE_FILE_FORMAT_VERSION) - throw GsmException(stringPrintf(_("file '%s' has wrong version"), - filename.c_str()), ParameterError); - - // read entries - while (1) - { - // read PDU length and exit loop if EOF - if (! readnbytes(filename, pbs, 2, numberBuf, false)) - break; - - unsigned_int_2 pduLen = ntohs(*((unsigned_int_2*)numberBuf)); - if (pduLen > 500) - throw GsmException(stringPrintf(_("corrupt SMS store file '%s'"), - filename.c_str()), ParameterError); - - // read reserved integer field of message (was formerly index) - readnbytes(filename, pbs, 4, numberBuf); - //unsigned_int_4 reserved = ntohl(*((unsigned_int_4*)numberBuf)); - - // read message type - readnbytes(filename, pbs, 1, numberBuf); - SMSMessage::MessageType messageType = - (SMSMessage::MessageType)numberBuf[0]; - if (messageType > 2) - throw GsmException(stringPrintf(_("corrupt SMS store file '%s'"), - filename.c_str()), ParameterError); - - char *pduBuf = (char*)alloca(sizeof(char) * pduLen); - - // read pdu - readnbytes(filename, pbs, pduLen, pduBuf); - SMSMessageRef message = - SMSMessage::decode(string(pduBuf, pduLen), - (messageType != SMSMessage::SMS_SUBMIT)); - - SMSStoreEntry *newEntry = new SMSStoreEntry(message, _nextIndex++); - _sortedSMSStore.insert( - SMSStoreMap::value_type( - SMSMapKey(*this, message->serviceCentreTimestamp()), - newEntry) - ); - } -} - -void SortedSMSStore::sync(bool fromDestructor) throw(GsmException) -{ - if (_fromFile && _changed) - { - checkReadonly(); - - // if writing to stdout and not called from destructor ignore - // (avoids writing to stdout multiple times) - if (_filename == "" && ! fromDestructor) return; - - // create backup file - but only once - if (! _madeBackupFile && _filename != "") // don't make backup of stdout - { - renameToBackupFile(_filename); - _madeBackupFile = true; - } - - // open stream - ostream *pbs = NULL; - try - { - if (_filename == "") - pbs = &cout; - else - pbs = new ofstream(_filename.c_str(), ios::out | ios::binary); - - if (pbs->bad()) - throw GsmException( - stringPrintf(_("error opening file '%s' for writing"), - (_filename == "" ? _("") : - _filename.c_str())), - OSError); - - // write version number - unsigned_int_2 version = htons(SMS_STORE_FILE_FORMAT_VERSION); - writenbytes(_filename, *pbs, 2, (char*)&version); - - // and write the entries - for (SMSStoreMap::iterator i = _sortedSMSStore.begin(); - i != _sortedSMSStore.end(); ++i) - { - // create PDU and write length - string pdu = i->second->message()->encode(); - unsigned_int_2 pduLen = htons(pdu.length()); - writenbytes(_filename, *pbs, 2, (char*)&pduLen); - - // write reserved field (was formerly index) - unsigned_int_4 reserved = htonl(0); - writenbytes(_filename, *pbs, 4, (char*)&reserved); - - // write message type - char messageType = i->second->message()->messageType(); - writenbytes(_filename, *pbs, 1, (char*)&messageType); - - // write PDU - writenbytes(_filename, *pbs, pdu.length(), pdu.data()); - } - } - catch(GsmException &e) - { - if (pbs != &cout) delete pbs; - throw; - } - // close file - if (pbs != &cout) delete pbs; - - _changed = false; - } -} - -void SortedSMSStore::checkReadonly() throw(GsmException) -{ - if (_readonly) throw GsmException( - _("attempt to change SMS store read from "), - ParameterError); -} - -SortedSMSStore::SortedSMSStore(string filename) throw(GsmException) : - _changed(false), _fromFile(true), _madeBackupFile(false), - _sortOrder(ByDate), _readonly(false), _filename(filename), _nextIndex(0) -{ - // open the file - ifstream pbs(filename.c_str(), ios::in | ios::binary); - if (pbs.bad()) - throw GsmException(stringPrintf(_("cannot open file '%s'"), - filename.c_str()), OSError); - // and read the file - readSMSFile(pbs, filename); -} - -SortedSMSStore::SortedSMSStore(bool fromStdin) throw(GsmException) : - _changed(false), _fromFile(true), _madeBackupFile(false), - _sortOrder(ByDate), _readonly(fromStdin), _nextIndex(0) - // _filename is "" - this means stdout -{ - // read from stdin - if (fromStdin) - readSMSFile(cin, (string)_("")); -} - -SortedSMSStore::SortedSMSStore(SMSStoreRef meSMSStore) - throw(GsmException) : - _changed(false), _fromFile(false), _madeBackupFile(false), - _sortOrder(ByDate), _readonly(false), _meSMSStore(meSMSStore) -{ - // It is necessary to count the entries read because - // the maximum index into the SMS store may be larger than smsStore.size() - int entriesRead = 0; - reportProgress(0, _meSMSStore->size()); - - for (int i = 0;; ++i) - { - if (entriesRead == _meSMSStore->size()) - break; // ready - if (! _meSMSStore()[i].empty()) - { - _sortedSMSStore.insert( - SMSStoreMap::value_type( - SMSMapKey(*this, - _meSMSStore()[i].message()->serviceCentreTimestamp()), - &_meSMSStore()[i]) - ); - ++entriesRead; - reportProgress(entriesRead); - } - } -} - -void SortedSMSStore::setSortOrder(SortOrder newOrder) -{ - if (_sortOrder == newOrder) return; // nothing to be done - - SMSStoreMap savedSMSStore = _sortedSMSStore; - _sortedSMSStore = SMSStoreMap(); - _sortOrder = newOrder; - - switch (newOrder) - { - case ByIndex: - { - for (SMSStoreMap::iterator i = savedSMSStore.begin(); - i != savedSMSStore.end(); ++i) - _sortedSMSStore.insert( - SMSStoreMap::value_type(SMSMapKey(*this, (i->second->index())), - i->second)); - break; - } - case ByDate: - { - for (SMSStoreMap::iterator i = savedSMSStore.begin(); - i != savedSMSStore.end(); ++i) - _sortedSMSStore.insert( - SMSStoreMap::value_type( - SMSMapKey(*this, (i->second->message()->serviceCentreTimestamp())), - i->second)); - break; - } - case ByAddress: - { - for (SMSStoreMap::iterator i = savedSMSStore.begin(); - i != savedSMSStore.end(); ++i) - _sortedSMSStore.insert( - SMSStoreMap::value_type( - SMSMapKey(*this, (i->second->message()->address())), - i->second)); - break; - } - case ByType: - { - for (SMSStoreMap::iterator i = savedSMSStore.begin(); - i != savedSMSStore.end(); ++i) - _sortedSMSStore.insert( - SMSStoreMap::value_type( - SMSMapKey(*this, (i->second->message()->messageType())), - i->second)); - break; - } - default: - assert(0); - break; - } -} - -int SortedSMSStore::max_size() const -{ - if (_fromFile) - return _sortedSMSStore.max_size(); - else - return _meSMSStore->max_size(); -} - -int SortedSMSStore::capacity() const -{ - if (_fromFile) - return _sortedSMSStore.max_size(); - else - return _meSMSStore->capacity(); -} - -SortedSMSStore::iterator -SortedSMSStore::insert(const SMSStoreEntry& x) throw(GsmException) -{ - checkReadonly(); - _changed = true; - SMSStoreEntry *newEntry; - - if (_fromFile) - newEntry = new SMSStoreEntry(x.message(), _nextIndex++); - else - { - SMSStoreEntry newMEEntry(x.message()); - newEntry = _meSMSStore->insert(newMEEntry); - } - - switch (_sortOrder) - { - case ByIndex: - return - _sortedSMSStore. - insert(SMSStoreMap::value_type(SMSMapKey(*this, newEntry->index()), - newEntry)); - break; - case ByDate: - return - _sortedSMSStore. - insert(SMSStoreMap::value_type( - SMSMapKey(*this, newEntry->message()->serviceCentreTimestamp()), - newEntry)); - break; - case ByAddress: - return - _sortedSMSStore. - insert(SMSStoreMap::value_type( - SMSMapKey(*this, newEntry->message()->address()), - newEntry)); - break; - case ByType: - return - _sortedSMSStore. - insert(SMSStoreMap::value_type( - SMSMapKey(*this, newEntry->message()->messageType()), - newEntry)); - break; - default: - assert(0); - break; - } - return SortedSMSStore::iterator(); -} - -SortedSMSStore::iterator -SortedSMSStore::insert(iterator position, const SMSStoreEntry& x) - throw(GsmException) -{ - return insert(x); -} - -SortedSMSStore::size_type SortedSMSStore::erase(Address &key) - throw(GsmException) -{ - assert(_sortOrder == ByAddress); - - SMSMapKey mapKey(*this, key); - - // deallocate memory or remove from underlying ME SMS store - for (SMSStoreMap::iterator i = _sortedSMSStore.find(mapKey); - i != _sortedSMSStore.end() && i->first == mapKey; ++i) - { - checkReadonly(); - _changed = true; - if (_fromFile) - delete i->second; - else - _meSMSStore->erase((SMSStore::iterator)i->second); - } - - return _sortedSMSStore.erase(mapKey); -} - -SortedSMSStore::size_type SortedSMSStore::erase(int key) - throw(GsmException) -{ - assert(_sortOrder == ByIndex || _sortOrder == ByType); - - SMSMapKey mapKey(*this, key); - - // deallocate memory or remove from underlying ME SMS store - for (SMSStoreMap::iterator i = _sortedSMSStore.find(mapKey); - i != _sortedSMSStore.end() && i->first == mapKey; ++i) - { - checkReadonly(); - _changed = true; - if (_fromFile) - delete i->second; - else - _meSMSStore->erase((SMSStore::iterator)i->second); - } - - return _sortedSMSStore.erase(mapKey); -} - -SortedSMSStore::size_type SortedSMSStore::erase(Timestamp &key) - throw(GsmException) -{ - assert(_sortOrder == ByDate); - - SMSMapKey mapKey(*this, key); - - // deallocate memory or remove from underlying ME SMS store - for (SMSStoreMap::iterator i = _sortedSMSStore.find(mapKey); - i != _sortedSMSStore.end() && i->first == mapKey; ++i) - { - checkReadonly(); - _changed = true; - if (_fromFile) - delete i->second; - else - _meSMSStore->erase((SMSStore::iterator)i->second); - } - - return _sortedSMSStore.erase(mapKey); -} - -void SortedSMSStore::erase(iterator position) - throw(GsmException) -{ - checkReadonly(); - _changed = true; - // deallocate memory or remove from underlying ME SMS store - if (_fromFile) - delete ((SMSStoreMap::iterator)position)->second; - else - _meSMSStore->erase((SMSStore::iterator) - ((SMSStoreMap::iterator)position)->second); - _sortedSMSStore.erase(position); -} - -void SortedSMSStore::erase(iterator first, iterator last) - throw(GsmException) -{ - checkReadonly(); - _changed = true; - for (SMSStoreMap::iterator i = first; i != last; ++i) - if (_fromFile) - delete i->second; - else - _meSMSStore->erase((SMSStore::iterator)i->second); - _sortedSMSStore.erase(first, last); -} - -void SortedSMSStore::clear() throw(GsmException) -{ - checkReadonly(); - _changed = true; - for (iterator i = begin(); i != end(); i++) - erase(i); -} - -SortedSMSStore::~SortedSMSStore() -{ - if (_fromFile) - { - sync(true); - for (SMSStoreMap::iterator i = _sortedSMSStore.begin(); - i != _sortedSMSStore.end(); ++i) - delete i->second; - } -} - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_sms_store.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_sms_store.h deleted file mode 100644 index 126c5856bd..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sorted_sms_store.h +++ /dev/null @@ -1,217 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_sorted_sms_store.h -// * -// * Purpose: Sorted SMS store (residing in files or in the ME) -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 14.8.1999 -// ************************************************************************* - -#ifndef GSM_SORTED_SMS_STORE_H -#define GSM_SORTED_SMS_STORE_H - -#include -#include -#include -#include -#include -#include - -using namespace std; - -namespace gsmlib -{ - // MapKey for SortedSMSStore - - class SortedSMSStore; - typedef MapKey SMSMapKey; - - // maps key (see SortedSMSStore::SortOrder) to entry - - typedef multimap SMSStoreMap; - - // iterator for SortedSMSStore that hides the "second" member of the map - - typedef SMSStoreMap::iterator SMSStoreMapIterator; - class SortedSMSStoreIterator : public SMSStoreMapIterator - { - public: - SortedSMSStoreIterator() {} - SortedSMSStoreIterator(SMSStoreMap::iterator i) : - SMSStoreMapIterator(i) {} - - SMSStoreEntry &operator*() - {return *((SMSStoreMap::iterator)*this)->second;} - - SMSStoreEntry *operator->() - {return ((SMSStoreMap::iterator)*this)->second;} - }; - - // The class SortedSMSStore makes the SMS store more manageable: - // - empty slots in the ME phonebook are hidden by the API - // - the class transparently handles stores that reside in files - - class SortedSMSStore : public RefBase, public NoCopy - { - private: - - bool _changed; // true if file has changed after last save - bool _fromFile; // true if store read from file - bool _madeBackupFile; // true if backup file was created - SortOrder _sortOrder; // sort order of the _sortedSMSStore - // (default is ByDate) - bool _readonly; // =true if read from stdin - string _filename; // name of the file if store from file - SMSStoreMap _sortedSMSStore; // store from file - SMSStoreRef _meSMSStore; // store if from ME - - unsigned int _nextIndex; // next index to use for file-based store - - // initial read of SMS file - void readSMSFile(istream &pbs, string filename) throw(GsmException); - - // synchronize SortedSMSStore with file (no action if in ME) - void sync(bool fromDestructor) throw(GsmException); - - // throw an exception if _readonly is set - void checkReadonly() throw(GsmException); - - public: - // iterator defs - typedef SortedSMSStoreIterator iterator; - typedef SMSStoreMap::size_type size_type; - - // constructor for file-based store - // read from file - SortedSMSStore(string filename) throw(GsmException); - // read from stdin or start empty and write to stdout - SortedSMSStore(bool fromStdin) throw(GsmException); - - // constructor for ME-based store - SortedSMSStore(SMSStoreRef meSMSStore) throw(GsmException); - - // handle sorting - void setSortOrder(SortOrder newOrder); - SortOrder sortOrder() const {return _sortOrder;} - - // store traversal commands - // these are suitable to use stdc++ lib algorithms and iterators - - // traversal commands - iterator begin() {return _sortedSMSStore.begin();} - iterator end() {return _sortedSMSStore.end();} - - // the size macros return the number of used entries - int size() const {return _sortedSMSStore.size();} - int max_size() const; - int capacity() const; - bool empty() const throw(GsmException) {return size() == 0;} - - // existing iterators may be invalidated after an insert operation - // return position - // insert only writes to available positions - // warning: insert fails silently if size() == max_size() - iterator insert(const SMSStoreEntry& x) throw(GsmException); - iterator insert(iterator position, const SMSStoreEntry& x) - throw(GsmException); - - SMSStoreMap::size_type count(Address &key) - { - assert(_sortOrder == ByAddress); - return _sortedSMSStore.count(SMSMapKey(*this, key)); - } - iterator find(Address &key) - { - assert(_sortOrder == ByAddress); - return _sortedSMSStore.find(SMSMapKey(*this, key)); - } - iterator lower_bound(Address &key) - { - assert(_sortOrder == ByAddress); - return _sortedSMSStore.lower_bound(SMSMapKey(*this, key)); - } - iterator upper_bound(Address &key) - { - assert(_sortOrder == ByAddress); - return _sortedSMSStore.upper_bound(SMSMapKey(*this, key)); - } - pair equal_range(Address &key) - { - assert(_sortOrder == ByAddress); - return _sortedSMSStore.equal_range(SMSMapKey(*this, key)); - } - - SMSStoreMap::size_type count(Timestamp &key) - { - assert(_sortOrder == ByDate); - return _sortedSMSStore.count(SMSMapKey(*this, key)); - } - iterator find(Timestamp &key) - { - assert(_sortOrder == ByDate); - return _sortedSMSStore.find(SMSMapKey(*this, key)); - } - iterator lower_bound(Timestamp &key) - { - assert(_sortOrder == ByDate); - return _sortedSMSStore.lower_bound(SMSMapKey(*this, key)); - } - iterator upper_bound(Timestamp &key) - { - assert(_sortOrder == ByDate); - return _sortedSMSStore.upper_bound(SMSMapKey(*this, key)); - } - pair equal_range(Timestamp &key) - { - assert(_sortOrder == ByDate); - return _sortedSMSStore.equal_range(SMSMapKey(*this, key)); - } - - SMSStoreMap::size_type count(int key) - { - assert(_sortOrder == ByIndex || _sortOrder == ByType); - return _sortedSMSStore.count(SMSMapKey(*this, key)); - } - iterator find(int key) - { - assert(_sortOrder == ByIndex || _sortOrder == ByType); - return _sortedSMSStore.find(SMSMapKey(*this, key)); - } - iterator lower_bound(int key) - { - assert(_sortOrder == ByIndex || _sortOrder == ByType); - return _sortedSMSStore.lower_bound(SMSMapKey(*this, key)); - } - iterator upper_bound(int key) - { - assert(_sortOrder == ByIndex || _sortOrder == ByType); - return _sortedSMSStore.upper_bound(SMSMapKey(*this, key)); - } - pair equal_range(int key) - { - assert(_sortOrder == ByIndex || _sortOrder == ByType); - return _sortedSMSStore.equal_range(SMSMapKey(*this, key)); - } - - size_type erase(Address &key) throw(GsmException); - size_type erase(int key) throw(GsmException); - size_type erase(Timestamp &key) throw(GsmException); - void erase(iterator position) throw(GsmException); - void erase(iterator first, iterator last) throw(GsmException); - void clear() throw(GsmException); - - // synchronize SortedPhonebook with file (no action if in ME) - void sync() throw(GsmException) {sync(false);} - - // destructor - // writes back change to file if store is in file - ~SortedSMSStore(); - }; - - typedef Ref SortedSMSStoreRef; -}; - -#endif // GSM_SORTED_SMS_STORE_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sysdep.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sysdep.h deleted file mode 100644 index 864fcf99ff..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_sysdep.h +++ /dev/null @@ -1,83 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_sysdep.h -// * -// * Purpose: Some magic to make alloca work on different platforms plus -// * other system-dependent stuff -// * -// * Warning: Only include this header from gsmlib .cc-files -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 28.10.1999 -// ************************************************************************* - -#ifndef GSM_SYSDEP_H -#define GSM_SYSDEP_H - -#ifdef HAVE_CONFIG_H -#include -#endif - -extern "C" { - - // this is mostly taken from the autoconf documentation (WIN32 added) - -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifdef WIN32 -# include -# define alloca _alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif -#endif - -} - -// Windows-specific stuff -#if defined(WIN32) && ! defined(__GNUC__) -#define NOMINMAX -#include -#include - -#ifdef _MSC_VER -#define min __min -#endif - -#define S_ISREG(mode) (((mode) & _S_IFREG) == _S_IFREG) -#define S_ISCHR(mode) (((mode) & _S_IFCHR) == _S_IFCHR) - -#define read _read -#endif - -// define common data types with fixed sizes - -#if SIZEOF_UNSIGNED_SHORT_INT == 2 - typedef unsigned short int unsigned_int_2; -#else -#error "no suitable 2 byte unsigned int available" -#endif -#if SIZEOF_UNSIGNED_LONG_INT == 4 - typedef unsigned long int unsigned_int_4; -#else -#if SIZEOF_UNSIGNED_INT == 4 - typedef unsigned int unsigned_int_4; -#else -#error "no suitable 4 byte unsigned int available" -#endif -#endif - -#endif // GSM_SYSDEP_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_unix_serial.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_unix_serial.cc deleted file mode 100644 index feea2a24d9..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_unix_serial.cc +++ /dev/null @@ -1,456 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_unix_port.cc -// * -// * Purpose: UNIX serial port implementation -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 10.5.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -static const int holdoff[] = {2000000, 1000000, 400000}; -static const int holdoffArraySize = sizeof(holdoff)/sizeof(int); - -// alarm handling for socket read/write -// the timerMtx is necessary since several threads cannot use the -// timer indepently of each other - -static pthread_mutex_t timerMtx = PTHREAD_MUTEX_INITIALIZER; - -// for non-GNU systems, define alarm() -#ifndef HAVE_ALARM -unsigned int alarm(unsigned int seconds) -{ - struct itimerval old, newt; - newt.it_interval.tv_usec = 0; - newt.it_interval.tv_sec = 0; - newt.it_value.tv_usec = 0; - newt.it_value.tv_sec = (long int)seconds; - if (setitimer(ITIMER_REAL, &newt, &old) < 0) - return 0; - else - return old.it_value.tv_sec; -} -#endif - -// this routine is called in case of a timeout -static void catchAlarm(int) -{ - // do nothing -} - -// start timer -static void startTimer() -{ - pthread_mutex_lock(&timerMtx); - struct sigaction newAction; - newAction.sa_handler = catchAlarm; - newAction.sa_flags = 0; - sigaction(SIGALRM, &newAction, NULL); - alarm(1); -} - -// reset timer -static void stopTimer() -{ - alarm(0); - sigaction(SIGALRM, NULL, NULL); - pthread_mutex_unlock(&timerMtx); -} - -// UnixSerialPort members - -void UnixSerialPort::throwModemException(string message) throw(GsmException) -{ - ostrstream os; - os << message << " (errno: " << errno << "/" << strerror(errno) << ")" - << ends; - char *ss = os.str(); - string s(ss); - delete[] ss; - throw GsmException(s, OSError, errno); -} - -void UnixSerialPort::putBack(unsigned char c) -{ - assert(_oldChar == -1); - _oldChar = c; -} - -int UnixSerialPort::readByte() throw(GsmException) -{ - if (_oldChar != -1) - { - int result = _oldChar; - _oldChar = -1; - return result; - } - - unsigned char c; - int timeElapsed = 0; - struct timeval oneSecond; - bool readDone = false; - - while (! readDone && timeElapsed < _timeoutVal) - { - if (interrupted()) - throwModemException(_("interrupted when reading from TA")); - - // setup fd_set data structure for select() - fd_set fdSet; - oneSecond.tv_sec = 1; - oneSecond.tv_usec = 0; - FD_ZERO(&fdSet); - FD_SET(_fd, &fdSet); - - switch (select(FD_SETSIZE, &fdSet, NULL, NULL, &oneSecond)) - { - case 1: - { - int res = read(_fd, &c, 1); - if (res != 1) - throwModemException(_("end of file when reading from TA")); - else - readDone = true; - break; - } - case 0: - ++timeElapsed; - break; - default: - if (errno != EINTR) - throwModemException(_("reading from TA")); - break; - } - } - if (! readDone) - throwModemException(_("timeout when reading from TA")); - -#ifndef NDEBUG - if (debugLevel() >= 2) - { - // some useful debugging code - if (c == LF) - cerr << ""; - else if (c == CR) - cerr << ""; - else cerr << "<'" << (char) c << "'>"; - cerr.flush(); - } -#endif - return c; -} - -UnixSerialPort::UnixSerialPort(string device, speed_t lineSpeed, - string initString, bool swHandshake) - throw(GsmException) : - _oldChar(-1), _timeoutVal(TIMEOUT_SECS) -{ - struct termios t; - - // open device - _fd = open(device.c_str(), O_RDWR | O_NOCTTY | O_NONBLOCK); - if (_fd == -1) - throwModemException(stringPrintf(_("opening device '%s'"), - device.c_str())); - - // switch off non-blocking mode - int fdFlags; - 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) { - close(_fd); - throwModemException(_("switching of non-blocking mode failed")); - } - - long int saveTimeoutVal = _timeoutVal; - _timeoutVal = 3; - int initTries = holdoffArraySize; - while (initTries-- > 0) - { - // flush all pending output - tcflush(_fd, TCOFLUSH); - - // toggle DTR to reset modem - int mctl = TIOCM_DTR; - 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) { - close(_fd); - throwModemException(_("setting DTR failed")); - } - // get line modes - if (tcgetattr(_fd, &t) < 0) { - close(_fd); - throwModemException(stringPrintf(_("tcgetattr device '%s'"), - device.c_str())); - } - - // set line speed - cfsetispeed(&t, lineSpeed); - cfsetospeed(&t, lineSpeed); - - // set the device to a sane state - t.c_iflag |= IGNPAR | (swHandshake ? IXON | IXOFF : 0); - t.c_iflag &= ~(INPCK | ISTRIP | IMAXBEL | - (swHandshake ? 0 : IXON | IXOFF) - | IXANY | IGNCR | ICRNL | IMAXBEL | INLCR | IGNBRK); - t.c_oflag &= ~(OPOST); - // be careful, only touch "known" flags - t.c_cflag &= ~(CSIZE | CSTOPB | PARENB | PARODD | - (swHandshake ? CRTSCTS : 0 )); - t.c_cflag |= CS8 | CREAD | HUPCL | (swHandshake ? 0 : CRTSCTS) | CLOCAL; - t.c_lflag &= ~(ECHO | ECHOE | ECHOPRT | ECHOK | ECHOKE | ECHONL | - ECHOCTL | ISIG | IEXTEN | TOSTOP | FLUSHO | ICANON); - t.c_lflag |= NOFLSH; - t.c_cc[VMIN] = 1; - t.c_cc[VTIME] = 0; - - t.c_cc[VSUSP] = 0; - - // write back - 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]); - - // flush all pending input - tcflush(_fd, TCIFLUSH); - - try - { - // reset modem - putLine("ATZ"); - bool foundOK = false; - int readTries = 5; - while (readTries-- > 0) - { - // for the first call getLine() waits only 3 seconds - // because of _timeoutVal = 3 - string s = getLine(); - if (s.find("OK") != string::npos || - s.find("CABLE: GSM") != string::npos) - { - foundOK = true; - readTries = 0; // found OK, exit loop - } - else if (s.find("ERROR") != string::npos) - readTries = 0; // error, exit loop - } - - // set getLine/putLine timeout back to old value - _timeoutVal = saveTimeoutVal; - - if (foundOK) - { - // init modem - readTries = 5; - putLine("AT" + initString); - while (readTries-- > 0) - { - string s = getLine(); - if (s.find("OK") != string::npos || - s.find("CABLE: GSM") != string::npos) - return; // found OK, return - } - } - } - catch (GsmException &e) - { - _timeoutVal = saveTimeoutVal; - 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); -} - -string UnixSerialPort::getLine() throw(GsmException) -{ - string result; - int c; - while ((c = readByte()) >= 0) - { - while (c == CR) - { - c = readByte(); - } - if (c == LF) - break; - result += c; - } - -#ifndef NDEBUG - if (debugLevel() >= 1) - cerr << "<-- " << result << endl; -#endif - - return result; -} - -void UnixSerialPort::putLine(string line, - bool carriageReturn) throw(GsmException) -{ -#ifndef NDEBUG - if (debugLevel() >= 1) - cerr << "--> " << line << endl; -#endif - - if (carriageReturn) line += CR; - const char *l = line.c_str(); - - int timeElapsed = 0; - struct timeval oneSecond; - - ssize_t bytesWritten = 0; - while (bytesWritten < (ssize_t)line.length() && timeElapsed < _timeoutVal) - { - if (interrupted()) - throwModemException(_("interrupted when writing to TA")); - - // setup fd_set data structure for select() - fd_set fdSet; - oneSecond.tv_sec = 1; - oneSecond.tv_usec = 0; - FD_ZERO(&fdSet); - FD_SET(_fd, &fdSet); - - switch (select(FD_SETSIZE, NULL, &fdSet, NULL, &oneSecond)) - { - case 1: - { - ssize_t bw = write(_fd, l + bytesWritten, line.length() - bytesWritten); - if (bw < 0) - throwModemException(_("writing to TA")); - bytesWritten += bw; - break; - } - case 0: - ++timeElapsed; - break; - default: - if (errno != EINTR) - throwModemException(_("writing to TA")); - break; - } - } - - while (timeElapsed < _timeoutVal) - { - if (interrupted()) - throwModemException(_("interrupted when writing to TA")); - startTimer(); - int res = tcdrain(_fd); // wait for output to be read by TA - stopTimer(); - if (res == 0) - break; - else - { - assert(errno == EINTR); - ++timeElapsed; - } - } - if (timeElapsed >= _timeoutVal) - throwModemException(_("timeout when writing to TA")); - - // echo CR LF must be removed by higher layer functions in gsm_at because - // in order to properly handle unsolicited result codes from the ME/TA -} - -bool UnixSerialPort::wait(GsmTime timeout) throw(GsmException) -{ - fd_set fds; - FD_ZERO(&fds); - FD_SET(_fd, &fds); - return select(FD_SETSIZE, &fds, NULL, NULL, timeout) != 0; -} - -// set timeout for read or write in seconds. -void UnixSerialPort::setTimeOut(unsigned int timeout) -{ - _timeoutVal = timeout; -} - -UnixSerialPort::~UnixSerialPort() -{ - if (_fd != -1) - close(_fd); -} - -speed_t gsmlib::baudRateStrToSpeed(string baudrate) throw(GsmException) -{ - if (baudrate == "300") - return B300; - else if (baudrate == "600") - return B600; - else if (baudrate == "1200") - return B1200; - else if (baudrate == "2400") - return B2400; - else if (baudrate == "4800") - return B4800; - else if (baudrate == "9600") - return B9600; - else if (baudrate == "19200") - return B19200; - else if (baudrate == "38400") - return B38400; -#ifdef B57600 - else if (baudrate == "57600") - return B57600; -#endif -#ifdef B115200 - else if (baudrate == "115200") - return B115200; -#endif -#ifdef B230400 - else if (baudrate == "230400") - return B230400; -#endif -#ifdef B460800 - else if (baudrate == "460800") - return B460800; -#endif - else - throw GsmException(stringPrintf(_("unknown baudrate '%s'"), - baudrate.c_str()), ParameterError); -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_unix_serial.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_unix_serial.h deleted file mode 100644 index 29b1800b6c..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_unix_serial.h +++ /dev/null @@ -1,62 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_unix_port.h -// * -// * Purpose: UNIX serial port implementation -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 4.5.1999 -// ************************************************************************* - -#ifndef GSM_UNIX_SERIAL_H -#define GSM_UNIX_SERIAL_H - -#include -#include -#include -#include -#include -#include - -using namespace std; - -namespace gsmlib -{ - class UnixSerialPort : public Port - { - private: - int _fd; // file descriptor for device - int _debug; // debug level (set by environment variable - // GSM_DEBUG - int _oldChar; // character set by putBack() (-1 == none) - long int _timeoutVal; // timeout for getLine/readByte - - // throw GsmException include UNIX errno - void throwModemException(string message) throw(GsmException); - - public: - // create Port given the UNIX device name - UnixSerialPort(string device, speed_t lineSpeed = DEFAULT_BAUD_RATE, - string initString = DEFAULT_INIT_STRING, - bool swHandshake = false) - throw(GsmException); - - // inherited from Port - void putBack(unsigned char c); - int readByte() throw(GsmException); - string getLine() throw(GsmException); - void putLine(string line, - bool carriageReturn = true) throw(GsmException); - bool wait(GsmTime timeout) throw(GsmException); - void setTimeOut(unsigned int timeout); - - virtual ~UnixSerialPort(); - }; - - // convert baudrate string ("300" .. "460800") to speed_t - extern speed_t baudRateStrToSpeed(string baudrate) throw(GsmException); -}; - -#endif // GSM_UNIX_SERIAL_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_util.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_util.cc deleted file mode 100755 index bfcb4e9858..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_util.cc +++ /dev/null @@ -1,381 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_util.h -// * -// * Purpose: Various utilities -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 4.5.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if !defined(HAVE_CONFIG_H) || defined(HAVE_UNISTD_H) -#include -#endif -#if !defined(HAVE_CONFIG_H) || defined(HAVE_MALLOC_H) -#include -#endif -#include -#ifdef HAVE_VSNPRINTF -// switch on vsnprintf() prototype in stdio.h -#define __USE_GNU -#define _GNU_SOURCE -#endif -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -// Latin-1 undefined character (code 172 (Latin-1 boolean not, "")) -const int NOP = 172; - -// GSM undefined character (code 16 (GSM Delta)) -const int GSM_NOP = 16; - -// conversion tables, Latin1 to GSM and GSM to Latin1 - -static unsigned char gsmToLatin1Table[] = -{ - // 0 '@', '', '$', '', '', '', '', '', - '@', 163, '$', 165, 232, 233, 249, 236, - // 8 '', '', LF, '', '', CR, '', '', - 242, 199, 10, 216, 248, 13, 197, 229, - // 16 '', '_', '', '', '', '', '', '', - NOP, '_', NOP, NOP, NOP, NOP, NOP, NOP, - // 24 '', '', '', '', '', '', '', '', - NOP, NOP, NOP, NOP, 198, 230, 223, 201, - // 32 ' ', '!', '"', '#', '', '%', '&', ''', - ' ', '!', '"', '#', 164, '%', '&', '\'', - // 40 '(', ')', '*', '+', ',', '-', '.', '/', - '(', ')', '*', '+', ',', '-', '.', '/', - // 48 '0', '1', '2', '3', '4', '5', '6', '7', - '0', '1', '2', '3', '4', '5', '6', '7', - // 56 '8', '9', ':', ';', '<', '=', '>', '?', - '8', '9', ':', ';', '<', '=', '>', '?', - // 64 '', 'A', 'B', 'C', 'D', 'E', 'F', 'G', - 161, 'A', 'B', 'C', 'D', 'E', 'F', 'G', - // 72 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', - 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', - // 80 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', - 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', - // 88 'X', 'Y', 'Z', '', '', '', '', '', - 'X', 'Y', 'Z', 196, 214, 209, 220, 167, - // 96 '', 'a', 'b', 'c', 'd', 'e', 'f', 'g', - 191, 'a', 'b', 'c', 'd', 'e', 'f', 'g', - // 104 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', - 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', - // 112 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', - 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', - // 120 'x', 'y', 'z', '', '', '', '', '', - 'x', 'y', 'z', 228, 246, 241, 252, 224 -}; - -static unsigned char latin1ToGsmTable[256]; - -static class Latin1ToGsmTableInit -{ -public: - Latin1ToGsmTableInit() - { - memset((void*)latin1ToGsmTable, GSM_NOP, 256); - for (int i = 0; i < 128; i++) - if (gsmToLatin1Table[i] != NOP) - latin1ToGsmTable[gsmToLatin1Table[i]] = i; - } -} latin1ToGsmTableInit; - -string gsmlib::gsmToLatin1(string s) -{ - string result(s.length(), 0); - for (string::size_type i = 0; i < s.length(); i++) - result[i] = (unsigned char)s[i] > 127 ? NOP : gsmToLatin1Table[s[i]]; - return result; -} - -string gsmlib::latin1ToGsm(string s) -{ - string result(s.length(), 0); - for (string::size_type i = 0; i < s.length(); i++) - result[i] = latin1ToGsmTable[(unsigned char)s[i]]; - return result; -} - -static unsigned char byteToHex[] = -{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - 'A', 'B', 'C', 'D', 'E', 'F'}; - -string gsmlib::bufToHex(const unsigned char *buf, unsigned long length) -{ - const unsigned char *bb = buf; - string result; - result.reserve(length * 2); - - for (unsigned long i = 0; i < length; ++i) - { - result += byteToHex[*bb >> 4]; - result += byteToHex[*bb++ & 0xf]; - } - return result; -} - -bool gsmlib::hexToBuf(const string &hexString, unsigned char *buf) -{ - if (hexString.length() % 2 != 0) - return false; - - unsigned char *bb = buf; - for (unsigned int i = 0; i < hexString.length(); i += 2) - { - unsigned char c = hexString[i]; - if (! isdigit(c) && ! ('a' <= c && c <= 'f') && ! ('A' <= c && c <= 'F')) - return false; - *bb = (isdigit(c) ? c - '0' : - ((('a' <= c && c <= 'f') ? c - 'a' : c - 'A')) + 10) << 4; - c = hexString[i + 1]; - if (! isdigit(c) && ! ('a' <= c && c <= 'f') && ! ('A' <= c && c <= 'F')) - return false; - *bb++ |= isdigit(c) ? c - '0' : - ((('a' <= c && c <= 'f') ? c - 'a' : c - 'A') + 10); - } - return true; -} - -string gsmlib::intToStr(int i) -{ - ostrstream os; - os << i << ends; - char *ss = os.str(); - string s(ss); - delete[] ss; - return s; -} - -string gsmlib::removeWhiteSpace(string s) -{ - string result; - for (unsigned int i = 0; i < s.length(); ++i) - if (! isspace(s[i])) - result += s[i]; - return result; -} - -#ifdef WIN32 - -// helper routine, find out whether filename starts with "COM" -static bool isCom(string filename) -{ - filename = removeWhiteSpace(lowercase(filename)); - // remove UNC begin - if ( filename.compare(0, 4, "\\\\.\\") == 0 ) - filename.erase(0, 4); - return filename.length() < 3 || filename.substr(0, 3) == "com"; -} -#endif - -bool gsmlib::isFile(string filename) -{ -#ifdef WIN32 - // stat does not work reliably under Win32 to indicate devices - if (isCom(filename)) - return false; -#endif - - struct stat statBuf; - int retries = 0; - - while (retries < 10) - { - if (stat(filename.c_str(), &statBuf) != 0) - throw GsmException( - stringPrintf(_("error when calling stat('%s') (errno: %d/%s)"), - filename.c_str(), errno, strerror(errno)), - OSError); - -#ifndef WIN32 - if (S_ISLNK(statBuf.st_mode)) - { - int size = 100; - while (1) - { - char *buffer = (char*)malloc(size); - int nchars = readlink(filename.c_str(), buffer, size); - if (nchars < size) - { - filename.assign(buffer, nchars); - free(buffer); - break; - } - free(buffer); - size *= 2; - } - ++retries; - } - else if (S_ISCHR(statBuf.st_mode)) - return false; - else -#endif - if (S_ISREG(statBuf.st_mode)) - return true; - else - throw GsmException( - stringPrintf(_("file '%s' is neither file nor character device"), - filename.c_str()), - ParameterError); - } - throw GsmException(_("maxmimum number of symbolic links exceeded"), - ParameterError); -} - -void gsmlib::renameToBackupFile(string filename) throw(GsmException) -{ - string backupFilename = filename + "~"; - unlink(backupFilename.c_str()); - if (rename(filename.c_str(), backupFilename.c_str()) < 0) - throw GsmException( - stringPrintf(_("error renaming '%s' to '%s'"), - filename.c_str(), backupFilename.c_str()), - OSError, errno); -} - -// NoCopy members - -#ifndef NDEBUG - -NoCopy::NoCopy(NoCopy &n) -{ - cerr << "ABORT: NoCopy copy constructor used" << endl; - abort(); -} - -NoCopy &NoCopy::operator=(NoCopy &n) -{ - cerr << "ABORT: NoCopy::operator= used" << endl; - abort(); -#ifdef WIN32 - return n; -#endif //WIN32 -} - -#endif // NDEBUG - -string gsmlib::lowercase(string s) -{ - string result; - for (unsigned int i = 0; i < s.length(); ++i) - result += tolower(s[i]); - return result; -} - -int gsmlib::checkNumber(string s) throw(GsmException) -{ - for (unsigned int i = 0; i < s.length(); ++i) - if (! isdigit(s[i])) - throw GsmException(stringPrintf(_("expected number, got '%s'"), - s.c_str()), ParameterError); - int result; - istrstream is(s.c_str()); - is >> result; - return result; -} - -#ifdef HAVE_VSNPRINTF -string gsmlib::stringPrintf(const char *format, ...) -{ - va_list args; - va_start(args, format); - int size = 1024; - while (1) - { - char *buf = (char*)alloca(sizeof(char) * size); - int nchars = vsnprintf(buf, size, format, args); - if (nchars < size) - { - va_end(args); - return string(buf, nchars); - } - size *= 2; - } - return ""; -} - -#else -char gsmlib::__s[20000]; // buffer for the replacement macro -#endif // HAVE_VSNPRINTF - -#ifndef NDEBUG -int gsmlib::debugLevel() -{ - char *s = getenv("GSMLIB_DEBUG"); - if (s == NULL) return 0; - return checkNumber(s); -} -#endif - -// interrupt interface - -namespace gsmlib -{ - static InterruptBase *interruptObject = NULL; -} - -void gsmlib::setInterruptObject(InterruptBase *intObject) -{ - interruptObject = intObject; -} - -bool gsmlib::interrupted() -{ - return interruptObject != NULL && interruptObject->interrupted(); -} - -void gsmlib::checkTextAndTelephone(string text, string telephone) - throw(GsmException) -{ - if (text.find('"') != string::npos) - throw GsmException( - stringPrintf(_("text '%s' contains illegal character '\"'"), - text.c_str()), - ParameterError); - - for (unsigned int i = 0; i < telephone.length(); ++i) - if (! isdigit(telephone[i]) && ! (telephone[i] == '+') && - ! (telephone[i] == '*') && ! (telephone[i] == '#') && - ! (telephone[i] == 'p') && ! (telephone[i] == 'w') && - ! (telephone[i] == 'P') && ! (telephone[i] == 'W')) - throw GsmException( - stringPrintf(_("illegal character in telephone number '%s'"), - telephone.c_str()), ParameterError); -} - -// progress interface - -namespace gsmlib -{ - static ProgressBase *progressObject = NULL; -} - -void gsmlib::setProgressObject(ProgressBase *progObject) -{ - progressObject = progObject; -} - -void gsmlib::reportProgress(int part, int total) -{ - if (progressObject != NULL) - progressObject->reportProgress(part, total); -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_util.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_util.h deleted file mode 100644 index e4cee34372..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_util.h +++ /dev/null @@ -1,233 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_util.h -// * -// * Purpose: Various utilities -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 4.5.1999 -// ************************************************************************* - -#ifndef GSM_UTIL_H -#define GSM_UTIL_H - -#include -#include -#include -#include -#ifndef WIN32 -#include -#endif -#include - -using namespace std; - -namespace gsmlib -{ - // time type - typedef struct timeval *GsmTime; - - // some constants - const char CR = 13; // ASCII carriage return - const char LF = 10; // ASCII line feed - - // common number formats - const unsigned int UnknownNumberFormat = 129; - const unsigned int InternationalNumberFormat = 145; - - // convert gsm to Latin-1 - // characters that have no counterpart in Latin-1 are converted to - // code 172 (Latin-1 boolean not, "") - string gsmToLatin1(string s); - - // convert Latin-1 to gsm - // characters that have no counterpart in GSM are converted to - // code 16 (GSM Delta) - string latin1ToGsm(string s); - - // convert byte buffer of length to hexadecimal string - string bufToHex(const unsigned char *buf, unsigned long length); - - // convert hexString to byte buffer, return false if no hexString - bool hexToBuf(const string &hexString, unsigned char *buf); - - // indicate that a value is not set - const int NOT_SET = -1; - - // An integer range - struct IntRange - { - int _high, _low; - - IntRange() : _high(NOT_SET), _low(NOT_SET) {} - }; - - // A valid integer range for a given parameter - struct ParameterRange - { - string _parameter; - IntRange _range; - }; - - // *** general-purpose pointer wrapper with reference counting - - class RefBase - { - private: - int _refCount; - - public: - RefBase() : _refCount(0) {} - int ref() {return _refCount++;} - int unref() {return --_refCount;} - int refCount() const {return _refCount;} - }; - - template - class Ref - { - private: - T *_rep; - public: - T *operator->() const {return _rep;} - T &operator()() {return *_rep;} - T *getptr() {return _rep;} - bool isnull() const {return _rep == (T*)NULL;} - Ref() : _rep((T*)NULL) {} - Ref(T *pp) : _rep(pp) {if (pp != (T*)NULL) pp->ref();} - Ref(const Ref &r); - Ref &operator=(const Ref &r); - ~Ref(); - bool operator==(const Ref &r) const - { - return _rep == r._rep; - } - }; - - template - Ref::Ref(const Ref &r) : _rep(r._rep) - { - if (_rep != (T*)NULL) _rep->ref(); - } - - template - Ref &Ref::operator=(const Ref &r) - { - if (r._rep != (T*)NULL) r._rep->ref(); - if (_rep != (T*)NULL && _rep->unref() == 0) delete _rep; - _rep = r._rep; - return *this; - } - - template - Ref::~Ref() - { - if (_rep != (T*)NULL && _rep->unref() == 0) delete _rep; - } - - // utility function return string given an int - string intToStr(int i); - - // remove white space from the string - string removeWhiteSpace(string s); - - // return true if bit is set in vector - inline bool isSet(vector &b, unsigned int bit) - { - return b.size() > bit && b[bit]; - } - - // return true if filename refers to a file - // throws exception if filename is neither file nor device - bool isFile(string filename); - - // make backup file adequate for this operating system - void renameToBackupFile(string filename) throw(GsmException); - - // Base class for class for which copying is not allow - // only used for debugging - - class NoCopy - { - public: - NoCopy() {} - -#ifndef NDEBUG - NoCopy(NoCopy &n); - - NoCopy &operator=(NoCopy &n); -#endif - }; - - // convert string to lower case - string lowercase(string s); - - // convert string to number and check for all digits - int checkNumber(string s) throw(GsmException); - - // like printf, but return C++ string -#ifdef HAVE_VSNPRINTF - string stringPrintf(const char *format, ...) -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) - __attribute__((format (printf, 1, 2))) -#endif - ; -#else - // WARNING: This replacement code is - // - not threadsafe - // - subject to buffer overruns -#define stringPrintf(format, args...) \ - (sprintf(__s, format, ## args), string(__s)) - - extern char __s[]; -#endif // HAVE_VSNPRINTF - - // return debug level -#ifndef NDEBUG - extern int debugLevel(); -#endif - - // interface for interrupting gsmlib activity - - class InterruptBase - { - public: - // this member should return true if gsmlib is to be interrupted - virtual bool interrupted() = 0; - }; - - // set global interrupt object - extern void setInterruptObject(InterruptBase *intObject); - - // return true if interrupted - extern bool interrupted(); - - // interface for reporting progress - - class ProgressBase - { - public: - // override this to receive progress reports - virtual void reportProgress(int part, int total) = 0; - }; - - // set global progress object - extern void setProgressObject(ProgressBase *progObject); - - // report progress (part/total * 100 is meant to be the percentage) - // this function is called by - // - GsmAt::chatv() without arguments, used by Phonebook::Phonebook() - // - Phonebook::Phonebook() - // - SortedPhonebook::SortedPhonebook() - // - SortedSMSStore::SortedSMSStore() - extern void reportProgress(int part = -1, int total = -1); - - // check for valid text and telephone number - // throw exception if error - extern void checkTextAndTelephone(string text, string telephone) - throw(GsmException); -}; - -#endif // GSM_UTIL_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_win32_serial.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_win32_serial.cc deleted file mode 100644 index dda1d74587..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_win32_serial.cc +++ /dev/null @@ -1,507 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_win32_port.cc -// * -// * Purpose: WIN32 serial port implementation -// * -// * Author: Frediano Ziglio (freddy77@angelfire.com) -// * -// * Created: 25.10.2000 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -static long int timeoutVal = TIMEOUT_SECS; - -struct ExceptionSafeOverlapped: public OVERLAPPED -{ - ExceptionSafeOverlapped() - { - memset((OVERLAPPED*)this,0,sizeof(OVERLAPPED)); - hEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); - if (hEvent == INVALID_HANDLE_VALUE) - throw GsmException(_("error creating event"),OSError,GetLastError()); - } - ~ExceptionSafeOverlapped() - { CloseHandle(hEvent); } -}; - -typedef BOOL (WINAPI *TCancelIoProc)(HANDLE file); -TCancelIoProc CancelIoProc = NULL; -BOOL CancelIoHook(HANDLE file) -{ - if (CancelIoProc) - return CancelIoProc(file); - - HMODULE hmodule = GetModuleHandle("KERNEL32"); - if (hmodule) - { - CancelIoProc = (TCancelIoProc)GetProcAddress(hmodule,"CancelIo"); - if (CancelIoProc) - return CancelIoProc(file); - } - - return TRUE; -} -#define CancelIo CancelIoHook - -// Win32SerialPort members - -void Win32SerialPort::throwModemException(string message) throw(GsmException) -{ - ostrstream os; - os << message << " (errno: " << errno << "/" << strerror(errno) << ")" - << ends; - char *ss = os.str(); - string s(ss); - delete[] ss; - throw GsmException(s, OSError, errno); -} - -void Win32SerialPort::putBack(unsigned char c) -{ - assert(_oldChar == -1); - _oldChar = c; -} - -int Win32SerialPort::readByte() throw(GsmException) -{ - if (_oldChar != -1) - { - int result = _oldChar; - _oldChar = -1; - return result; - } - - unsigned char c; - int timeElapsed = 0; - bool readDone = true; - ExceptionSafeOverlapped over; - - DWORD initTime = GetTickCount(); - DWORD dwReaded; - if (!ReadFile(_file,&c,1,&dwReaded,&over)) - { - readDone = false; - if (GetLastError() != ERROR_IO_PENDING) - { - throwModemException(_("reading from TA")); - } - - while(!readDone) - { - if (interrupted()) - throwModemException(_("interrupted when reading from TA")); - - // wait another second - switch(WaitForSingleObject(over.hEvent,1000)) - { - case WAIT_TIMEOUT: - break; - case WAIT_OBJECT_0: - case WAIT_ABANDONED: - // !!! do a infinite loop if (bytesWritten < lenght) ? - GetOverlappedResult(_file,&over,&dwReaded,TRUE); - readDone = true; - break; - case WAIT_FAILED: - throwModemException(_("reading from TA")); - } - - timeElapsed = (GetTickCount() - initTime)/1000U; - - // timeout elapsed ? - if (timeElapsed >= timeoutVal) - { - CancelIo(_file); - break; - } - - } - } - - if (! readDone) - throwModemException(_("timeout when reading from TA")); - -#ifndef NDEBUG - if (debugLevel() >= 2) - { - // some useful debugging code - if (c == LF) - cerr << ""; - else if (c == CR) - cerr << ""; - else cerr << "<'" << (char) c << "'>"; - cerr.flush(); - } -#endif - return c; -} - -Win32SerialPort::Win32SerialPort(string device, int lineSpeed, - string initString, bool swHandshake) - throw(GsmException) : - _oldChar(-1) -{ - try - { - int holdoff[] = {2000, 1000, 400}; - - // open device - _file = CreateFile(device.c_str(),GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL ); - if (_file == INVALID_HANDLE_VALUE) - throwModemException(stringPrintf(_("opening device '%s'"), - device.c_str())); - - int initTries = 3; - while (initTries-- > 0) - { - // flush all pending output - FlushFileBuffers(_file); - - // toggle DTR to reset modem - if (!EscapeCommFunction(_file,CLRDTR)) - throwModemException(_("clearing DTR failed")); - Sleep(holdoff[initTries]); - if (!EscapeCommFunction(_file,SETDTR)) - throwModemException(_("setting DTR failed")); - - DCB dcb; - // get line modes - if (!GetCommState(_file,&dcb)) - throwModemException(stringPrintf(_("GetCommState device '%s'"), - device.c_str())); - -// if (tcgetattr(_fd, &t) < 0) -// throwModemException(stringPrintf(_("tcgetattr device '%s'"), -// device.c_str())); - - // set the device to a sane state - dcb.fBinary = TRUE; - dcb.BaudRate = lineSpeed; - - // n,8,1 - dcb.fParity = FALSE; - dcb.Parity = 0; - dcb.ByteSize = 8; - dcb.StopBits = 0; - - if (!swHandshake) - { - dcb.fInX = FALSE; - dcb.fOutX = FALSE; - dcb.fOutxDsrFlow = FALSE; - dcb.fOutxCtsFlow = FALSE; - } - else - { - dcb.fInX = TRUE; - dcb.fOutX = TRUE; - dcb.fOutxDsrFlow = FALSE; - dcb.fOutxCtsFlow = FALSE; - } - dcb.fDtrControl = DTR_CONTROL_ENABLE; - dcb.fRtsControl = RTS_CONTROL_ENABLE; - -// t.c_iflag |= IGNPAR; -// t.c_iflag &= ~(INPCK | ISTRIP | IMAXBEL | -// (swHandshake ? CRTSCTS : IXON | IXOFF) -// | IXANY | IGNCR | ICRNL | IMAXBEL | INLCR | IGNBRK); -// t.c_oflag &= ~(OPOST); -// // be careful, only touch "known" flags -// t.c_cflag&= ~(CSIZE | CSTOPB | PARENB | PARODD); -// t.c_cflag|= CS8 | CREAD | HUPCL | -// (swHandshake ? IXON | IXOFF : CRTSCTS) | -// CLOCAL; -// t.c_lflag &= ~(ECHO | ECHOE | ECHOPRT | ECHOK | ECHOKE | ECHONL | -// ECHOCTL | ISIG | IEXTEN | TOSTOP | FLUSHO | ICANON); -// t.c_lflag |= NOFLSH; -// -// t.c_cc[VMIN] = 1; -// t.c_cc[VTIME] = 0; -// -// t.c_cc[VSUSP] = 0; - - // write back - if (!SetCommState(_file,&dcb)) - throwModemException(stringPrintf(_("SetCommState device '%s'"), - device.c_str())); - - Sleep(holdoff[initTries]); - - if (!SetupComm(_file,1024,1024)) - throwModemException(stringPrintf(_("SetupComm device '%s'"), - device.c_str())); - - - // flush all pending input - PurgeComm(_file,PURGE_RXABORT|PURGE_RXCLEAR); - - try - { - // reset modem - putLine("ATZ"); - bool foundOK = false; - int readTries = 5; - while (readTries-- > 0) - { - string s = getLine(); - if (s.find("OK") != string::npos || - s.find("CABLE: GSM") != string::npos) - { - foundOK = true; - readTries = 0; // found OK, exit loop - } - } - - if (foundOK) - { - // init modem - readTries = 5; - // !!! no not declare this in loop, compiler error on Visual C++ - // (without SP and with SP4) - string s; - putLine("AT" + initString); - do - { - s = getLine(); - if (s.find("OK") != string::npos || - s.find("CABLE: GSM") != string::npos) - return; // found OK, return - } while(--readTries); - } - } - catch (GsmException &e) - { - if (initTries == 0) - throw e; - } - } - // no response after 3 tries - throw GsmException(stringPrintf(_("reset modem failed '%s'"), - device.c_str()), OtherError); - } - catch (GsmException &e) - { - if ( _file != INVALID_HANDLE_VALUE) - CloseHandle(_file); - throw e; - } -} - -string Win32SerialPort::getLine() throw(GsmException) -{ - string result; - int c; - while ((c = readByte()) > 0) - { - while (c == CR) - { - c = readByte(); - } - if (c == LF) - break; - result += c; - } - -#ifndef NDEBUG - if (debugLevel() >= 1) - cerr << "<-- " << result << endl; -#endif - - return result; -} - -void Win32SerialPort::putLine(string line, - bool carriageReturn) throw(GsmException) -{ -#ifndef NDEBUG - if (debugLevel() >= 1) - cerr << "--> " << line << endl; -#endif - - if (carriageReturn) line += CR; - // !!! BUG, mantain this pointer isn't corrent, use iterator !!! - const char *l = line.c_str(); - - FlushFileBuffers(_file); // flush all pending input and output - - int timeElapsed = 0; - - DWORD bytesWritten = 0; - - ExceptionSafeOverlapped over; - - DWORD initTime = GetTickCount(); - if (!WriteFile(_file,l,line.length(),&bytesWritten,&over)) - { - if (GetLastError() != ERROR_IO_PENDING) - { - throwModemException(_("writing to TA")); - } - - while(bytesWritten < (DWORD)line.length()) - { - if (interrupted()) - throwModemException(_("interrupted when writing to TA")); - - // wait another second - switch(WaitForSingleObject(over.hEvent,1000)) - { - case WAIT_TIMEOUT: - break; - case WAIT_OBJECT_0: - case WAIT_ABANDONED: - // !!! do a infinite loop if (bytesWritten < lenght) ? - GetOverlappedResult(_file,&over,&bytesWritten,TRUE); - break; - case WAIT_FAILED: - throwModemException(_("writing to TA")); - } - - timeElapsed = (GetTickCount() - initTime)/1000U; - - // timeout elapsed ? - if (timeElapsed >= timeoutVal) - { - CancelIo(_file); - throwModemException(_("timeout when writing to TA")); - } - - } - } - - return; -/* - // empty buffer - SetCommMask(_file,EV_TXEMPTY); - DWORD dwEvent; - ResetEvent(over.hEvent); - if( WaitCommEvent(_file,&dwEvent,&over) ) - return; // already empty - - // check true errors - if (GetLastError() != ERROR_IO_PENDING) - throwModemException(_("error comm waiting")); - - while(timeElapsed < timeoutVal) - { - if (interrupted()) - throwModemException(_("interrupted when flushing to TA")); - - switch( WaitForSingleObject( over.hEvent, 1000 ) ) - { - case WAIT_TIMEOUT: - break; - - // successfully flushed - case WAIT_ABANDONED: - case WAIT_OBJECT_0: - return; - - default: - throwModemException(_("error waiting")); - } - timeElapsed = (GetTickCount() - initTime)/1000U; - } - - CancelIo(_file); - throwModemException(_("timeout when writing to TA")); -*/ - - // echo CR LF must be removed by higher layer functions in gsm_at because - // in order to properly handle unsolicited result codes from the ME/TA -} - -bool Win32SerialPort::wait(GsmTime timeout) throw(GsmException) -{ - // See differences from UNIX - // Why do I use Windows ? - DWORD dwEvent; - SetCommMask(_file,EV_RXCHAR); - if (!timeout) - { - if( !WaitCommEvent(_file,&dwEvent,NULL) ) - throwModemException(_("error comm waiting")); - return true; - } - - ExceptionSafeOverlapped over; - if( !WaitCommEvent(_file,&dwEvent,&over) ) - { - // check true errors - if (GetLastError() != ERROR_IO_PENDING) - throwModemException(_("error comm waiting")); - - switch( WaitForSingleObject( over.hEvent, timeout->tv_sec*1000U+(timeout->tv_usec/1000U) ) ) - { - case WAIT_TIMEOUT: - CancelIo(_file); - return false; - - case WAIT_ABANDONED: - case WAIT_OBJECT_0: - return true; - - default: - throwModemException(_("error waiting")); - } - } - - return true; -} - -void Win32SerialPort::setTimeOut(unsigned int timeout) -{ - timeoutVal = timeout; -} - -Win32SerialPort::~Win32SerialPort() -{ - if ( _file != INVALID_HANDLE_VALUE) - CloseHandle(_file); -} - -int gsmlib::baudRateStrToSpeed(string baudrate) throw(GsmException) -{ - if (baudrate == "300") - return 300; - else if (baudrate == "600") - return 600; - else if (baudrate == "1200") - return 1200; - else if (baudrate == "2400") - return 2400; - else if (baudrate == "4800") - return 4800; - else if (baudrate == "9600") - return 9600; - else if (baudrate == "19200") - return 19200; - else if (baudrate == "38400") - return 38400; - else if (baudrate == "57600") - return 57600; - else if (baudrate == "115200") - return 115200; - else - throw GsmException(stringPrintf(_("unknown baudrate '%s'"), - baudrate.c_str()), ParameterError); -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_win32_serial.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_win32_serial.h deleted file mode 100644 index 627bd09354..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/gsmlib/gsm_win32_serial.h +++ /dev/null @@ -1,60 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: gsm_win32_port.h -// * -// * Purpose: WIN32 serial port implementation -// * -// * Author: Frediano Ziglio (freddy77@angelfire.com) -// * -// * Created: 25.10.2000 -// ************************************************************************* - -#ifndef GSM_WIN32_SERIAL_H -#define GSM_WIN32_SERIAL_H - -#include -#include -#include -#include -#define WIN32_MEAN_AND_LEAN -#include - -using namespace std; - -namespace gsmlib -{ - class Win32SerialPort : public Port - { - private: - HANDLE _file; // file handle for device - int _oldChar; // character set by putBack() (-1 == none) -// OVERLAPPED _overIn; // overlapped structure for wait - - // throw GsmException include UNIX errno - void throwModemException(string message) throw(GsmException); - - public: - // create Port given the UNIX device name - Win32SerialPort(string device, int lineSpeed = DEFAULT_BAUD_RATE, - string initString = DEFAULT_INIT_STRING, - bool swHandshake = false) - throw(GsmException); - - // inherited from Port - void putBack(unsigned char c); - int readByte() throw(GsmException); - string getLine() throw(GsmException); - void putLine(string line, - bool carriageReturn = true) throw(GsmException); - bool wait(GsmTime timeout) throw(GsmException); - void setTimeOut(unsigned int timeout); - - virtual ~Win32SerialPort(); - }; - - // convert baudrate string ("300" .. "460800") to speed_t - extern int baudRateStrToSpeed(string baudrate) throw(GsmException); -}; - -#endif // GSM_UNIX_SERIAL_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/ChangeLog b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/ChangeLog deleted file mode 100644 index 198950159d..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/ChangeLog +++ /dev/null @@ -1,1086 +0,0 @@ -1998-04-29 Ulrich Drepper - - * intl/localealias.c (read_alias_file): Use unsigned char for - local variables. Remove unused variable tp. - * intl/l10nflist.c (_nl_normalize_codeset): Use unsigned char * - for type of codeset. For loosing Solaris systems. - * intl/loadinfo.h: Adapt prototype of _nl_normalize_codeset. - * intl/bindtextdom.c (BINDTEXTDOMAIN): Don't define local variable - len if not needed. - Patches by Jim Meyering. - -1998-04-28 Ulrich Drepper - - * loadmsgcat.c (_nl_load_domain): Don't assign the element use_mmap if - mmap is not supported. - - * hash-string.h: Don't include . - -1998-04-27 Ulrich Drepper - - * textdomain.c: Use strdup is available. - - * localealias.c: Define HAVE_MEMPCPY so that we can use this - function. Define and use semapahores to protect modfication of - global objects when compiling for glibc. Add code to allow - freeing alias table. - - * l10nflist.c: Don't assume stpcpy not being a macro. - - * gettextP.h: Define internal_function macri if not already done. - Use glibc byte-swap macros instead of defining SWAP when compiled - for glibc. - (struct loaded_domain): Add elements to allow unloading. - - * Makefile.in (distclean): Don't remove libintl.h here. - - * bindtextdomain.c: Carry over changes from glibc. Use strdup if - available. - - * dcgettext.c: Don't assume stpcpy not being a macro. Mark internal - functions. Add memory freeing code for glibc. - - * dgettext.c: Update copyright. - - * explodename.c: Include stdlib.h and string.h only if they exist. - Use strings.h eventually. - - * finddomain.c: Mark internal functions. Use strdup if available. - Add memory freeing code for glibc. - -1997-10-10 20:00 Ulrich Drepper - - * libgettext.h: Fix dummy textdomain and bindtextdomain macros. - They should return reasonable values. - Reported by Tom Tromey . - -1997-09-16 03:33 Ulrich Drepper - - * libgettext.h: Define PARAMS also to `args' if __cplusplus is defined. - * intlh.inst.in: Likewise. - Reported by Jean-Marc Lasgouttes . - - * libintl.glibc: Update from current glibc version. - -1997-09-06 02:10 Ulrich Drepper - - * intlh.inst.in: Reformat copyright. - -1997-08-19 15:22 Ulrich Drepper - - * dcgettext.c (DCGETTEXT): Remove wrong comment. - -1997-08-16 00:13 Ulrich Drepper - - * Makefile.in (install-data): Don't change directory to install. - -1997-08-01 14:30 Ulrich Drepper - - * cat-compat.c: Fix copyright. - - * localealias.c: Don't define strchr unless !HAVE_STRCHR. - - * loadmsgcat.c: Update copyright. Fix typos. - - * l10nflist.c: Don't define strchr unless !HAVE_STRCHR. - (_nl_make_l10nflist): Handle sponsor and revision correctly. - - * gettext.c: Update copyright. - * gettext.h: Likewise. - * hash-string.h: Likewise. - - * finddomain.c: Remoave dead code. Define strchr only if - !HAVE_STRCHR. - - * explodename.c: Include . - - * explodename.c: Reformat copyright text. - (_nl_explode_name): Fix typo. - - * dcgettext.c: Define and use __set_errno. - (guess_category_value): Don't use setlocale if HAVE_LC_MESSAGES is - not defined. - - * bindtextdom.c: Pretty printing. - -1997-05-01 02:25 Ulrich Drepper - - * dcgettext.c (guess_category_value): Don't depend on - HAVE_LC_MESSAGES. We don't need the macro here. - Patch by Bruno Haible . - - * cat-compat.c (textdomain): DoN't refer to HAVE_SETLOCALE_NULL - macro. Instead use HAVE_LOCALE_NULL and define it when using - glibc, as in dcgettext.c. - Patch by Bruno Haible . - - * Makefile.in (CPPFLAGS): New variable. Reported by Franc,ois - Pinard. - -Mon Mar 10 06:51:17 1997 Ulrich Drepper - - * Makefile.in: Implement handling of libtool. - - * gettextP.h: Change data structures for use of generic lowlevel - i18n file handling. - -Wed Dec 4 20:21:18 1996 Ulrich Drepper - - * textdomain.c: Put parentheses around arguments of memcpy macro - definition. - * localealias.c: Likewise. - * l10nflist.c: Likewise. - * finddomain.c: Likewise. - * bindtextdom.c: Likewise. - Reported by Thomas Esken. - -Mon Nov 25 22:57:51 1996 Ulrich Drepper - - * textdomain.c: Move definition of `memcpy` macro to right - position. - -Fri Nov 22 04:01:58 1996 Ulrich Drepper - - * finddomain.c [!HAVE_STRING_H && !_LIBC]: Define memcpy using - bcopy if not already defined. Reported by Thomas Esken. - * bindtextdom.c: Likewise. - * l10nflist.c: Likewise. - * localealias.c: Likewise. - * textdomain.c: Likewise. - -Tue Oct 29 11:10:27 1996 Ulrich Drepper - - * Makefile.in (libdir): Change to use exec_prefix instead of - prefix. Reported by Knut-HvardAksnes . - -Sat Aug 31 03:07:09 1996 Ulrich Drepper - - * l10nflist.c (_nl_normalize_codeset): We convert to lower case, - so don't prepend uppercase `ISO' for only numeric arg. - -Fri Jul 19 00:15:46 1996 Ulrich Drepper - - * l10nflist.c: Move inclusion of argz.h, ctype.h, stdlib.h after - definition of _GNU_SOURCE. Patch by Roland McGrath. - - * Makefile.in (uninstall): Fix another bug with `for' loop and - empty arguments. Patch by Jim Meyering. Correct name os - uninstalled files: no intl- prefix anymore. - - * Makefile.in (install-data): Again work around shells which - cannot handle mpty for list. Reported by Jim Meyering. - -Sat Jul 13 18:11:35 1996 Ulrich Drepper - - * Makefile.in (install): Split goal. Now depend on install-exec - and install-data. - (install-exec, install-data): New goals. Created from former - install goal. - Reported by Karl Berry. - -Sat Jun 22 04:58:14 1996 Ulrich Drepper - - * Makefile.in (MKINSTALLDIRS): New variable. Path to - mkinstalldirs script. - (install): use MKINSTALLDIRS variable or if the script is not present - try to find it in the $top_scrdir). - -Wed Jun 19 02:56:56 1996 Ulrich Drepper - - * l10nflist.c: Linux libc *partly* includes the argz_* functions. - Grr. Work around by renaming the static version and use macros - for renaming. - -Tue Jun 18 20:11:17 1996 Ulrich Drepper - - * l10nflist.c: Correct presence test macros of __argz_* functions. - - * l10nflist.c: Include based on test of it instead when - __argz_* functions are available. - Reported by Andreas Schwab. - -Thu Jun 13 15:17:44 1996 Ulrich Drepper - - * explodename.c, l10nflist.c: Define NULL for dumb systems. - -Tue Jun 11 17:05:13 1996 Ulrich Drepper - - * intlh.inst.in, libgettext.h (dcgettext): Rename local variable - result to __result to prevent name clash. - - * l10nflist.c, localealias.c, dcgettext.c: Define _GNU_SOURCE to - get prototype for stpcpy and strcasecmp. - - * intlh.inst.in, libgettext.h: Move declaration of - `_nl_msg_cat_cntr' outside __extension__ block to prevent warning - from gcc's -Wnested-extern option. - -Fri Jun 7 01:58:00 1996 Ulrich Drepper - - * Makefile.in (install): Remove comment. - -Thu Jun 6 17:28:17 1996 Ulrich Drepper - - * Makefile.in (install): Work around for another Buglix stupidity. - Always use an `else' close for `if's. Reported by Nelson Beebe. - - * Makefile.in (intlh.inst): Correct typo in phony rule. - Reported by Nelson Beebe. - -Thu Jun 6 01:49:52 1996 Ulrich Drepper - - * dcgettext.c (read_alias_file): Rename variable alloca_list to - block_list as the macro calls assume. - Patch by Eric Backus. - - * localealias.c [!HAVE_ALLOCA]: Define alloca as macro using - malloc. - (read_alias_file): Rename varriabe alloca_list to block_list as the - macro calls assume. - Patch by Eric Backus. - - * l10nflist.c: Correct conditional for inclusion. - Reported by Roland McGrath. - - * Makefile.in (all): Depend on all-@USE_INCLUDED_LIBINTL@, not - all-@USE_NLS@. - - * Makefile.in (install): intlh.inst comes from local dir, not - $(srcdir). - - * Makefile.in (intlh.inst): Special handling of this goal. If - used in gettext, this is really a rul to construct this file. If - used in any other package it is defined as a .PHONY rule with - empty body. - - * finddomain.c: Extract locale file information handling into - l10nfile.c. Rename local stpcpy__ function to stpcpy. - - * dcgettext.c (stpcpy): Add local definition. - - * l10nflist.c: Solve some portability problems. Patches partly by - Thomas Esken. Add local definition of stpcpy. - -Tue Jun 4 02:47:49 1996 Ulrich Drepper - - * intlh.inst.in: Don't depend including on - HAVE_LOCALE_H. Instead configure must rewrite this fiile - depending on the result of the configure run. - - * Makefile.in (install): libintl.inst is now called intlh.inst. - Add rules for updating intlh.inst from intlh.inst.in. - - * libintl.inst: Renamed to intlh.inst.in. - - * localealias.c, dcgettext.c [__GNUC__]: Define HAVE_ALLOCA to 1 - because gcc has __buitlin_alloca. - Reported by Roland McGrath. - -Mon Jun 3 00:32:16 1996 Ulrich Drepper - - * Makefile.in (installcheck): New goal to fulfill needs of - automake's distcheck. - - * Makefile.in (install): Reorder commands so that VERSION is - found. - - * Makefile.in (gettextsrcdir): Now use subdirectory intl/ in - @datadir@/gettext. - (COMSRCS): Add l10nfile.c. - (OBJECTS): Add l10nfile.o. - (DISTFILES): Rename to DISTFILE.normal. Remove $(DISTFILES.common). - (DISTFILE.gettext): Remove $(DISTFILES.common). - (all-gettext): Remove goal. - (install): If $(PACKAGE) = gettext install, otherwose do nothing. No - package but gettext itself should install libintl.h + headers. - (dist): Extend goal to work for gettext, too. - (dist-gettext): Remove goal. - - * dcgettext.c [!HAVE_ALLOCA]: Define macro alloca by using malloc. - -Sun Jun 2 17:33:06 1996 Ulrich Drepper - - * loadmsgcat.c (_nl_load_domain): Parameter is now comes from - find_l10nfile. - -Sat Jun 1 02:23:03 1996 Ulrich Drepper - - * l10nflist.c (__argz_next): Add definition. - - * dcgettext.c [!HAVE_ALLOCA]: Add code for handling missing alloca - code. Use new l10nfile handling. - - * localealias.c [!HAVE_ALLOCA]: Add code for handling missing - alloca code. - - * l10nflist.c: Initial revision. - -Tue Apr 2 18:51:18 1996 Ulrich Drepper - - * Makefile.in (all-gettext): New goal. Same as all-yes. - -Thu Mar 28 23:01:22 1996 Karl Eichwalder - - * Makefile.in (gettextsrcdir): Define using @datadir@. - -Tue Mar 26 12:39:14 1996 Ulrich Drepper - - * finddomain.c: Include . Reported by Roland McGrath. - -Sat Mar 23 02:00:35 1996 Ulrich Drepper - - * finddomain.c (stpcpy): Rename to stpcpy__ to prevent clashing - with external declaration. - -Sat Mar 2 00:47:09 1996 Ulrich Drepper - - * Makefile.in (all-no): Rename from all_no. - -Sat Feb 17 00:25:59 1996 Ulrich Drepper - - * gettextP.h [loaded_domain]: Array `successor' must now contain up - to 63 elements (because of codeset name normalization). - - * finddomain.c: Implement codeset name normalization. - -Thu Feb 15 04:39:09 1996 Ulrich Drepper - - * Makefile.in (all): Define to `all-@USE_NLS@'. - (all-yes, all_no): New goals. `all-no' is noop, `all-yes' - is former all. - -Mon Jan 15 21:46:01 1996 Howard Gayle - - * localealias.c (alias_compare): Increment string pointers in loop - of strcasecmp replacement. - -Fri Dec 29 21:16:34 1995 Ulrich Drepper - - * Makefile.in (install-src): Who commented this goal out ? :-) - -Fri Dec 29 15:08:16 1995 Ulrich Drepper - - * dcgettext.c (DCGETTEXT): Save `errno'. Failing system calls - should not effect it because a missing catalog is no error. - Reported by Harald Knig . - -Tue Dec 19 22:09:13 1995 Ulrich Drepper - - * Makefile.in (Makefile): Explicitly use $(SHELL) for running - shell scripts. - -Fri Dec 15 17:34:59 1995 Andreas Schwab - - * Makefile.in (install-src): Only install library and header when - we use the own implementation. Don't do it when using the - system's gettext or catgets functions. - - * dcgettext.c (find_msg): Must not swap domain->hash_size here. - -Sat Dec 9 16:24:37 1995 Ulrich Drepper - - * localealias.c, libintl.inst, libgettext.h, hash-string.h, - gettextP.h, finddomain.c, dcgettext.c, cat-compat.c: - Use PARAMS instead of __P. Suggested by Roland McGrath. - -Tue Dec 5 11:39:14 1995 Larry Schwimmer - - * libgettext.h: Use `#if !defined (_LIBINTL_H)' instead of `#if - !_LIBINTL_H' because Solaris defines _LIBINTL_H as empty. - -Mon Dec 4 15:42:07 1995 Ulrich Drepper - - * Makefile.in (install-src): - Install libintl.inst instead of libintl.h.install. - -Sat Dec 2 22:51:38 1995 Marcus Daniels - - * cat-compat.c (textdomain): - Reverse order in which files are tried you load. First - try local file, when this failed absolute path. - -Wed Nov 29 02:03:53 1995 Nelson H. F. Beebe - - * cat-compat.c (bindtextdomain): Add missing { }. - -Sun Nov 26 18:21:41 1995 Ulrich Drepper - - * libintl.inst: Add missing __P definition. Reported by Nelson Beebe. - - * Makefile.in: - Add dummy `all' and `dvi' goals. Reported by Tom Tromey. - -Sat Nov 25 16:12:01 1995 Franc,ois Pinard - - * hash-string.h: Capitalize arguments of macros. - -Sat Nov 25 12:01:36 1995 Ulrich Drepper - - * Makefile.in (DISTFILES): Prevent files names longer than 13 - characters. libintl.h.glibc->libintl.glibc, - libintl.h.install->libintl.inst. Reported by Joshua R. Poulson. - -Sat Nov 25 11:31:12 1995 Eric Backus - - * dcgettext.c: Fix bug in preprocessor conditionals. - -Sat Nov 25 02:35:27 1995 Nelson H. F. Beebe - - * libgettext.h: Solaris cc does not understand - #if !SYMBOL1 && !SYMBOL2. Sad but true. - -Thu Nov 23 16:22:14 1995 Ulrich Drepper - - * hash-string.h (hash_string): - Fix for machine with >32 bit `unsigned long's. - - * dcgettext.c (DCGETTEXT): - Fix horrible bug in loop for alternative translation. - -Thu Nov 23 01:45:29 1995 Ulrich Drepper - - * po2tbl.sed.in, linux-msg.sed, xopen-msg.sed: - Some further simplifications in message number generation. - -Mon Nov 20 21:08:43 1995 Ulrich Drepper - - * libintl.h.glibc: Use __const instead of const in prototypes. - - * Makefile.in (install-src): - Install libintl.h.install instead of libintl.h. This - is a stripped-down version. Suggested by Peter Miller. - - * libintl.h.install, libintl.h.glibc: Initial revision. - - * localealias.c (_nl_expand_alias, read_alias_file): - Protect prototypes in type casts by __P. - -Tue Nov 14 16:43:58 1995 Ulrich Drepper - - * hash-string.h: Correct prototype for hash_string. - -Sun Nov 12 12:42:30 1995 Ulrich Drepper - - * hash-string.h (hash_string): Add prototype. - - * gettextP.h: Fix copyright. - (SWAP): Add prototype. - -Wed Nov 8 22:56:33 1995 Ulrich Drepper - - * localealias.c (read_alias_file): Forgot sizeof. - Avoid calling *printf function. This introduces a big overhead. - Patch by Roland McGrath. - -Tue Nov 7 14:21:08 1995 Ulrich Drepper - - * finddomain.c, cat-compat.c: Wrong indentation in #if for stpcpy. - - * finddomain.c (stpcpy): - Define substitution function local. The macro was to flaky. - - * cat-compat.c: Fix typo. - - * xopen-msg.sed, linux-msg.sed: - While bringing message number to right place only accept digits. - - * linux-msg.sed, xopen-msg.sed: Now that the counter does not have - leading 0s we don't need to remove them. Reported by Marcus - Daniels. - - * Makefile.in (../po/cat-id-tbl.o): Use $(top_srdir) in - dependency. Reported by Marcus Daniels. - - * cat-compat.c: (stpcpy) [!_LIBC && !HAVE_STPCPY]: Define replacement. - Generally cleanup using #if instead of #ifndef. - - * Makefile.in: Correct typos in comment. By Franc,ois Pinard. - -Mon Nov 6 00:27:02 1995 Ulrich Drepper - - * Makefile.in (install-src): Don't install libintl.h and libintl.a - if we use an available gettext implementation. - -Sun Nov 5 22:02:08 1995 Ulrich Drepper - - * libgettext.h: Fix typo: HAVE_CATGETTS -> HAVE_CATGETS. Reported - by Franc,ois Pinard. - - * libgettext.h: Use #if instead of #ifdef/#ifndef. - - * finddomain.c: - Comments describing what has to be done should start with FIXME. - -Sun Nov 5 19:38:01 1995 Ulrich Drepper - - * Makefile.in (DISTFILES): Split. Use DISTFILES with normal meaning. - DISTFILES.common names the files common to both dist goals. - DISTFILES.gettext are the files only distributed in GNU gettext. - -Sun Nov 5 17:32:54 1995 Ulrich Drepper - - * dcgettext.c (DCGETTEXT): Correct searching in derived locales. - This was necessary since a change in _nl_find_msg several weeks - ago. I really don't know this is still not fixed. - -Sun Nov 5 12:43:12 1995 Ulrich Drepper - - * loadmsgcat.c (_nl_load_domain): Test for FILENAME == NULL. This - might mark a special condition. - - * finddomain.c (make_entry_rec): Don't make illegal entry as decided. - - * Makefile.in (dist): Suppress error message when ln failed. - Get files from $(srcdir) explicitly. - - * libgettext.h (gettext_const): Rename to gettext_noop. - -Fri Nov 3 07:36:50 1995 Ulrich Drepper - - * finddomain.c (make_entry_rec): - Protect against wrong locale names by testing mask. - - * libgettext.h (gettext_const): Add macro definition. - Capitalize macro arguments. - -Thu Nov 2 23:15:51 1995 Ulrich Drepper - - * finddomain.c (_nl_find_domain): - Test for pointer != NULL before accessing value. - Reported by Tom Tromey. - - * gettext.c (NULL): - Define as (void*)0 instad of 0. Reported by Franc,ois Pinard. - -Mon Oct 30 21:28:52 1995 Ulrich Drepper - - * po2tbl.sed.in: Serious typo bug fixed by Jim Meyering. - -Sat Oct 28 23:20:47 1995 Ulrich Drepper - - * libgettext.h: Disable dcgettext optimization for Solaris 2.3. - - * localealias.c (alias_compare): - Peter Miller reported that tolower in some systems is - even dumber than I thought. Protect call by `isupper'. - -Fri Oct 27 22:22:51 1995 Ulrich Drepper - - * Makefile.in (libdir, includedir): New variables. - (install-src): Install libintl.a and libintl.h in correct dirs. - -Fri Oct 27 22:07:29 1995 Ulrich Drepper - - * Makefile.in (SOURCES): Fix typo: intrl.compat.c -> intl-compat.c. - - * po2tbl.sed.in: Patch for buggy SEDs by Christian von Roques. - - * localealias.c: - Fix typo and superflous test. Reported by Christian von Roques. - -Fri Oct 6 11:52:05 1995 Ulrich Drepper - - * finddomain.c (_nl_find_domain): - Correct some remainder from the pre-CEN syntax. Now - we don't have a constant number of successors anymore. - -Wed Sep 27 21:41:13 1995 Ulrich Drepper - - * Makefile.in (DISTFILES): Add libintl.h.glibc. - - * Makefile.in (dist-libc): Add goal for packing sources for glibc. - (COMSRCS, COMHDRS): Splitted to separate sources shared with glibc. - - * loadmsgcat.c: Forget to continue #if line. - - * localealias.c: - [_LIBC]: Rename strcasecmp to __strcasecmp to keep ANSI C name - space clean. - - * dcgettext.c, finddomain.c: Better comment to last change. - - * loadmsgcat.c: - [_LIBC]: Rename fstat, open, close, read, mmap, and munmap to - __fstat, __open, __close, __read, __mmap, and __munmap resp - to keep ANSI C name space clean. - - * finddomain.c: - [_LIBC]: Rename stpcpy to __stpcpy to keep ANSI C name space clean. - - * dcgettext.c: - [_LIBC]: Rename getced and stpcpy to __getcwd and __stpcpy resp to - keep ANSI C name space clean. - - * libgettext.h: - Include sys/types.h for those old SysV systems out there. - Reported by Francesco Potorti`. - - * loadmsgcat.c (use_mmap): Define if compiled for glibc. - - * bindtextdom.c: Include all those standard headers - unconditionally if _LIBC is defined. - - * finddomain.c: Fix 2 times defiend -> defined. - - * textdomain.c: Include libintl.h instead of libgettext.h when - compiling for glibc. Include all those standard headers - unconditionally if _LIBC is defined. - - * localealias.c, loadmsgcat.c: Prepare to be compiled in glibc. - - * gettext.c: - Include libintl.h instead of libgettext.h when compiling for glibc. - Get NULL from stddef.h if we compile for glibc. - - * finddomain.c: Include libintl.h instead of libgettext.h when - compiling for glibc. Include all those standard headers - unconditionally if _LIBC is defined. - - * dcgettext.c: Include all those standard headers unconditionally - if _LIBC is defined. - - * dgettext.c: If compiled in glibc include libintl.h instead of - libgettext.h. - (locale.h): Don't rely on HAVE_LOCALE_H when compiling for glibc. - - * dcgettext.c: If compiled in glibc include libintl.h instead of - libgettext.h. - (getcwd): Don't rely on HAVE_GETCWD when compiling for glibc. - - * bindtextdom.c: - If compiled in glibc include libintl.h instead of libgettext.h. - -Mon Sep 25 22:23:06 1995 Ulrich Drepper - - * localealias.c (_nl_expand_alias): Don't call bsearch if NMAP <= 0. - Reported by Marcus Daniels. - - * cat-compat.c (bindtextdomain): - String used in putenv must not be recycled. - Reported by Marcus Daniels. - - * libgettext.h (__USE_GNU_GETTEXT): - Additional symbol to signal that we use GNU gettext - library. - - * cat-compat.c (bindtextdomain): - Fix bug with the strange stpcpy replacement. - Reported by Nelson Beebe. - -Sat Sep 23 08:23:51 1995 Ulrich Drepper - - * cat-compat.c: Include for stpcpy prototype. - - * localealias.c (read_alias_file): - While expand strdup code temporary variable `cp' hided - higher level variable with same name. Rename to `tp'. - - * textdomain.c (textdomain): - Avoid warning by using temporary variable in strdup code. - - * finddomain.c (_nl_find_domain): Remove unused variable `application'. - -Thu Sep 21 15:51:44 1995 Ulrich Drepper - - * localealias.c (alias_compare): - Use strcasecmp() only if available. Else use - implementation in place. - - * intl-compat.c: - Wrapper functions now call *__ functions instead of __*. - - * libgettext.h: Declare prototypes for *__ functions instead for __*. - - * cat-compat.c, loadmsgcat.c: - Don't use xmalloc, xstrdup, and stpcpy. These functions are not part - of the standard libc and so prevent libintl.a from being used - standalone. - - * bindtextdom.c: - Don't use xmalloc, xstrdup, and stpcpy. These functions are not part - of the standard libc and so prevent libintl.a from being used - standalone. - Rename to bindtextdomain__ if not used in GNU C Library. - - * dgettext.c: - Rename function to dgettext__ if not used in GNU C Library. - - * gettext.c: - Don't use xmalloc, xstrdup, and stpcpy. These functions are not part - of the standard libc and so prevent libintl.a from being used - standalone. - Functions now called gettext__ if not used in GNU C Library. - - * dcgettext.c, localealias.c, textdomain.c, finddomain.c: - Don't use xmalloc, xstrdup, and stpcpy. These functions are not part - of the standard libc and so prevent libintl.a from being used - standalone. - -Sun Sep 17 23:14:49 1995 Ulrich Drepper - - * finddomain.c: Correct some bugs in handling of CEN standard - locale definitions. - -Thu Sep 7 01:49:28 1995 Ulrich Drepper - - * finddomain.c: Implement CEN syntax. - - * gettextP.h (loaded_domain): Extend number of successors to 31. - -Sat Aug 19 19:25:29 1995 Ulrich Drepper - - * Makefile.in (aliaspath): Remove path to X11 locale dir. - - * Makefile.in: Make install-src depend on install. This helps - gettext to install the sources and other packages can use the - install goal. - -Sat Aug 19 15:19:33 1995 Ulrich Drepper - - * Makefile.in (uninstall): Remove stuff installed by install-src. - -Tue Aug 15 13:13:53 1995 Ulrich Drepper - - * VERSION.in: Initial revision. - - * Makefile.in (DISTFILES): - Add VERSION file. This is not necessary for gettext, but - for other packages using this library. - -Tue Aug 15 06:16:44 1995 Ulrich Drepper - - * gettextP.h (_nl_find_domain): - New prototype after changing search strategy. - - * finddomain.c (_nl_find_domain): - We now try only to find a specified catalog. Fall back to other - catalogs listed in the locale list is now done in __dcgettext. - - * dcgettext.c (__dcgettext): - Now we provide message fall back even to different languages. - I.e. if a message is not available in one language all the other - in the locale list a tried. Formerly fall back was only possible - within one language. Implemented by moving one loop from - _nl_find_domain to here. - -Mon Aug 14 23:45:50 1995 Ulrich Drepper - - * Makefile.in (gettextsrcdir): - Directory where source of GNU gettext library are made - available. - (INSTALL, INSTALL_DATA): Programs used for installing sources. - (gettext-src): New. Rule to install GNU gettext sources for use in - gettextize shell script. - -Sun Aug 13 14:40:48 1995 Ulrich Drepper - - * loadmsgcat.c (_nl_load_domain): - Use mmap for loading only when munmap function is - also available. - - * Makefile.in (install): Depend on `all' goal. - -Wed Aug 9 11:04:33 1995 Ulrich Drepper - - * localealias.c (read_alias_file): - Do not overwrite '\n' when terminating alias value string. - - * localealias.c (read_alias_file): - Handle long lines. Ignore the rest not fitting in - the buffer after the initial `fgets' call. - -Wed Aug 9 00:54:29 1995 Ulrich Drepper - - * gettextP.h (_nl_load_domain): - Add prototype, replacing prototype for _nl_load_msg_cat. - - * finddomain.c (_nl_find_domain): - Remove unneeded variable filename and filename_len. - (expand_alias): Remove prototype because functions does not - exist anymore. - - * localealias.c (read_alias_file): - Change type of fname_len parameter to int. - (xmalloc): Add prototype. - - * loadmsgcat.c: Better prototypes for xmalloc. - -Tue Aug 8 22:30:39 1995 Ulrich Drepper - - * finddomain.c (_nl_find_domain): - Allow alias name to be constructed from the four components. - - * Makefile.in (aliaspath): New variable. Set to preliminary value. - (SOURCES): Add localealias.c. - (OBJECTS): Add localealias.o. - - * gettextP.h: Add prototype for _nl_expand_alias. - - * finddomain.c: Aliasing handled in intl/localealias.c. - - * localealias.c: Aliasing for locale names. - - * bindtextdom.c: Better prototypes for xmalloc and xstrdup. - -Mon Aug 7 23:47:42 1995 Ulrich Drepper - - * Makefile.in (DISTFILES): gettext.perl is now found in misc/. - - * cat-compat.c (bindtextdomain): - Correct implementation. dirname parameter was not used. - Reported by Marcus Daniels. - - * gettextP.h (loaded_domain): - New fields `successor' and `decided' for oo, lazy - message handling implementation. - - * dcgettext.c: - Adopt for oo, lazy message handliing. - Now we can inherit translations from less specific locales. - (find_msg): New function. - - * loadmsgcat.c, finddomain.c: - Complete rewrite. Implement oo, lazy message handling :-). - We now have an additional environment variable `LANGUAGE' with - a higher priority than LC_ALL for the LC_MESSAGE locale. - Here we can set a colon separated list of specifications each - of the form `language[_territory[.codeset]][@modifier]'. - -Sat Aug 5 09:55:42 1995 Ulrich Drepper - - * finddomain.c (unistd.h): - Include to get _PC_PATH_MAX defined on system having it. - -Fri Aug 4 22:42:00 1995 Ulrich Drepper - - * finddomain.c (stpcpy): Include prototype. - - * Makefile.in (dist): Remove `copying instead' message. - -Wed Aug 2 18:52:03 1995 Ulrich Drepper - - * Makefile.in (ID, TAGS): Do not use $^. - -Tue Aug 1 20:07:11 1995 Ulrich Drepper - - * Makefile.in (TAGS, ID): Use $^ as command argument. - (TAGS): Give etags -o option t write to current directory, - not $(srcdir). - (ID): Use $(srcdir) instead os $(top_srcdir)/src. - (distclean): Remove ID. - -Sun Jul 30 11:51:46 1995 Ulrich Drepper - - * Makefile.in (gnulocaledir): - New variable, always using share/ for data directory. - (DEFS): Add GNULOCALEDIR, used in finddomain.c. - - * finddomain.c (_nl_default_dirname): - Set to GNULOCALEDIR, because it always has to point - to the directory where GNU gettext Library writes it to. - - * intl-compat.c (textdomain, bindtextdomain): - Undefine macros before function definition. - -Sat Jul 22 01:10:02 1995 Ulrich Drepper - - * libgettext.h (_LIBINTL_H): - Protect definition in case where this file is included as - libgettext.h on Solaris machines. Add comment about this. - -Wed Jul 19 02:36:42 1995 Ulrich Drepper - - * intl-compat.c (textdomain): Correct typo. - -Wed Jul 19 01:51:35 1995 Ulrich Drepper - - * dcgettext.c (dcgettext): Function now called __dcgettext. - - * dgettext.c (dgettext): Now called __dgettext and calls - __dcgettext. - - * gettext.c (gettext): - Function now called __gettext and calls __dgettext. - - * textdomain.c (textdomain): Function now called __textdomain. - - * bindtextdom.c (bindtextdomain): Function now called - __bindtextdomain. - - * intl-compat.c: Initial revision. - - * Makefile.in (SOURCES): Add intl-compat.c. - (OBJECTS): We always compile the GNU gettext library functions. - OBJECTS contains all objects but cat-compat.o, ../po/cat-if-tbl.o, - and intl-compat.o. - (GETTOBJS): Contains now only intl-compat.o. - - * libgettext.h: - Re-include protection matches dualistic character of libgettext.h. - For all functions in GNU gettext library define __ counter part. - - * finddomain.c (strchr): Define as index if not found in C library. - (_nl_find_domain): For relative paths paste / in between. - -Tue Jul 18 16:37:45 1995 Ulrich Drepper - - * loadmsgcat.c, finddomain.c: Add inclusion of sys/types.h. - - * xopen-msg.sed: Fix bug with `msgstr ""' lines. - A little bit better comments. - -Tue Jul 18 01:18:27 1995 Ulrich Drepper - - * Makefile.in: - po-mode.el, makelinks, combine-sh are now found in ../misc. - - * po-mode.el, makelinks, combine-sh, elisp-comp: - Moved to ../misc/. - - * libgettext.h, gettextP.h, gettext.h: Uniform test for __STDC__. - -Sun Jul 16 22:33:02 1995 Ulrich Drepper - - * Makefile.in (INSTALL, INSTALL_DATA): New variables. - (install-data, uninstall): Install/uninstall .elc file. - - * po-mode.el (Installation comment): - Add .pox as possible extension of .po files. - -Sun Jul 16 13:23:27 1995 Ulrich Drepper - - * elisp-comp: Complete new version by Franc,ois: This does not - fail when not compiling in the source directory. - -Sun Jul 16 00:12:17 1995 Ulrich Drepper - - * Makefile.in (../po/cat-id-tbl.o): - Use $(MAKE) instead of make for recursive make. - - * Makefile.in (.el.elc): Use $(SHELL) instead of /bin/sh. - (install-exec): Add missing dummy goal. - (install-data, uninstall): @ in multi-line shell command at - beginning, not in front of echo. Reported by Eric Backus. - -Sat Jul 15 00:21:28 1995 Ulrich Drepper - - * Makefile.in (DISTFILES): - Rename libgettext.perl to gettext.perl to fit in 14 chars - file systems. - - * gettext.perl: - Rename to gettext.perl to fit in 14 chars file systems. - -Thu Jul 13 23:17:20 1995 Ulrich Drepper - - * cat-compat.c: If !STDC_HEADERS try to include malloc.h. - -Thu Jul 13 20:55:02 1995 Ulrich Drepper - - * po2tbl.sed.in: Pretty printing. - - * linux-msg.sed, xopen-msg.sed: - Correct bugs with handling substitute flags in branches. - - * hash-string.h (hash_string): - Old K&R compilers don't under stand `unsigned char'. - - * gettext.h (nls_uint32): - Some old K&R compilers (eg HP) don't understand `unsigned int'. - - * cat-compat.c (msg_to_cat_id): De-ANSI-fy prototypes. - -Thu Jul 13 01:34:33 1995 Ulrich Drepper - - * Makefile.in (ELCFILES): New variable. - (DISTFILES): Add elisp-comp. - Add implicit rule for .el -> .elc compilation. - (install-data): install $ELCFILES - (clean): renamed po-to-tbl and po-to-msg to po2tbl and po2msg resp. - - * elisp-comp: Initial revision - -Wed Jul 12 16:14:52 1995 Ulrich Drepper - - * Makefile.in: - cat-id-tbl.c is now found in po/. This enables us to use an identical - intl/ directory in all packages. - - * dcgettext.c (dcgettext): hashing does not work for table size <= 2. - - * textdomain.c: fix typo (#if def -> #if defined) - -Tue Jul 11 18:44:43 1995 Ulrich Drepper - - * Makefile.in (stamp-cat-id): use top_srcdir to address source files - (DISTFILES,distclean): move tupdate.perl to src/ - - * po-to-tbl.sed.in: - add additional jump to clear change flag to recognize multiline strings - -Tue Jul 11 01:32:50 1995 Ulrich Drepper - - * textdomain.c: Protect inclusion of stdlib.h and string.h. - - * loadmsgcat.c: Protect inclusion of stdlib.h. - - * libgettext.h: Protect inclusion of locale.h. - Allow use in C++ programs. - Define NULL is not happened already. - - * Makefile.in (DISTFILES): ship po-to-tbl.sed.in instead of - po-to-tbl.sed. - (distclean): remove po-to-tbl.sed and tupdate.perl. - - * tupdate.perl.in: Substitute Perl path even in exec line. - Don't include entries without translation from old .po file. - -Tue Jul 4 00:41:51 1995 Ulrich Drepper - - * tupdate.perl.in: use "Updated: " in msgid "". - - * cat-compat.c: Fix typo (LOCALDIR -> LOCALEDIR). - Define getenv if !__STDC__. - - * bindtextdom.c: Protect stdlib.h and string.h inclusion. - Define free if !__STDC__. - - * finddomain.c: Change DEF_MSG_DOM_DIR to LOCALEDIR. - Define free if !__STDC__. - - * cat-compat.c: Change DEF_MSG_DOM_DIR to LOCALEDIR. - -Mon Jul 3 23:56:30 1995 Ulrich Drepper - - * Makefile.in: Use LOCALEDIR instead of DEF_MSG_DOM_DIR. - Remove unneeded $(srcdir) from Makefile.in dependency. - - * makelinks: Add copyright and short description. - - * po-mode.el: Last version for 0.7. - - * tupdate.perl.in: Fix die message. - - * dcgettext.c: Protect include of string.h. - - * gettext.c: Protect include of stdlib.h and further tries to get NULL. - - * finddomain.c: Some corrections in includes. - - * Makefile.in (INCLUDES): Prune list correct path to Makefile.in. - - * po-to-tbl.sed: Adopt for new .po file format. - - * linux-msg.sed, xopen-msg.sed: Adopt for new .po file format. - -Sun Jul 2 23:55:03 1995 Ulrich Drepper - - * tupdate.perl.in: Complete rewrite for new .po file format. - -Sun Jul 2 02:06:50 1995 Ulrich Drepper - - * First official release. This directory contains all the code - needed to internationalize own packages. It provides functions - which allow to use the X/Open catgets function with an interface - like the Uniforum gettext function. For system which does not - have neither of those a complete implementation is provided. diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/Makefile b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/Makefile deleted file mode 100644 index 37585e769e..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/Makefile +++ /dev/null @@ -1,214 +0,0 @@ -# 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: diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/Makefile.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/Makefile.in deleted file mode 100644 index fc1e9e3ff1..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/Makefile.in +++ /dev/null @@ -1,214 +0,0 @@ -# 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 = @PACKAGE@ -VERSION = @VERSION@ - -SHELL = /bin/sh - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = .. -VPATH = @srcdir@ - -prefix = @prefix@ -exec_prefix = @exec_prefix@ -transform = @program_transform_name@ -libdir = $(exec_prefix)/lib -includedir = $(prefix)/include -datadir = $(prefix)/@DATADIRNAME@ -localedir = $(datadir)/locale -gnulocaledir = $(prefix)/share/locale -gettextsrcdir = @datadir@/gettext/intl -aliaspath = $(localedir):. -subdir = intl - -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -MKINSTALLDIRS = @MKINSTALLDIRS@ - -l = @l@ - -AR = ar -CC = @CC@ -LIBTOOL = @LIBTOOL@ -RANLIB = @RANLIB@ - -DEFS = -DGNULOCALEDIR=\"$(gnulocaledir)\" \ --DLOCALE_ALIAS_PATH=\"$(aliaspath)\" @DEFS@ -CPPFLAGS = @CPPFLAGS@ -CFLAGS = @CFLAGS@ -LDFLAGS = @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 = @INTLOBJS@ 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-@USE_INCLUDED_LIBINTL@ - -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 '@INTLOBJS@' = '$(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: diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/VERSION b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/VERSION deleted file mode 100644 index ee66b0612b..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/VERSION +++ /dev/null @@ -1 +0,0 @@ -GNU gettext library from gettext-0.10.35 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/bindtextdom.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/bindtextdom.c deleted file mode 100644 index 42b11aaddb..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/bindtextdom.c +++ /dev/null @@ -1,203 +0,0 @@ -/* Implementation of the bindtextdomain(3) function - Copyright (C) 1995, 1996, 1997, 1998 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. */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#if defined STDC_HEADERS || defined _LIBC -# include -#else -# ifdef HAVE_MALLOC_H -# include -# else -void free (); -# endif -#endif - -#if defined HAVE_STRING_H || defined _LIBC -# include -#else -# include -# ifndef memcpy -# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) -# endif -#endif - -#ifdef _LIBC -# include -#else -# include "libgettext.h" -#endif -#include "gettext.h" -#include "gettextP.h" - -/* @@ end of prolog @@ */ - -/* Contains the default location of the message catalogs. */ -extern const char _nl_default_dirname[]; - -/* List with bindings of specific domains. */ -extern struct binding *_nl_domain_bindings; - - -/* Names for the libintl functions are a problem. They must not clash - with existing names and they should follow ANSI C. But this source - code is also used in GNU C Library where the names have a __ - prefix. So we have to make a difference here. */ -#ifdef _LIBC -# define BINDTEXTDOMAIN __bindtextdomain -# ifndef strdup -# define strdup(str) __strdup (str) -# endif -#else -# define BINDTEXTDOMAIN bindtextdomain__ -#endif - -/* Specify that the DOMAINNAME message catalog will be found - in DIRNAME rather than in the system locale data base. */ -char * -BINDTEXTDOMAIN (domainname, dirname) - const char *domainname; - const char *dirname; -{ - struct binding *binding; - - /* Some sanity checks. */ - if (domainname == NULL || domainname[0] == '\0') - return NULL; - - for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) - { - int compare = strcmp (domainname, binding->domainname); - if (compare == 0) - /* We found it! */ - break; - if (compare < 0) - { - /* It is not in the list. */ - binding = NULL; - break; - } - } - - if (dirname == NULL) - /* The current binding has be to returned. */ - return binding == NULL ? (char *) _nl_default_dirname : binding->dirname; - - if (binding != NULL) - { - /* The domain is already bound. If the new value and the old - one are equal we simply do nothing. Otherwise replace the - old binding. */ - if (strcmp (dirname, binding->dirname) != 0) - { - char *new_dirname; - - if (strcmp (dirname, _nl_default_dirname) == 0) - new_dirname = (char *) _nl_default_dirname; - else - { -#if defined _LIBC || defined HAVE_STRDUP - new_dirname = strdup (dirname); - if (new_dirname == NULL) - return NULL; -#else - size_t len = strlen (dirname) + 1; - new_dirname = (char *) malloc (len); - if (new_dirname == NULL) - return NULL; - - memcpy (new_dirname, dirname, len); -#endif - } - - if (binding->dirname != _nl_default_dirname) - free (binding->dirname); - - binding->dirname = new_dirname; - } - } - else - { - /* We have to create a new binding. */ -#if !defined _LIBC && !defined HAVE_STRDUP - size_t len; -#endif - struct binding *new_binding = - (struct binding *) malloc (sizeof (*new_binding)); - - if (new_binding == NULL) - return NULL; - -#if defined _LIBC || defined HAVE_STRDUP - new_binding->domainname = strdup (domainname); - if (new_binding->domainname == NULL) - return NULL; -#else - len = strlen (domainname) + 1; - new_binding->domainname = (char *) malloc (len); - if (new_binding->domainname == NULL) - return NULL; - memcpy (new_binding->domainname, domainname, len); -#endif - - if (strcmp (dirname, _nl_default_dirname) == 0) - new_binding->dirname = (char *) _nl_default_dirname; - else - { -#if defined _LIBC || defined HAVE_STRDUP - new_binding->dirname = strdup (dirname); - if (new_binding->dirname == NULL) - return NULL; -#else - len = strlen (dirname) + 1; - new_binding->dirname = (char *) malloc (len); - if (new_binding->dirname == NULL) - return NULL; - memcpy (new_binding->dirname, dirname, len); -#endif - } - - /* Now enqueue it. */ - if (_nl_domain_bindings == NULL - || strcmp (domainname, _nl_domain_bindings->domainname) < 0) - { - new_binding->next = _nl_domain_bindings; - _nl_domain_bindings = new_binding; - } - else - { - binding = _nl_domain_bindings; - while (binding->next != NULL - && strcmp (domainname, binding->next->domainname) > 0) - binding = binding->next; - - new_binding->next = binding->next; - binding->next = new_binding; - } - - binding = new_binding; - } - - return binding->dirname; -} - -#ifdef _LIBC -/* Alias for function name in GNU C Library. */ -weak_alias (__bindtextdomain, bindtextdomain); -#endif diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/cat-compat.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/cat-compat.c deleted file mode 100644 index 4eb0e068f1..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/cat-compat.c +++ /dev/null @@ -1,262 +0,0 @@ -/* Compatibility code for gettext-using-catgets interface. - Copyright (C) 1995, 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. */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#ifdef STDC_HEADERS -# include -# include -#else -char *getenv (); -# ifdef HAVE_MALLOC_H -# include -# endif -#endif - -#ifdef HAVE_NL_TYPES_H -# include -#endif - -#include "libgettext.h" - -/* @@ end of prolog @@ */ - -/* XPG3 defines the result of `setlocale (category, NULL)' as: - ``Directs `setlocale()' to query `category' and return the current - setting of `local'.'' - However it does not specify the exact format. And even worse: POSIX - defines this not at all. So we can use this feature only on selected - system (e.g. those using GNU C Library). */ -#ifdef _LIBC -# define HAVE_LOCALE_NULL -#endif - -/* The catalog descriptor. */ -static nl_catd catalog = (nl_catd) -1; - -/* Name of the default catalog. */ -static const char default_catalog_name[] = "messages"; - -/* Name of currently used catalog. */ -static const char *catalog_name = default_catalog_name; - -/* Get ID for given string. If not found return -1. */ -static int msg_to_cat_id PARAMS ((const char *msg)); - -/* Substitution for systems lacking this function in their C library. */ -#if !_LIBC && !HAVE_STPCPY -static char *stpcpy PARAMS ((char *dest, const char *src)); -#endif - - -/* Set currently used domain/catalog. */ -char * -textdomain (domainname) - const char *domainname; -{ - nl_catd new_catalog; - char *new_name; - size_t new_name_len; - char *lang; - -#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES \ - && defined HAVE_LOCALE_NULL - lang = setlocale (LC_MESSAGES, NULL); -#else - lang = getenv ("LC_ALL"); - if (lang == NULL || lang[0] == '\0') - { - lang = getenv ("LC_MESSAGES"); - if (lang == NULL || lang[0] == '\0') - lang = getenv ("LANG"); - } -#endif - if (lang == NULL || lang[0] == '\0') - lang = "C"; - - /* See whether name of currently used domain is asked. */ - if (domainname == NULL) - return (char *) catalog_name; - - if (domainname[0] == '\0') - domainname = default_catalog_name; - - /* Compute length of added path element. */ - new_name_len = sizeof (LOCALEDIR) - 1 + 1 + strlen (lang) - + sizeof ("/LC_MESSAGES/") - 1 + sizeof (PACKAGE) - 1 - + sizeof (".cat"); - - new_name = (char *) malloc (new_name_len); - if (new_name == NULL) - return NULL; - - strcpy (new_name, PACKAGE); - new_catalog = catopen (new_name, 0); - - if (new_catalog == (nl_catd) -1) - { - /* NLSPATH search didn't work, try absolute path */ - sprintf (new_name, "%s/%s/LC_MESSAGES/%s.cat", LOCALEDIR, lang, - PACKAGE); - new_catalog = catopen (new_name, 0); - - if (new_catalog == (nl_catd) -1) - { - free (new_name); - return (char *) catalog_name; - } - } - - /* Close old catalog. */ - if (catalog != (nl_catd) -1) - catclose (catalog); - if (catalog_name != default_catalog_name) - free ((char *) catalog_name); - - catalog = new_catalog; - catalog_name = new_name; - - return (char *) catalog_name; -} - -char * -bindtextdomain (domainname, dirname) - const char *domainname; - const char *dirname; -{ -#if HAVE_SETENV || HAVE_PUTENV - char *old_val, *new_val, *cp; - size_t new_val_len; - - /* This does not make much sense here but to be compatible do it. */ - if (domainname == NULL) - return NULL; - - /* Compute length of added path element. If we use setenv we don't need - the first byts for NLSPATH=, but why complicate the code for this - peanuts. */ - new_val_len = sizeof ("NLSPATH=") - 1 + strlen (dirname) - + sizeof ("/%L/LC_MESSAGES/%N.cat"); - - old_val = getenv ("NLSPATH"); - if (old_val == NULL || old_val[0] == '\0') - { - old_val = NULL; - new_val_len += 1 + sizeof (LOCALEDIR) - 1 - + sizeof ("/%L/LC_MESSAGES/%N.cat"); - } - else - new_val_len += strlen (old_val); - - new_val = (char *) malloc (new_val_len); - if (new_val == NULL) - return NULL; - -# if HAVE_SETENV - cp = new_val; -# else - cp = stpcpy (new_val, "NLSPATH="); -# endif - - cp = stpcpy (cp, dirname); - cp = stpcpy (cp, "/%L/LC_MESSAGES/%N.cat:"); - - if (old_val == NULL) - { -# if __STDC__ - stpcpy (cp, LOCALEDIR "/%L/LC_MESSAGES/%N.cat"); -# else - - cp = stpcpy (cp, LOCALEDIR); - stpcpy (cp, "/%L/LC_MESSAGES/%N.cat"); -# endif - } - else - stpcpy (cp, old_val); - -# if HAVE_SETENV - setenv ("NLSPATH", new_val, 1); - free (new_val); -# else - putenv (new_val); - /* Do *not* free the environment entry we just entered. It is used - from now on. */ -# endif - -#endif - - return (char *) domainname; -} - -#undef gettext -char * -gettext (msg) - const char *msg; -{ - int msgid; - - if (msg == NULL || catalog == (nl_catd) -1) - return (char *) msg; - - /* Get the message from the catalog. We always use set number 1. - The message ID is computed by the function `msg_to_cat_id' - which works on the table generated by `po-to-tbl'. */ - msgid = msg_to_cat_id (msg); - if (msgid == -1) - return (char *) msg; - - return catgets (catalog, 1, msgid, (char *) msg); -} - -/* Look through the table `_msg_tbl' which has `_msg_tbl_length' entries - for the one equal to msg. If it is found return the ID. In case when - the string is not found return -1. */ -static int -msg_to_cat_id (msg) - const char *msg; -{ - int cnt; - - for (cnt = 0; cnt < _msg_tbl_length; ++cnt) - if (strcmp (msg, _msg_tbl[cnt]._msg) == 0) - return _msg_tbl[cnt]._msg_number; - - return -1; -} - - -/* @@ begin of epilog @@ */ - -/* We don't want libintl.a to depend on any other library. So we - avoid the non-standard function stpcpy. In GNU C Library this - function is available, though. Also allow the symbol HAVE_STPCPY - to be defined. */ -#if !_LIBC && !HAVE_STPCPY -static char * -stpcpy (dest, src) - char *dest; - const char *src; -{ - while ((*dest++ = *src++) != '\0') - /* Do nothing. */ ; - return dest - 1; -} -#endif diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/dcgettext.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/dcgettext.c deleted file mode 100644 index ed697f371b..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/dcgettext.c +++ /dev/null @@ -1,624 +0,0 @@ -/* Implementation of the dcgettext(3) function. - Copyright (C) 1995, 1996, 1997, 1998 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. */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#ifdef __GNUC__ -# define alloca __builtin_alloca -# define HAVE_ALLOCA 1 -#else -# if defined HAVE_ALLOCA_H || defined _LIBC -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca -char *alloca (); -# endif -# endif -# endif -#endif - -#include -#ifndef errno -extern int errno; -#endif -#ifndef __set_errno -# define __set_errno(val) errno = (val) -#endif - -#if defined STDC_HEADERS || defined _LIBC -# include -#else -char *getenv (); -# ifdef HAVE_MALLOC_H -# include -# else -void free (); -# endif -#endif - -#if defined HAVE_STRING_H || defined _LIBC -# ifndef _GNU_SOURCE -# define _GNU_SOURCE 1 -# endif -# include -#else -# include -#endif -#if !HAVE_STRCHR && !defined _LIBC -# ifndef strchr -# define strchr index -# endif -#endif - -#if defined HAVE_UNISTD_H || defined _LIBC -# include -#endif - -#include "gettext.h" -#include "gettextP.h" -#ifdef _LIBC -# include -#else -# include "libgettext.h" -#endif -#include "hash-string.h" - -/* @@ end of prolog @@ */ - -#ifdef _LIBC -/* Rename the non ANSI C functions. This is required by the standard - because some ANSI C functions will require linking with this object - file and the name space must not be polluted. */ -# define getcwd __getcwd -# ifndef stpcpy -# define stpcpy __stpcpy -# endif -#else -# if !defined HAVE_GETCWD -char *getwd (); -# define getcwd(buf, max) getwd (buf) -# else -char *getcwd (); -# endif -# ifndef HAVE_STPCPY -static char *stpcpy PARAMS ((char *dest, const char *src)); -# endif -#endif - -/* Amount to increase buffer size by in each try. */ -#define PATH_INCR 32 - -/* The following is from pathmax.h. */ -/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define - PATH_MAX but might cause redefinition warnings when sys/param.h is - later included (as on MORE/BSD 4.3). */ -#if defined(_POSIX_VERSION) || (defined(HAVE_LIMITS_H) && !defined(__GNUC__)) -# include -#endif - -#ifndef _POSIX_PATH_MAX -# define _POSIX_PATH_MAX 255 -#endif - -#if !defined(PATH_MAX) && defined(_PC_PATH_MAX) -# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX)) -#endif - -/* Don't include sys/param.h if it already has been. */ -#if defined(HAVE_SYS_PARAM_H) && !defined(PATH_MAX) && !defined(MAXPATHLEN) -# include -#endif - -#if !defined(PATH_MAX) && defined(MAXPATHLEN) -# define PATH_MAX MAXPATHLEN -#endif - -#ifndef PATH_MAX -# define PATH_MAX _POSIX_PATH_MAX -#endif - -/* XPG3 defines the result of `setlocale (category, NULL)' as: - ``Directs `setlocale()' to query `category' and return the current - setting of `local'.'' - However it does not specify the exact format. And even worse: POSIX - defines this not at all. So we can use this feature only on selected - system (e.g. those using GNU C Library). */ -#ifdef _LIBC -# define HAVE_LOCALE_NULL -#endif - -/* Name of the default domain used for gettext(3) prior any call to - textdomain(3). The default value for this is "messages". */ -const char _nl_default_default_domain[] = "messages"; - -/* Value used as the default domain for gettext(3). */ -const char *_nl_current_default_domain = _nl_default_default_domain; - -/* Contains the default location of the message catalogs. */ -const char _nl_default_dirname[] = GNULOCALEDIR; - -/* List with bindings of specific domains created by bindtextdomain() - calls. */ -struct binding *_nl_domain_bindings; - -/* Prototypes for local functions. */ -static char *find_msg PARAMS ((struct loaded_l10nfile *domain_file, - const char *msgid)) internal_function; -static const char *category_to_name PARAMS ((int category)) internal_function; -static const char *guess_category_value PARAMS ((int category, - const char *categoryname)) - internal_function; - - -/* For those loosing systems which don't have `alloca' we have to add - some additional code emulating it. */ -#ifdef HAVE_ALLOCA -/* Nothing has to be done. */ -# define ADD_BLOCK(list, address) /* nothing */ -# define FREE_BLOCKS(list) /* nothing */ -#else -struct block_list -{ - void *address; - struct block_list *next; -}; -# define ADD_BLOCK(list, addr) \ - do { \ - struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \ - /* If we cannot get a free block we cannot add the new element to \ - the list. */ \ - if (newp != NULL) { \ - newp->address = (addr); \ - newp->next = (list); \ - (list) = newp; \ - } \ - } while (0) -# define FREE_BLOCKS(list) \ - do { \ - while (list != NULL) { \ - struct block_list *old = list; \ - list = list->next; \ - free (old); \ - } \ - } while (0) -# undef alloca -# define alloca(size) (malloc (size)) -#endif /* have alloca */ - - -/* Names for the libintl functions are a problem. They must not clash - with existing names and they should follow ANSI C. But this source - code is also used in GNU C Library where the names have a __ - prefix. So we have to make a difference here. */ -#ifdef _LIBC -# define DCGETTEXT __dcgettext -#else -# define DCGETTEXT dcgettext__ -#endif - -/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY - locale. */ -char * -DCGETTEXT (domainname, msgid, category) - const char *domainname; - const char *msgid; - int category; -{ -#ifndef HAVE_ALLOCA - struct block_list *block_list = NULL; -#endif - struct loaded_l10nfile *domain; - struct binding *binding; - const char *categoryname; - const char *categoryvalue; - char *dirname, *xdomainname; - char *single_locale; - char *retval; - int saved_errno = errno; - - /* If no real MSGID is given return NULL. */ - if (msgid == NULL) - return NULL; - - /* If DOMAINNAME is NULL, we are interested in the default domain. If - CATEGORY is not LC_MESSAGES this might not make much sense but the - defintion left this undefined. */ - if (domainname == NULL) - domainname = _nl_current_default_domain; - - /* First find matching binding. */ - for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) - { - int compare = strcmp (domainname, binding->domainname); - if (compare == 0) - /* We found it! */ - break; - if (compare < 0) - { - /* It is not in the list. */ - binding = NULL; - break; - } - } - - if (binding == NULL) - dirname = (char *) _nl_default_dirname; - else if (binding->dirname[0] == '/') - dirname = binding->dirname; - else - { - /* We have a relative path. Make it absolute now. */ - size_t dirname_len = strlen (binding->dirname) + 1; - size_t path_max; - char *ret; - - path_max = (unsigned) PATH_MAX; - path_max += 2; /* The getcwd docs say to do this. */ - - dirname = (char *) alloca (path_max + dirname_len); - ADD_BLOCK (block_list, dirname); - - __set_errno (0); - while ((ret = getcwd (dirname, path_max)) == NULL && errno == ERANGE) - { - path_max += PATH_INCR; - dirname = (char *) alloca (path_max + dirname_len); - ADD_BLOCK (block_list, dirname); - __set_errno (0); - } - - if (ret == NULL) - { - /* We cannot get the current working directory. Don't signal an - error but simply return the default string. */ - FREE_BLOCKS (block_list); - __set_errno (saved_errno); - return (char *) msgid; - } - - stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname); - } - - /* Now determine the symbolic name of CATEGORY and its value. */ - categoryname = category_to_name (category); - categoryvalue = guess_category_value (category, categoryname); - - xdomainname = (char *) alloca (strlen (categoryname) - + strlen (domainname) + 5); - ADD_BLOCK (block_list, xdomainname); - - stpcpy (stpcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"), - domainname), - ".mo"); - - /* Creating working area. */ - single_locale = (char *) alloca (strlen (categoryvalue) + 1); - ADD_BLOCK (block_list, single_locale); - - - /* Search for the given string. This is a loop because we perhaps - got an ordered list of languages to consider for th translation. */ - while (1) - { - /* Make CATEGORYVALUE point to the next element of the list. */ - while (categoryvalue[0] != '\0' && categoryvalue[0] == ':') - ++categoryvalue; - if (categoryvalue[0] == '\0') - { - /* The whole contents of CATEGORYVALUE has been searched but - no valid entry has been found. We solve this situation - by implicitly appending a "C" entry, i.e. no translation - will take place. */ - single_locale[0] = 'C'; - single_locale[1] = '\0'; - } - else - { - char *cp = single_locale; - while (categoryvalue[0] != '\0' && categoryvalue[0] != ':') - *cp++ = *categoryvalue++; - *cp = '\0'; - } - - /* If the current locale value is C (or POSIX) we don't load a - domain. Return the MSGID. */ - if (strcmp (single_locale, "C") == 0 - || strcmp (single_locale, "POSIX") == 0) - { - FREE_BLOCKS (block_list); - __set_errno (saved_errno); - return (char *) msgid; - } - - - /* Find structure describing the message catalog matching the - DOMAINNAME and CATEGORY. */ - domain = _nl_find_domain (dirname, single_locale, xdomainname); - - if (domain != NULL) - { - retval = find_msg (domain, msgid); - - if (retval == NULL) - { - int cnt; - - for (cnt = 0; domain->successor[cnt] != NULL; ++cnt) - { - retval = find_msg (domain->successor[cnt], msgid); - - if (retval != NULL) - break; - } - } - - if (retval != NULL) - { - FREE_BLOCKS (block_list); - __set_errno (saved_errno); - return retval; - } - } - } - /* NOTREACHED */ -} - -#ifdef _LIBC -/* Alias for function name in GNU C Library. */ -weak_alias (__dcgettext, dcgettext); -#endif - - -static char * -internal_function -find_msg (domain_file, msgid) - struct loaded_l10nfile *domain_file; - const char *msgid; -{ - size_t top, act, bottom; - struct loaded_domain *domain; - - if (domain_file->decided == 0) - _nl_load_domain (domain_file); - - if (domain_file->data == NULL) - return NULL; - - domain = (struct loaded_domain *) domain_file->data; - - /* Locate the MSGID and its translation. */ - if (domain->hash_size > 2 && domain->hash_tab != NULL) - { - /* Use the hashing table. */ - nls_uint32 len = strlen (msgid); - nls_uint32 hash_val = hash_string (msgid); - nls_uint32 idx = hash_val % domain->hash_size; - nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2)); - nls_uint32 nstr = W (domain->must_swap, domain->hash_tab[idx]); - - if (nstr == 0) - /* Hash table entry is empty. */ - return NULL; - - if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len - && strcmp (msgid, - domain->data + W (domain->must_swap, - domain->orig_tab[nstr - 1].offset)) == 0) - return (char *) domain->data + W (domain->must_swap, - domain->trans_tab[nstr - 1].offset); - - while (1) - { - if (idx >= domain->hash_size - incr) - idx -= domain->hash_size - incr; - else - idx += incr; - - nstr = W (domain->must_swap, domain->hash_tab[idx]); - if (nstr == 0) - /* Hash table entry is empty. */ - return NULL; - - if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len - && strcmp (msgid, - domain->data + W (domain->must_swap, - domain->orig_tab[nstr - 1].offset)) - == 0) - return (char *) domain->data - + W (domain->must_swap, domain->trans_tab[nstr - 1].offset); - } - /* NOTREACHED */ - } - - /* Now we try the default method: binary search in the sorted - array of messages. */ - bottom = 0; - top = domain->nstrings; - while (bottom < top) - { - int cmp_val; - - act = (bottom + top) / 2; - cmp_val = strcmp (msgid, domain->data - + W (domain->must_swap, - domain->orig_tab[act].offset)); - if (cmp_val < 0) - top = act; - else if (cmp_val > 0) - bottom = act + 1; - else - break; - } - - /* If an translation is found return this. */ - return bottom >= top ? NULL : (char *) domain->data - + W (domain->must_swap, - domain->trans_tab[act].offset); -} - - -/* Return string representation of locale CATEGORY. */ -static const char * -internal_function -category_to_name (category) - int category; -{ - const char *retval; - - switch (category) - { -#ifdef LC_COLLATE - case LC_COLLATE: - retval = "LC_COLLATE"; - break; -#endif -#ifdef LC_CTYPE - case LC_CTYPE: - retval = "LC_CTYPE"; - break; -#endif -#ifdef LC_MONETARY - case LC_MONETARY: - retval = "LC_MONETARY"; - break; -#endif -#ifdef LC_NUMERIC - case LC_NUMERIC: - retval = "LC_NUMERIC"; - break; -#endif -#ifdef LC_TIME - case LC_TIME: - retval = "LC_TIME"; - break; -#endif -#ifdef LC_MESSAGES - case LC_MESSAGES: - retval = "LC_MESSAGES"; - break; -#endif -#ifdef LC_RESPONSE - case LC_RESPONSE: - retval = "LC_RESPONSE"; - break; -#endif -#ifdef LC_ALL - case LC_ALL: - /* This might not make sense but is perhaps better than any other - value. */ - retval = "LC_ALL"; - break; -#endif - default: - /* If you have a better idea for a default value let me know. */ - retval = "LC_XXX"; - } - - return retval; -} - -/* Guess value of current locale from value of the environment variables. */ -static const char * -internal_function -guess_category_value (category, categoryname) - int category; - const char *categoryname; -{ - const char *retval; - - /* The highest priority value is the `LANGUAGE' environment - variable. This is a GNU extension. */ - retval = getenv ("LANGUAGE"); - if (retval != NULL && retval[0] != '\0') - return retval; - - /* `LANGUAGE' is not set. So we have to proceed with the POSIX - methods of looking to `LC_ALL', `LC_xxx', and `LANG'. On some - systems this can be done by the `setlocale' function itself. */ -#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL - return setlocale (category, NULL); -#else - /* Setting of LC_ALL overwrites all other. */ - retval = getenv ("LC_ALL"); - if (retval != NULL && retval[0] != '\0') - return retval; - - /* Next comes the name of the desired category. */ - retval = getenv (categoryname); - if (retval != NULL && retval[0] != '\0') - return retval; - - /* Last possibility is the LANG environment variable. */ - retval = getenv ("LANG"); - if (retval != NULL && retval[0] != '\0') - return retval; - - /* We use C as the default domain. POSIX says this is implementation - defined. */ - return "C"; -#endif -} - -/* @@ begin of epilog @@ */ - -/* We don't want libintl.a to depend on any other library. So we - avoid the non-standard function stpcpy. In GNU C Library this - function is available, though. Also allow the symbol HAVE_STPCPY - to be defined. */ -#if !_LIBC && !HAVE_STPCPY -static char * -stpcpy (dest, src) - char *dest; - const char *src; -{ - while ((*dest++ = *src++) != '\0') - /* Do nothing. */ ; - return dest - 1; -} -#endif - - -#ifdef _LIBC -/* If we want to free all resources we have to do some work at - program's end. */ -static void __attribute__ ((unused)) -free_mem (void) -{ - struct binding *runp; - - for (runp = _nl_domain_bindings; runp != NULL; runp = runp->next) - { - free (runp->domainname); - if (runp->dirname != _nl_default_dirname) - /* Yes, this is a pointer comparison. */ - free (runp->dirname); - } - - if (_nl_current_default_domain != _nl_default_default_domain) - /* Yes, again a pointer comparison. */ - free ((char *) _nl_current_default_domain); -} - -text_set_element (__libc_subfreeres, free_mem); -#endif diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/dgettext.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/dgettext.c deleted file mode 100644 index 6525d83293..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/dgettext.c +++ /dev/null @@ -1,59 +0,0 @@ -/* Implementation of the dgettext(3) function - 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. */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#if defined HAVE_LOCALE_H || defined _LIBC -# include -#endif - -#ifdef _LIBC -# include -#else -# include "libgettext.h" -#endif - -/* @@ end of prolog @@ */ - -/* Names for the libintl functions are a problem. They must not clash - with existing names and they should follow ANSI C. But this source - code is also used in GNU C Library where the names have a __ - prefix. So we have to make a difference here. */ -#ifdef _LIBC -# define DGETTEXT __dgettext -# define DCGETTEXT __dcgettext -#else -# define DGETTEXT dgettext__ -# define DCGETTEXT dcgettext__ -#endif - -/* Look up MSGID in the DOMAINNAME message catalog of the current - LC_MESSAGES locale. */ -char * -DGETTEXT (domainname, msgid) - const char *domainname; - const char *msgid; -{ - return DCGETTEXT (domainname, msgid, LC_MESSAGES); -} - -#ifdef _LIBC -/* Alias for function name in GNU C Library. */ -weak_alias (__dgettext, dgettext); -#endif diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/explodename.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/explodename.c deleted file mode 100644 index b80aa79ae2..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/explodename.c +++ /dev/null @@ -1,188 +0,0 @@ -/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. - Contributed by Ulrich Drepper , 1995. - - 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. */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#if defined STDC_HEADERS || defined _LIBC -# include -#endif - -#if defined HAVE_STRING_H || defined _LIBC -# include -#else -# include -#endif -#include - -#include "loadinfo.h" - -/* On some strange systems still no definition of NULL is found. Sigh! */ -#ifndef NULL -# if defined __STDC__ && __STDC__ -# define NULL ((void *) 0) -# else -# define NULL 0 -# endif -#endif - -/* @@ end of prolog @@ */ - -int -_nl_explode_name (name, language, modifier, territory, codeset, - normalized_codeset, special, sponsor, revision) - char *name; - const char **language; - const char **modifier; - const char **territory; - const char **codeset; - const char **normalized_codeset; - const char **special; - const char **sponsor; - const char **revision; -{ - enum { undecided, xpg, cen } syntax; - char *cp; - int mask; - - *modifier = NULL; - *territory = NULL; - *codeset = NULL; - *normalized_codeset = NULL; - *special = NULL; - *sponsor = NULL; - *revision = NULL; - - /* Now we determine the single parts of the locale name. First - look for the language. Termination symbols are `_' and `@' if - we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */ - mask = 0; - syntax = undecided; - *language = cp = name; - while (cp[0] != '\0' && cp[0] != '_' && cp[0] != '@' - && cp[0] != '+' && cp[0] != ',') - ++cp; - - if (*language == cp) - /* This does not make sense: language has to be specified. Use - this entry as it is without exploding. Perhaps it is an alias. */ - cp = strchr (*language, '\0'); - else if (cp[0] == '_') - { - /* Next is the territory. */ - cp[0] = '\0'; - *territory = ++cp; - - while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@' - && cp[0] != '+' && cp[0] != ',' && cp[0] != '_') - ++cp; - - mask |= TERRITORY; - - if (cp[0] == '.') - { - /* Next is the codeset. */ - syntax = xpg; - cp[0] = '\0'; - *codeset = ++cp; - - while (cp[0] != '\0' && cp[0] != '@') - ++cp; - - mask |= XPG_CODESET; - - if (*codeset != cp && (*codeset)[0] != '\0') - { - *normalized_codeset = _nl_normalize_codeset (*codeset, - cp - *codeset); - if (strcmp (*codeset, *normalized_codeset) == 0) - free ((char *) *normalized_codeset); - else - mask |= XPG_NORM_CODESET; - } - } - } - - if (cp[0] == '@' || (syntax != xpg && cp[0] == '+')) - { - /* Next is the modifier. */ - syntax = cp[0] == '@' ? xpg : cen; - cp[0] = '\0'; - *modifier = ++cp; - - while (syntax == cen && cp[0] != '\0' && cp[0] != '+' - && cp[0] != ',' && cp[0] != '_') - ++cp; - - mask |= XPG_MODIFIER | CEN_AUDIENCE; - } - - if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_')) - { - syntax = cen; - - if (cp[0] == '+') - { - /* Next is special application (CEN syntax). */ - cp[0] = '\0'; - *special = ++cp; - - while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_') - ++cp; - - mask |= CEN_SPECIAL; - } - - if (cp[0] == ',') - { - /* Next is sponsor (CEN syntax). */ - cp[0] = '\0'; - *sponsor = ++cp; - - while (cp[0] != '\0' && cp[0] != '_') - ++cp; - - mask |= CEN_SPONSOR; - } - - if (cp[0] == '_') - { - /* Next is revision (CEN syntax). */ - cp[0] = '\0'; - *revision = ++cp; - - mask |= CEN_REVISION; - } - } - - /* For CEN syntax values it might be important to have the - separator character in the file name, not for XPG syntax. */ - if (syntax == xpg) - { - if (*territory != NULL && (*territory)[0] == '\0') - mask &= ~TERRITORY; - - if (*codeset != NULL && (*codeset)[0] == '\0') - mask &= ~XPG_CODESET; - - if (*modifier != NULL && (*modifier)[0] == '\0') - mask &= ~XPG_MODIFIER; - } - - return mask; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/finddomain.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/finddomain.c deleted file mode 100644 index 9588532f3d..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/finddomain.c +++ /dev/null @@ -1,216 +0,0 @@ -/* Handle list of needed message catalogs - Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. - Written by Ulrich Drepper , 1995. - - 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. */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#include - -#if defined STDC_HEADERS || defined _LIBC -# include -#else -# ifdef HAVE_MALLOC_H -# include -# else -void free (); -# endif -#endif - -#if defined HAVE_STRING_H || defined _LIBC -# include -#else -# include -# ifndef memcpy -# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) -# endif -#endif -#if !HAVE_STRCHR && !defined _LIBC -# ifndef strchr -# define strchr index -# endif -#endif - -#if defined HAVE_UNISTD_H || defined _LIBC -# include -#endif - -#include "gettext.h" -#include "gettextP.h" -#ifdef _LIBC -# include -#else -# include "libgettext.h" -#endif - -/* @@ end of prolog @@ */ -/* List of already loaded domains. */ -static struct loaded_l10nfile *_nl_loaded_domains; - - -/* Return a data structure describing the message catalog described by - the DOMAINNAME and CATEGORY parameters with respect to the currently - established bindings. */ -struct loaded_l10nfile * -internal_function -_nl_find_domain (dirname, locale, domainname) - const char *dirname; - char *locale; - const char *domainname; -{ - struct loaded_l10nfile *retval; - const char *language; - const char *modifier; - const char *territory; - const char *codeset; - const char *normalized_codeset; - const char *special; - const char *sponsor; - const char *revision; - const char *alias_value; - int mask; - - /* LOCALE can consist of up to four recognized parts for the XPG syntax: - - language[_territory[.codeset]][@modifier] - - and six parts for the CEN syntax: - - language[_territory][+audience][+special][,[sponsor][_revision]] - - Beside the first part all of them are allowed to be missing. If - the full specified locale is not found, the less specific one are - looked for. The various parts will be stripped off according to - the following order: - (1) revision - (2) sponsor - (3) special - (4) codeset - (5) normalized codeset - (6) territory - (7) audience/modifier - */ - - /* If we have already tested for this locale entry there has to - be one data set in the list of loaded domains. */ - retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, - strlen (dirname) + 1, 0, locale, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, domainname, 0); - if (retval != NULL) - { - /* We know something about this locale. */ - int cnt; - - if (retval->decided == 0) - _nl_load_domain (retval); - - if (retval->data != NULL) - return retval; - - for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) - { - if (retval->successor[cnt]->decided == 0) - _nl_load_domain (retval->successor[cnt]); - - if (retval->successor[cnt]->data != NULL) - break; - } - return cnt >= 0 ? retval : NULL; - /* NOTREACHED */ - } - - /* See whether the locale value is an alias. If yes its value - *overwrites* the alias name. No test for the original value is - done. */ - alias_value = _nl_expand_alias (locale); - if (alias_value != NULL) - { -#if defined _LIBC || defined HAVE_STRDUP - locale = strdup (alias_value); - if (locale == NULL) - return NULL; -#else - size_t len = strlen (alias_value) + 1; - locale = (char *) malloc (len); - if (locale == NULL) - return NULL; - - memcpy (locale, alias_value, len); -#endif - } - - /* Now we determine the single parts of the locale name. First - look for the language. Termination symbols are `_' and `@' if - we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */ - mask = _nl_explode_name (locale, &language, &modifier, &territory, - &codeset, &normalized_codeset, &special, - &sponsor, &revision); - - /* Create all possible locale entries which might be interested in - generalization. */ - retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, - strlen (dirname) + 1, mask, language, territory, - codeset, normalized_codeset, modifier, special, - sponsor, revision, domainname, 1); - if (retval == NULL) - /* This means we are out of core. */ - return NULL; - - if (retval->decided == 0) - _nl_load_domain (retval); - if (retval->data == NULL) - { - int cnt; - for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) - { - if (retval->successor[cnt]->decided == 0) - _nl_load_domain (retval->successor[cnt]); - if (retval->successor[cnt]->data != NULL) - break; - } - } - - /* The room for an alias was dynamically allocated. Free it now. */ - if (alias_value != NULL) - free (locale); - - return retval; -} - - -#ifdef _LIBC -static void __attribute__ ((unused)) -free_mem (void) -{ - struct loaded_l10nfile *runp = _nl_loaded_domains; - - while (runp != NULL) - { - struct loaded_l10nfile *here = runp; - if (runp->data != NULL) - _nl_unload_domain ((struct loaded_domain *) runp->data); - runp = runp->next; - free (here); - } -} - -text_set_element (__libc_subfreeres, free_mem); -#endif diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/gettext.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/gettext.c deleted file mode 100644 index c3c64bf8c5..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/gettext.c +++ /dev/null @@ -1,70 +0,0 @@ -/* Implementation of gettext(3) function. - Copyright (C) 1995, 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. */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#ifdef _LIBC -# define __need_NULL -# include -#else -# ifdef STDC_HEADERS -# include /* Just for NULL. */ -# else -# ifdef HAVE_STRING_H -# include -# else -# define NULL ((void *) 0) -# endif -# endif -#endif - -#ifdef _LIBC -# include -#else -# include "libgettext.h" -#endif - -/* @@ end of prolog @@ */ - -/* Names for the libintl functions are a problem. They must not clash - with existing names and they should follow ANSI C. But this source - code is also used in GNU C Library where the names have a __ - prefix. So we have to make a difference here. */ -#ifdef _LIBC -# define GETTEXT __gettext -# define DGETTEXT __dgettext -#else -# define GETTEXT gettext__ -# define DGETTEXT dgettext__ -#endif - -/* Look up MSGID in the current default message catalog for the current - LC_MESSAGES locale. If not found, returns MSGID itself (the default - text). */ -char * -GETTEXT (msgid) - const char *msgid; -{ - return DGETTEXT (NULL, msgid); -} - -#ifdef _LIBC -/* Alias for function name in GNU C Library. */ -weak_alias (__gettext, gettext); -#endif diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/gettext.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/gettext.h deleted file mode 100644 index 3cd23d7d6a..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/gettext.h +++ /dev/null @@ -1,105 +0,0 @@ -/* Internal header for GNU gettext internationalization functions. - Copyright (C) 1995, 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 Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _GETTEXT_H -#define _GETTEXT_H 1 - -#include - -#if HAVE_LIMITS_H || _LIBC -# include -#endif - -/* @@ end of prolog @@ */ - -/* The magic number of the GNU message catalog format. */ -#define _MAGIC 0x950412de -#define _MAGIC_SWAPPED 0xde120495 - -/* Revision number of the currently used .mo (binary) file format. */ -#define MO_REVISION_NUMBER 0 - -/* The following contortions are an attempt to use the C preprocessor - to determine an unsigned integral type that is 32 bits wide. An - alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but - doing that would require that the configure script compile and *run* - the resulting executable. Locally running cross-compiled executables - is usually not possible. */ - -#if __STDC__ -# define UINT_MAX_32_BITS 4294967295U -#else -# define UINT_MAX_32_BITS 0xFFFFFFFF -#endif - -/* If UINT_MAX isn't defined, assume it's a 32-bit type. - This should be valid for all systems GNU cares about because - that doesn't include 16-bit systems, and only modern systems - (that certainly have ) have 64+-bit integral types. */ - -#ifndef UINT_MAX -# define UINT_MAX UINT_MAX_32_BITS -#endif - -#if UINT_MAX == UINT_MAX_32_BITS -typedef unsigned nls_uint32; -#else -# if USHRT_MAX == UINT_MAX_32_BITS -typedef unsigned short nls_uint32; -# else -# if ULONG_MAX == UINT_MAX_32_BITS -typedef unsigned long nls_uint32; -# else - /* The following line is intended to throw an error. Using #error is - not portable enough. */ - "Cannot determine unsigned 32-bit data type." -# endif -# endif -#endif - - -/* Header for binary .mo file format. */ -struct mo_file_header -{ - /* The magic number. */ - nls_uint32 magic; - /* The revision number of the file format. */ - nls_uint32 revision; - /* The number of strings pairs. */ - nls_uint32 nstrings; - /* Offset of table with start offsets of original strings. */ - nls_uint32 orig_tab_offset; - /* Offset of table with start offsets of translation strings. */ - nls_uint32 trans_tab_offset; - /* Size of hashing table. */ - nls_uint32 hash_tab_size; - /* Offset of first hashing entry. */ - nls_uint32 hash_tab_offset; -}; - -struct string_desc -{ - /* Length of addressed string. */ - nls_uint32 length; - /* Offset of string in file. */ - nls_uint32 offset; -}; - -/* @@ begin of epilog @@ */ - -#endif /* gettext.h */ diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/gettextP.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/gettextP.h deleted file mode 100644 index 00c5203197..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/gettextP.h +++ /dev/null @@ -1,89 +0,0 @@ -/* Header describing internals of gettext library - Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. - Written by Ulrich Drepper , 1995. - - 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. */ - -#ifndef _GETTEXTP_H -#define _GETTEXTP_H - -#include "loadinfo.h" - -/* @@ end of prolog @@ */ - -#ifndef PARAMS -# if __STDC__ -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif -#endif - -#ifndef internal_function -# define internal_function -#endif - -#ifndef W -# define W(flag, data) ((flag) ? SWAP (data) : (data)) -#endif - - -#ifdef _LIBC -# include -# define SWAP(i) bswap_32 (i) -#else -static nls_uint32 SWAP PARAMS ((nls_uint32 i)); - -static inline nls_uint32 -SWAP (i) - nls_uint32 i; -{ - return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24); -} -#endif - - -struct loaded_domain -{ - const char *data; - int use_mmap; - size_t mmap_size; - int must_swap; - nls_uint32 nstrings; - struct string_desc *orig_tab; - struct string_desc *trans_tab; - nls_uint32 hash_size; - nls_uint32 *hash_tab; -}; - -struct binding -{ - struct binding *next; - char *domainname; - char *dirname; -}; - -struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname, - char *__locale, - const char *__domainname)) - internal_function; -void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain)) - internal_function; -void _nl_unload_domain PARAMS ((struct loaded_domain *__domain)) - internal_function; - -/* @@ begin of epilog @@ */ - -#endif /* gettextP.h */ diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/hash-string.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/hash-string.h deleted file mode 100644 index cacb38e479..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/hash-string.h +++ /dev/null @@ -1,59 +0,0 @@ -/* Implements a string hashing function. - Copyright (C) 1995, 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 Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* @@ end of prolog @@ */ - -#ifndef PARAMS -# if __STDC__ -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -#endif - -/* We assume to have `unsigned long int' value with at least 32 bits. */ -#define HASHWORDBITS 32 - - -/* Defines the so called `hashpjw' function by P.J. Weinberger - [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, - 1986, 1987 Bell Telephone Laboratories, Inc.] */ -static unsigned long hash_string PARAMS ((const char *__str_param)); - -static inline unsigned long -hash_string (str_param) - const char *str_param; -{ - unsigned long int hval, g; - const char *str = str_param; - - /* Compute the hash value for the given string. */ - hval = 0; - while (*str != '\0') - { - hval <<= 4; - hval += (unsigned long) *str++; - g = hval & ((unsigned long) 0xf << (HASHWORDBITS - 4)); - if (g != 0) - { - hval ^= g >> (HASHWORDBITS - 8); - hval ^= g; - } - } - return hval; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/intl-compat.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/intl-compat.c deleted file mode 100644 index 21ffc60c19..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/intl-compat.c +++ /dev/null @@ -1,76 +0,0 @@ -/* intl-compat.c - Stub functions to call gettext functions from GNU gettext - Library. - Copyright (C) 1995 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. */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include "libgettext.h" - -/* @@ end of prolog @@ */ - - -#undef gettext -#undef dgettext -#undef dcgettext -#undef textdomain -#undef bindtextdomain - - -char * -bindtextdomain (domainname, dirname) - const char *domainname; - const char *dirname; -{ - return bindtextdomain__ (domainname, dirname); -} - - -char * -dcgettext (domainname, msgid, category) - const char *domainname; - const char *msgid; - int category; -{ - return dcgettext__ (domainname, msgid, category); -} - - -char * -dgettext (domainname, msgid) - const char *domainname; - const char *msgid; -{ - return dgettext__ (domainname, msgid); -} - - -char * -gettext (msgid) - const char *msgid; -{ - return gettext__ (msgid); -} - - -char * -textdomain (domainname) - const char *domainname; -{ - return textdomain__ (domainname); -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/l10nflist.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/l10nflist.c deleted file mode 100644 index 174794201c..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/l10nflist.c +++ /dev/null @@ -1,411 +0,0 @@ -/* Handle list of needed message catalogs - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - Contributed by Ulrich Drepper , 1995. - - 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. */ - -#ifdef HAVE_CONFIG_H -# include -#endif - - -#if defined HAVE_STRING_H || defined _LIBC -# ifndef _GNU_SOURCE -# define _GNU_SOURCE 1 -# endif -# include -#else -# include -# ifndef memcpy -# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) -# endif -#endif -#if !HAVE_STRCHR && !defined _LIBC -# ifndef strchr -# define strchr index -# endif -#endif - -#if defined _LIBC || defined HAVE_ARGZ_H -# include -#endif -#include -#include - -#if defined STDC_HEADERS || defined _LIBC -# include -#endif - -#include "loadinfo.h" - -/* On some strange systems still no definition of NULL is found. Sigh! */ -#ifndef NULL -# if defined __STDC__ && __STDC__ -# define NULL ((void *) 0) -# else -# define NULL 0 -# endif -#endif - -/* @@ end of prolog @@ */ - -#ifdef _LIBC -/* Rename the non ANSI C functions. This is required by the standard - because some ANSI C functions will require linking with this object - file and the name space must not be polluted. */ -# ifndef stpcpy -# define stpcpy(dest, src) __stpcpy(dest, src) -# endif -#else -# ifndef HAVE_STPCPY -static char *stpcpy PARAMS ((char *dest, const char *src)); -# endif -#endif - -/* Define function which are usually not available. */ - -#if !defined _LIBC && !defined HAVE___ARGZ_COUNT -/* Returns the number of strings in ARGZ. */ -static size_t argz_count__ PARAMS ((const char *argz, size_t len)); - -static size_t -argz_count__ (argz, len) - const char *argz; - size_t len; -{ - size_t count = 0; - while (len > 0) - { - size_t part_len = strlen (argz); - argz += part_len + 1; - len -= part_len + 1; - count++; - } - return count; -} -# undef __argz_count -# define __argz_count(argz, len) argz_count__ (argz, len) -#endif /* !_LIBC && !HAVE___ARGZ_COUNT */ - -#if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY -/* Make '\0' separated arg vector ARGZ printable by converting all the '\0's - except the last into the character SEP. */ -static void argz_stringify__ PARAMS ((char *argz, size_t len, int sep)); - -static void -argz_stringify__ (argz, len, sep) - char *argz; - size_t len; - int sep; -{ - while (len > 0) - { - size_t part_len = strlen (argz); - argz += part_len; - len -= part_len + 1; - if (len > 0) - *argz++ = sep; - } -} -# undef __argz_stringify -# define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep) -#endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */ - -#if !defined _LIBC && !defined HAVE___ARGZ_NEXT -static char *argz_next__ PARAMS ((char *argz, size_t argz_len, - const char *entry)); - -static char * -argz_next__ (argz, argz_len, entry) - char *argz; - size_t argz_len; - const char *entry; -{ - if (entry) - { - if (entry < argz + argz_len) - entry = strchr (entry, '\0') + 1; - - return entry >= argz + argz_len ? NULL : (char *) entry; - } - else - if (argz_len > 0) - return argz; - else - return 0; -} -# undef __argz_next -# define __argz_next(argz, len, entry) argz_next__ (argz, len, entry) -#endif /* !_LIBC && !HAVE___ARGZ_NEXT */ - - -/* Return number of bits set in X. */ -static int pop PARAMS ((int x)); - -static inline int -pop (x) - int x; -{ - /* We assume that no more than 16 bits are used. */ - x = ((x & ~0x5555) >> 1) + (x & 0x5555); - x = ((x & ~0x3333) >> 2) + (x & 0x3333); - x = ((x >> 4) + x) & 0x0f0f; - x = ((x >> 8) + x) & 0xff; - - return x; -} - - -struct loaded_l10nfile * -_nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language, - territory, codeset, normalized_codeset, modifier, special, - sponsor, revision, filename, do_allocate) - struct loaded_l10nfile **l10nfile_list; - const char *dirlist; - size_t dirlist_len; - int mask; - const char *language; - const char *territory; - const char *codeset; - const char *normalized_codeset; - const char *modifier; - const char *special; - const char *sponsor; - const char *revision; - const char *filename; - int do_allocate; -{ - char *abs_filename; - struct loaded_l10nfile *last = NULL; - struct loaded_l10nfile *retval; - char *cp; - size_t entries; - int cnt; - - /* Allocate room for the full file name. */ - abs_filename = (char *) malloc (dirlist_len - + strlen (language) - + ((mask & TERRITORY) != 0 - ? strlen (territory) + 1 : 0) - + ((mask & XPG_CODESET) != 0 - ? strlen (codeset) + 1 : 0) - + ((mask & XPG_NORM_CODESET) != 0 - ? strlen (normalized_codeset) + 1 : 0) - + (((mask & XPG_MODIFIER) != 0 - || (mask & CEN_AUDIENCE) != 0) - ? strlen (modifier) + 1 : 0) - + ((mask & CEN_SPECIAL) != 0 - ? strlen (special) + 1 : 0) - + (((mask & CEN_SPONSOR) != 0 - || (mask & CEN_REVISION) != 0) - ? (1 + ((mask & CEN_SPONSOR) != 0 - ? strlen (sponsor) + 1 : 0) - + ((mask & CEN_REVISION) != 0 - ? strlen (revision) + 1 : 0)) : 0) - + 1 + strlen (filename) + 1); - - if (abs_filename == NULL) - return NULL; - - retval = NULL; - last = NULL; - - /* Construct file name. */ - memcpy (abs_filename, dirlist, dirlist_len); - __argz_stringify (abs_filename, dirlist_len, ':'); - cp = abs_filename + (dirlist_len - 1); - *cp++ = '/'; - cp = stpcpy (cp, language); - - if ((mask & TERRITORY) != 0) - { - *cp++ = '_'; - cp = stpcpy (cp, territory); - } - if ((mask & XPG_CODESET) != 0) - { - *cp++ = '.'; - cp = stpcpy (cp, codeset); - } - if ((mask & XPG_NORM_CODESET) != 0) - { - *cp++ = '.'; - cp = stpcpy (cp, normalized_codeset); - } - if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0) - { - /* This component can be part of both syntaces but has different - leading characters. For CEN we use `+', else `@'. */ - *cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@'; - cp = stpcpy (cp, modifier); - } - if ((mask & CEN_SPECIAL) != 0) - { - *cp++ = '+'; - cp = stpcpy (cp, special); - } - if ((mask & (CEN_SPONSOR | CEN_REVISION)) != 0) - { - *cp++ = ','; - if ((mask & CEN_SPONSOR) != 0) - cp = stpcpy (cp, sponsor); - if ((mask & CEN_REVISION) != 0) - { - *cp++ = '_'; - cp = stpcpy (cp, revision); - } - } - - *cp++ = '/'; - stpcpy (cp, filename); - - /* Look in list of already loaded domains whether it is already - available. */ - last = NULL; - for (retval = *l10nfile_list; retval != NULL; retval = retval->next) - if (retval->filename != NULL) - { - int compare = strcmp (retval->filename, abs_filename); - if (compare == 0) - /* We found it! */ - break; - if (compare < 0) - { - /* It's not in the list. */ - retval = NULL; - break; - } - - last = retval; - } - - if (retval != NULL || do_allocate == 0) - { - free (abs_filename); - return retval; - } - - retval = (struct loaded_l10nfile *) - malloc (sizeof (*retval) + (__argz_count (dirlist, dirlist_len) - * (1 << pop (mask)) - * sizeof (struct loaded_l10nfile *))); - if (retval == NULL) - return NULL; - - retval->filename = abs_filename; - retval->decided = (__argz_count (dirlist, dirlist_len) != 1 - || ((mask & XPG_CODESET) != 0 - && (mask & XPG_NORM_CODESET) != 0)); - retval->data = NULL; - - if (last == NULL) - { - retval->next = *l10nfile_list; - *l10nfile_list = retval; - } - else - { - retval->next = last->next; - last->next = retval; - } - - entries = 0; - /* If the DIRLIST is a real list the RETVAL entry corresponds not to - a real file. So we have to use the DIRLIST separation mechanism - of the inner loop. */ - cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask; - for (; cnt >= 0; --cnt) - if ((cnt & ~mask) == 0 - && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0) - && ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0)) - { - /* Iterate over all elements of the DIRLIST. */ - char *dir = NULL; - - while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir)) - != NULL) - retval->successor[entries++] - = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt, - language, territory, codeset, - normalized_codeset, modifier, special, - sponsor, revision, filename, 1); - } - retval->successor[entries] = NULL; - - return retval; -} - -/* Normalize codeset name. There is no standard for the codeset - names. Normalization allows the user to use any of the common - names. */ -const char * -_nl_normalize_codeset (codeset, name_len) - const unsigned char *codeset; - size_t name_len; -{ - int len = 0; - int only_digit = 1; - char *retval; - char *wp; - size_t cnt; - - for (cnt = 0; cnt < name_len; ++cnt) - if (isalnum (codeset[cnt])) - { - ++len; - - if (isalpha (codeset[cnt])) - only_digit = 0; - } - - retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1); - - if (retval != NULL) - { - if (only_digit) - wp = stpcpy (retval, "iso"); - else - wp = retval; - - for (cnt = 0; cnt < name_len; ++cnt) - if (isalpha (codeset[cnt])) - *wp++ = tolower (codeset[cnt]); - else if (isdigit (codeset[cnt])) - *wp++ = codeset[cnt]; - - *wp = '\0'; - } - - return (const char *) retval; -} - - -/* @@ begin of epilog @@ */ - -/* We don't want libintl.a to depend on any other library. So we - avoid the non-standard function stpcpy. In GNU C Library this - function is available, though. Also allow the symbol HAVE_STPCPY - to be defined. */ -#if !_LIBC && !HAVE_STPCPY -static char * -stpcpy (dest, src) - char *dest; - const char *src; -{ - while ((*dest++ = *src++) != '\0') - /* Do nothing. */ ; - return dest - 1; -} -#endif diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/libgettext.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/libgettext.h deleted file mode 100644 index 3a92960ae3..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/libgettext.h +++ /dev/null @@ -1,182 +0,0 @@ -/* Message catalogs for internationalization. - Copyright (C) 1995, 1996, 1997, 1998 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. */ - -/* Because on some systems (e.g. Solaris) we sometimes have to include - the systems libintl.h as well as this file we have more complex - include protection above. But the systems header might perhaps also - define _LIBINTL_H and therefore we have to protect the definition here. */ - -#if !defined _LIBINTL_H || !defined _LIBGETTEXT_H -#ifndef _LIBINTL_H -# define _LIBINTL_H 1 -#endif -#define _LIBGETTEXT_H 1 - -/* We define an additional symbol to signal that we use the GNU - implementation of gettext. */ -#define __USE_GNU_GETTEXT 1 - -#include - -#if HAVE_LOCALE_H -# include -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - -/* @@ end of prolog @@ */ - -#ifndef PARAMS -# if __STDC__ || defined __cplusplus -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif -#endif - -#ifndef NULL -# if !defined __cplusplus || defined __GNUC__ -# define NULL ((void *) 0) -# else -# define NULL (0) -# endif -#endif - -#if !HAVE_LC_MESSAGES -/* This value determines the behaviour of the gettext() and dgettext() - function. But some system does not have this defined. Define it - to a default value. */ -# define LC_MESSAGES (-1) -#endif - - -/* Declarations for gettext-using-catgets interface. Derived from - Jim Meyering's libintl.h. */ -struct _msg_ent -{ - const char *_msg; - int _msg_number; -}; - - -#if HAVE_CATGETS -/* These two variables are defined in the automatically by po-to-tbl.sed - generated file `cat-id-tbl.c'. */ -extern const struct _msg_ent _msg_tbl[]; -extern int _msg_tbl_length; -#endif - - -/* For automatical extraction of messages sometimes no real - translation is needed. Instead the string itself is the result. */ -#define gettext_noop(Str) (Str) - -/* Look up MSGID in the current default message catalog for the current - LC_MESSAGES locale. If not found, returns MSGID itself (the default - text). */ -extern char *gettext PARAMS ((const char *__msgid)); -extern char *gettext__ PARAMS ((const char *__msgid)); - -/* Look up MSGID in the DOMAINNAME message catalog for the current - LC_MESSAGES locale. */ -extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid)); -extern char *dgettext__ PARAMS ((const char *__domainname, - const char *__msgid)); - -/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY - locale. */ -extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid, - int __category)); -extern char *dcgettext__ PARAMS ((const char *__domainname, - const char *__msgid, int __category)); - - -/* Set the current default message catalog to DOMAINNAME. - If DOMAINNAME is null, return the current default. - If DOMAINNAME is "", reset to the default of "messages". */ -extern char *textdomain PARAMS ((const char *__domainname)); -extern char *textdomain__ PARAMS ((const char *__domainname)); - -/* Specify that the DOMAINNAME message catalog will be found - in DIRNAME rather than in the system locale data base. */ -extern char *bindtextdomain PARAMS ((const char *__domainname, - const char *__dirname)); -extern char *bindtextdomain__ PARAMS ((const char *__domainname, - const char *__dirname)); - -#if ENABLE_NLS - -/* Solaris 2.3 has the gettext function but dcgettext is missing. - So we omit this optimization for Solaris 2.3. BTW, Solaris 2.4 - has dcgettext. */ -# if !HAVE_CATGETS && (!HAVE_GETTEXT || HAVE_DCGETTEXT) - -# define gettext(Msgid) \ - dgettext (NULL, Msgid) - -# define dgettext(Domainname, Msgid) \ - dcgettext (Domainname, Msgid, LC_MESSAGES) - -# if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ >= 7 -/* This global variable is defined in loadmsgcat.c. We need a sign, - whether a new catalog was loaded, which can be associated with all - translations. */ -extern int _nl_msg_cat_cntr; - -# define dcgettext(Domainname, Msgid, Category) \ - (__extension__ \ - ({ \ - char *__result; \ - if (__builtin_constant_p (Msgid)) \ - { \ - static char *__translation__; \ - static int __catalog_counter__; \ - if (! __translation__ || __catalog_counter__ != _nl_msg_cat_cntr) \ - { \ - __translation__ = \ - dcgettext__ (Domainname, Msgid, Category); \ - __catalog_counter__ = _nl_msg_cat_cntr; \ - } \ - __result = __translation__; \ - } \ - else \ - __result = dcgettext__ (Domainname, Msgid, Category); \ - __result; \ - })) -# endif -# endif - -#else - -# define gettext(Msgid) (Msgid) -# define dgettext(Domainname, Msgid) (Msgid) -# define dcgettext(Domainname, Msgid, Category) (Msgid) -# define textdomain(Domainname) ((char *) Domainname) -# define bindtextdomain(Domainname, Dirname) ((char *) Dirname) - -#endif - -/* @@ begin of epilog @@ */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/linux-msg.sed b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/linux-msg.sed deleted file mode 100755 index 5918e720a9..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/linux-msg.sed +++ /dev/null @@ -1,100 +0,0 @@ -# po2msg.sed - Convert Uniforum style .po file to Linux style .msg file -# Copyright (C) 1995 Free Software Foundation, Inc. -# Ulrich Drepper , 1995. -# -# 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. -# -# -# The first directive in the .msg should be the definition of the -# message set number. We use always set number 1. -# -1 { - i\ -$set 1 # Automatically created by po2msg.sed - h - s/.*/0/ - x -} -# -# Mitch's old catalog format does not allow comments. -# -# We copy the original message as a comment into the .msg file. -# -/^msgid/ { - s/msgid[ ]*"// -# -# This does not work now with the new format. -# /"$/! { -# s/\\$// -# s/$/ ... (more lines following)"/ -# } - x -# The following nice solution is by -# Bruno - td -# Increment a decimal number in pattern space. -# First hide trailing `9' digits. - :d - s/9\(_*\)$/_\1/ - td -# Assure at least one digit is available. - s/^\(_*\)$/0\1/ -# Increment the last digit. - s/8\(_*\)$/9\1/ - s/7\(_*\)$/8\1/ - s/6\(_*\)$/7\1/ - s/5\(_*\)$/6\1/ - s/4\(_*\)$/5\1/ - s/3\(_*\)$/4\1/ - s/2\(_*\)$/3\1/ - s/1\(_*\)$/2\1/ - s/0\(_*\)$/1\1/ -# Convert the hidden `9' digits to `0's. - s/_/0/g - x - G - s/\(.*\)"\n\([0-9]*\)/$ #\2 Original Message:(\1)/p -} -# -# The .msg file contains, other then the .po file, only the translations -# but each given a unique ID. Starting from 1 and incrementing by 1 for -# each message we assign them to the messages. -# It is important that the .po file used to generate the cat-id-tbl.c file -# (with po-to-tbl) is the same as the one used here. (At least the order -# of declarations must not be changed.) -# -/^msgstr/ { - s/msgstr[ ]*"\(.*\)"/# \1/ -# Clear substitution flag. - tb -# Append the next line. - :b - N -# Look whether second part is continuation line. - s/\(.*\n\)"\(.*\)"/\1\2/ -# Yes, then branch. - ta - P - D -# Note that D includes a jump to the start!! -# We found a continuation line. But before printing insert '\'. - :a - s/\(.*\)\(\n.*\)/\1\\\2/ - P -# We cannot use D here. - s/.*\n\(.*\)/\1/ - tb -} -d diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/loadinfo.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/loadinfo.h deleted file mode 100644 index f4ebf6d811..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/loadinfo.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 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, 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. */ - -#ifndef PARAMS -# if __STDC__ -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif -#endif - -/* Encoding of locale name parts. */ -#define CEN_REVISION 1 -#define CEN_SPONSOR 2 -#define CEN_SPECIAL 4 -#define XPG_NORM_CODESET 8 -#define XPG_CODESET 16 -#define TERRITORY 32 -#define CEN_AUDIENCE 64 -#define XPG_MODIFIER 128 - -#define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE) -#define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER) - - -struct loaded_l10nfile -{ - const char *filename; - int decided; - - const void *data; - - struct loaded_l10nfile *next; - struct loaded_l10nfile *successor[1]; -}; - - -extern const char *_nl_normalize_codeset PARAMS ((const unsigned char *codeset, - size_t name_len)); - -extern struct loaded_l10nfile * -_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list, - const char *dirlist, size_t dirlist_len, int mask, - const char *language, const char *territory, - const char *codeset, - const char *normalized_codeset, - const char *modifier, const char *special, - const char *sponsor, const char *revision, - const char *filename, int do_allocate)); - - -extern const char *_nl_expand_alias PARAMS ((const char *name)); - -extern int _nl_explode_name PARAMS ((char *name, const char **language, - const char **modifier, - const char **territory, - const char **codeset, - const char **normalized_codeset, - const char **special, - const char **sponsor, - const char **revision)); diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/loadmsgcat.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/loadmsgcat.c deleted file mode 100644 index e74a2f77f5..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/loadmsgcat.c +++ /dev/null @@ -1,222 +0,0 @@ -/* Load needed message catalogs. - Copyright (C) 1995, 1996, 1997, 1998 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. */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include - -#if defined STDC_HEADERS || defined _LIBC -# include -#endif - -#if defined HAVE_UNISTD_H || defined _LIBC -# include -#endif - -#if (defined HAVE_MMAP && defined HAVE_MUNMAP) || defined _LIBC -# include -#endif - -#include "gettext.h" -#include "gettextP.h" - -/* @@ end of prolog @@ */ - -#ifdef _LIBC -/* Rename the non ISO C functions. This is required by the standard - because some ISO C functions will require linking with this object - file and the name space must not be polluted. */ -# define open __open -# define close __close -# define read __read -# define mmap __mmap -# define munmap __munmap -#endif - -/* We need a sign, whether a new catalog was loaded, which can be associated - with all translations. This is important if the translations are - cached by one of GCC's features. */ -int _nl_msg_cat_cntr = 0; - - -/* Load the message catalogs specified by FILENAME. If it is no valid - message catalog do nothing. */ -void -internal_function -_nl_load_domain (domain_file) - struct loaded_l10nfile *domain_file; -{ - int fd; - size_t size; - struct stat st; - struct mo_file_header *data = (struct mo_file_header *) -1; -#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ - || defined _LIBC - int use_mmap = 0; -#endif - struct loaded_domain *domain; - - domain_file->decided = 1; - domain_file->data = NULL; - - /* If the record does not represent a valid locale the FILENAME - might be NULL. This can happen when according to the given - specification the locale file name is different for XPG and CEN - syntax. */ - if (domain_file->filename == NULL) - return; - - /* Try to open the addressed file. */ - fd = open (domain_file->filename, O_RDONLY); - if (fd == -1) - return; - - /* We must know about the size of the file. */ - if (fstat (fd, &st) != 0 - || (size = (size_t) st.st_size) != st.st_size - || size < sizeof (struct mo_file_header)) - { - /* Something went wrong. */ - close (fd); - return; - } - -#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ - || defined _LIBC - /* Now we are ready to load the file. If mmap() is available we try - this first. If not available or it failed we try to load it. */ - data = (struct mo_file_header *) mmap (NULL, size, PROT_READ, - MAP_PRIVATE, fd, 0); - - if (data != (struct mo_file_header *) -1) - { - /* mmap() call was successful. */ - close (fd); - use_mmap = 1; - } -#endif - - /* If the data is not yet available (i.e. mmap'ed) we try to load - it manually. */ - if (data == (struct mo_file_header *) -1) - { - size_t to_read; - char *read_ptr; - - data = (struct mo_file_header *) malloc (size); - if (data == NULL) - return; - - to_read = size; - read_ptr = (char *) data; - do - { - long int nb = (long int) read (fd, read_ptr, to_read); - if (nb == -1) - { - close (fd); - return; - } - - read_ptr += nb; - to_read -= nb; - } - while (to_read > 0); - - close (fd); - } - - /* Using the magic number we can test whether it really is a message - catalog file. */ - if (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED) - { - /* The magic number is wrong: not a message catalog file. */ -#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ - || defined _LIBC - if (use_mmap) - munmap ((caddr_t) data, size); - else -#endif - free (data); - return; - } - - domain_file->data - = (struct loaded_domain *) malloc (sizeof (struct loaded_domain)); - if (domain_file->data == NULL) - return; - - domain = (struct loaded_domain *) domain_file->data; - domain->data = (char *) data; -#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ - || defined _LIBC - domain->use_mmap = use_mmap; -#endif - domain->mmap_size = size; - domain->must_swap = data->magic != _MAGIC; - - /* Fill in the information about the available tables. */ - switch (W (domain->must_swap, data->revision)) - { - case 0: - domain->nstrings = W (domain->must_swap, data->nstrings); - domain->orig_tab = (struct string_desc *) - ((char *) data + W (domain->must_swap, data->orig_tab_offset)); - domain->trans_tab = (struct string_desc *) - ((char *) data + W (domain->must_swap, data->trans_tab_offset)); - domain->hash_size = W (domain->must_swap, data->hash_tab_size); - domain->hash_tab = (nls_uint32 *) - ((char *) data + W (domain->must_swap, data->hash_tab_offset)); - break; - default: - /* This is an illegal revision. */ -#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ - || defined _LIBC - if (use_mmap) - munmap ((caddr_t) data, size); - else -#endif - free (data); - free (domain); - domain_file->data = NULL; - return; - } - - /* Show that one domain is changed. This might make some cached - translations invalid. */ - ++_nl_msg_cat_cntr; -} - - -#ifdef _LIBC -void -internal_function -_nl_unload_domain (domain) - struct loaded_domain *domain; -{ - if (domain->use_mmap) - munmap ((caddr_t) domain->data, domain->mmap_size); - else - free ((void *) domain->data); - - free (domain); -} -#endif diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/localealias.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/localealias.c deleted file mode 100644 index 18cc68886b..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/localealias.c +++ /dev/null @@ -1,424 +0,0 @@ -/* Handle aliases for locale names. - Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. - Written by Ulrich Drepper , 1995. - - 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. */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include - -#ifdef __GNUC__ -# define alloca __builtin_alloca -# define HAVE_ALLOCA 1 -#else -# if defined HAVE_ALLOCA_H || defined _LIBC -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca -char *alloca (); -# endif -# endif -# endif -#endif - -#if defined STDC_HEADERS || defined _LIBC -# include -#else -char *getenv (); -# ifdef HAVE_MALLOC_H -# include -# else -void free (); -# endif -#endif - -#if defined HAVE_STRING_H || defined _LIBC -# ifndef _GNU_SOURCE -# define _GNU_SOURCE 1 -# endif -# include -#else -# include -# ifndef memcpy -# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) -# endif -#endif -#if !HAVE_STRCHR && !defined _LIBC -# ifndef strchr -# define strchr index -# endif -#endif - -#include "gettext.h" -#include "gettextP.h" - -/* @@ end of prolog @@ */ - -#ifdef _LIBC -/* Rename the non ANSI C functions. This is required by the standard - because some ANSI C functions will require linking with this object - file and the name space must not be polluted. */ -# define strcasecmp __strcasecmp - -# define mempcpy __mempcpy -# define HAVE_MEMPCPY 1 - -/* We need locking here since we can be called from different places. */ -# include - -__libc_lock_define_initialized (static, lock); -#endif - - -/* For those loosing systems which don't have `alloca' we have to add - some additional code emulating it. */ -#ifdef HAVE_ALLOCA -/* Nothing has to be done. */ -# define ADD_BLOCK(list, address) /* nothing */ -# define FREE_BLOCKS(list) /* nothing */ -#else -struct block_list -{ - void *address; - struct block_list *next; -}; -# define ADD_BLOCK(list, addr) \ - do { \ - struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \ - /* If we cannot get a free block we cannot add the new element to \ - the list. */ \ - if (newp != NULL) { \ - newp->address = (addr); \ - newp->next = (list); \ - (list) = newp; \ - } \ - } while (0) -# define FREE_BLOCKS(list) \ - do { \ - while (list != NULL) { \ - struct block_list *old = list; \ - list = list->next; \ - free (old); \ - } \ - } while (0) -# undef alloca -# define alloca(size) (malloc (size)) -#endif /* have alloca */ - - -struct alias_map -{ - const char *alias; - const char *value; -}; - - -static char *string_space = NULL; -static size_t string_space_act = 0; -static size_t string_space_max = 0; -static struct alias_map *map; -static size_t nmap = 0; -static size_t maxmap = 0; - - -/* Prototypes for local functions. */ -static size_t read_alias_file PARAMS ((const char *fname, int fname_len)) - internal_function; -static void extend_alias_table PARAMS ((void)); -static int alias_compare PARAMS ((const struct alias_map *map1, - const struct alias_map *map2)); - - -const char * -_nl_expand_alias (name) - const char *name; -{ - static const char *locale_alias_path = LOCALE_ALIAS_PATH; - struct alias_map *retval; - const char *result = NULL; - size_t added; - -#ifdef _LIBC - __libc_lock_lock (lock); -#endif - - do - { - struct alias_map item; - - item.alias = name; - - if (nmap > 0) - retval = (struct alias_map *) bsearch (&item, map, nmap, - sizeof (struct alias_map), - (int (*) PARAMS ((const void *, - const void *)) - ) alias_compare); - else - retval = NULL; - - /* We really found an alias. Return the value. */ - if (retval != NULL) - { - result = retval->value; - break; - } - - /* Perhaps we can find another alias file. */ - added = 0; - while (added == 0 && locale_alias_path[0] != '\0') - { - const char *start; - - while (locale_alias_path[0] == ':') - ++locale_alias_path; - start = locale_alias_path; - - while (locale_alias_path[0] != '\0' && locale_alias_path[0] != ':') - ++locale_alias_path; - - if (start < locale_alias_path) - added = read_alias_file (start, locale_alias_path - start); - } - } - while (added != 0); - -#ifdef _LIBC - __libc_lock_unlock (lock); -#endif - - return result; -} - - -static size_t -internal_function -read_alias_file (fname, fname_len) - const char *fname; - int fname_len; -{ -#ifndef HAVE_ALLOCA - struct block_list *block_list = NULL; -#endif - FILE *fp; - char *full_fname; - size_t added; - static const char aliasfile[] = "/locale.alias"; - - full_fname = (char *) alloca (fname_len + sizeof aliasfile); - ADD_BLOCK (block_list, full_fname); -#ifdef HAVE_MEMPCPY - mempcpy (mempcpy (full_fname, fname, fname_len), - aliasfile, sizeof aliasfile); -#else - memcpy (full_fname, fname, fname_len); - memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile); -#endif - - fp = fopen (full_fname, "r"); - if (fp == NULL) - { - FREE_BLOCKS (block_list); - return 0; - } - - added = 0; - while (!feof (fp)) - { - /* It is a reasonable approach to use a fix buffer here because - a) we are only interested in the first two fields - b) these fields must be usable as file names and so must not - be that long - */ - unsigned char buf[BUFSIZ]; - unsigned char *alias; - unsigned char *value; - unsigned char *cp; - - if (fgets (buf, sizeof buf, fp) == NULL) - /* EOF reached. */ - break; - - /* Possibly not the whole line fits into the buffer. Ignore - the rest of the line. */ - if (strchr (buf, '\n') == NULL) - { - char altbuf[BUFSIZ]; - do - if (fgets (altbuf, sizeof altbuf, fp) == NULL) - /* Make sure the inner loop will be left. The outer loop - will exit at the `feof' test. */ - break; - while (strchr (altbuf, '\n') == NULL); - } - - cp = buf; - /* Ignore leading white space. */ - while (isspace (cp[0])) - ++cp; - - /* A leading '#' signals a comment line. */ - if (cp[0] != '\0' && cp[0] != '#') - { - alias = cp++; - while (cp[0] != '\0' && !isspace (cp[0])) - ++cp; - /* Terminate alias name. */ - if (cp[0] != '\0') - *cp++ = '\0'; - - /* Now look for the beginning of the value. */ - while (isspace (cp[0])) - ++cp; - - if (cp[0] != '\0') - { - size_t alias_len; - size_t value_len; - - value = cp++; - while (cp[0] != '\0' && !isspace (cp[0])) - ++cp; - /* Terminate value. */ - if (cp[0] == '\n') - { - /* This has to be done to make the following test - for the end of line possible. We are looking for - the terminating '\n' which do not overwrite here. */ - *cp++ = '\0'; - *cp = '\n'; - } - else if (cp[0] != '\0') - *cp++ = '\0'; - - if (nmap >= maxmap) - extend_alias_table (); - - alias_len = strlen (alias) + 1; - value_len = strlen (value) + 1; - - if (string_space_act + alias_len + value_len > string_space_max) - { - /* Increase size of memory pool. */ - size_t new_size = (string_space_max - + (alias_len + value_len > 1024 - ? alias_len + value_len : 1024)); - char *new_pool = (char *) realloc (string_space, new_size); - if (new_pool == NULL) - { - FREE_BLOCKS (block_list); - return added; - } - string_space = new_pool; - string_space_max = new_size; - } - - map[nmap].alias = memcpy (&string_space[string_space_act], - alias, alias_len); - string_space_act += alias_len; - - map[nmap].value = memcpy (&string_space[string_space_act], - value, value_len); - string_space_act += value_len; - - ++nmap; - ++added; - } - } - } - - /* Should we test for ferror()? I think we have to silently ignore - errors. --drepper */ - fclose (fp); - - if (added > 0) - qsort (map, nmap, sizeof (struct alias_map), - (int (*) PARAMS ((const void *, const void *))) alias_compare); - - FREE_BLOCKS (block_list); - return added; -} - - -static void -extend_alias_table () -{ - size_t new_size; - struct alias_map *new_map; - - new_size = maxmap == 0 ? 100 : 2 * maxmap; - new_map = (struct alias_map *) realloc (map, (new_size - * sizeof (struct alias_map))); - if (new_map == NULL) - /* Simply don't extend: we don't have any more core. */ - return; - - map = new_map; - maxmap = new_size; -} - - -#ifdef _LIBC -static void __attribute__ ((unused)) -free_mem (void) -{ - if (string_space != NULL) - free (string_space); - if (map != NULL) - free (map); -} -text_set_element (__libc_subfreeres, free_mem); -#endif - - -static int -alias_compare (map1, map2) - const struct alias_map *map1; - const struct alias_map *map2; -{ -#if defined _LIBC || defined HAVE_STRCASECMP - return strcasecmp (map1->alias, map2->alias); -#else - const unsigned char *p1 = (const unsigned char *) map1->alias; - const unsigned char *p2 = (const unsigned char *) map2->alias; - unsigned char c1, c2; - - if (p1 == p2) - return 0; - - do - { - /* I know this seems to be odd but the tolower() function in - some systems libc cannot handle nonalpha characters. */ - c1 = isupper (*p1) ? tolower (*p1) : *p1; - c2 = isupper (*p2) ? tolower (*p2) : *p2; - if (c1 == '\0') - break; - ++p1; - ++p2; - } - while (c1 == c2); - - return c1 - c2; -#endif -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/po2tbl.sed.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/po2tbl.sed.in deleted file mode 100755 index b3bcca4d73..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/po2tbl.sed.in +++ /dev/null @@ -1,102 +0,0 @@ -# po2tbl.sed - Convert Uniforum style .po file to lookup table for catgets -# Copyright (C) 1995 Free Software Foundation, Inc. -# Ulrich Drepper , 1995. -# -# 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. -# -1 { - i\ -/* Automatically generated by po2tbl.sed from @PACKAGE NAME@.pot. */\ -\ -#if HAVE_CONFIG_H\ -# include \ -#endif\ -\ -#include "libgettext.h"\ -\ -const struct _msg_ent _msg_tbl[] = { - h - s/.*/0/ - x -} -# -# Write msgid entries in C array form. -# -/^msgid/ { - s/msgid[ ]*\(".*"\)/ {\1/ - tb -# Append the next line - :b - N -# Look whether second part is continuation line. - s/\(.*\)"\(\n\)"\(.*"\)/\1\2\3/ -# Yes, then branch. - ta -# Because we assume that the input file correctly formed the line -# just read cannot be again be a msgid line. So it's safe to ignore -# it. - s/\(.*\)\n.*/\1/ - bc -# We found a continuation line. But before printing insert '\'. - :a - s/\(.*\)\(\n.*\)/\1\\\2/ - P -# We cannot use D here. - s/.*\n\(.*\)/\1/ -# Some buggy seds do not clear the `successful substitution since last ``t''' -# flag on `N', so we do a `t' here to clear it. - tb -# Not reached - :c - x -# The following nice solution is by -# Bruno - td -# Increment a decimal number in pattern space. -# First hide trailing `9' digits. - :d - s/9\(_*\)$/_\1/ - td -# Assure at least one digit is available. - s/^\(_*\)$/0\1/ -# Increment the last digit. - s/8\(_*\)$/9\1/ - s/7\(_*\)$/8\1/ - s/6\(_*\)$/7\1/ - s/5\(_*\)$/6\1/ - s/4\(_*\)$/5\1/ - s/3\(_*\)$/4\1/ - s/2\(_*\)$/3\1/ - s/1\(_*\)$/2\1/ - s/0\(_*\)$/1\1/ -# Convert the hidden `9' digits to `0's. - s/_/0/g - x - G - s/\(.*\)\n\([0-9]*\)/\1, \2},/ - s/\(.*\)"$/\1/ - p -} -# -# Last line. -# -$ { - i\ -};\ - - g - s/0*\(.*\)/int _msg_tbl_length = \1;/p -} -d diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/textdomain.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/textdomain.c deleted file mode 100644 index 2e8facb1f8..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/textdomain.c +++ /dev/null @@ -1,108 +0,0 @@ -/* Implementation of the textdomain(3) function. - Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. - Written by Ulrich Drepper , 1995. - - 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. */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#if defined STDC_HEADERS || defined _LIBC -# include -#endif - -#if defined STDC_HEADERS || defined HAVE_STRING_H || defined _LIBC -# include -#else -# include -# ifndef memcpy -# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) -# endif -#endif - -#ifdef _LIBC -# include -#else -# include "libgettext.h" -#endif - -/* @@ end of prolog @@ */ - -/* Name of the default text domain. */ -extern const char _nl_default_default_domain[]; - -/* Default text domain in which entries for gettext(3) are to be found. */ -extern const char *_nl_current_default_domain; - - -/* Names for the libintl functions are a problem. They must not clash - with existing names and they should follow ANSI C. But this source - code is also used in GNU C Library where the names have a __ - prefix. So we have to make a difference here. */ -#ifdef _LIBC -# define TEXTDOMAIN __textdomain -# ifndef strdup -# define strdup(str) __strdup (str) -# endif -#else -# define TEXTDOMAIN textdomain__ -#endif - -/* Set the current default message catalog to DOMAINNAME. - If DOMAINNAME is null, return the current default. - If DOMAINNAME is "", reset to the default of "messages". */ -char * -TEXTDOMAIN (domainname) - const char *domainname; -{ - char *old; - - /* A NULL pointer requests the current setting. */ - if (domainname == NULL) - return (char *) _nl_current_default_domain; - - old = (char *) _nl_current_default_domain; - - /* If domain name is the null string set to default domain "messages". */ - if (domainname[0] == '\0' - || strcmp (domainname, _nl_default_default_domain) == 0) - _nl_current_default_domain = _nl_default_default_domain; - else - { - /* If the following malloc fails `_nl_current_default_domain' - will be NULL. This value will be returned and so signals we - are out of core. */ -#if defined _LIBC || defined HAVE_STRDUP - _nl_current_default_domain = strdup (domainname); -#else - size_t len = strlen (domainname) + 1; - char *cp = (char *) malloc (len); - if (cp != NULL) - memcpy (cp, domainname, len); - _nl_current_default_domain = cp; -#endif - } - - if (old != _nl_default_default_domain) - free (old); - - return (char *) _nl_current_default_domain; -} - -#ifdef _LIBC -/* Alias for function name in GNU C Library. */ -weak_alias (__textdomain, textdomain); -#endif diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/xopen-msg.sed b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/xopen-msg.sed deleted file mode 100755 index b19c0bbd0e..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/intl/xopen-msg.sed +++ /dev/null @@ -1,104 +0,0 @@ -# po2msg.sed - Convert Uniforum style .po file to X/Open style .msg file -# Copyright (C) 1995 Free Software Foundation, Inc. -# Ulrich Drepper , 1995. -# -# 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. -# -# -# The first directive in the .msg should be the definition of the -# message set number. We use always set number 1. -# -1 { - i\ -$set 1 # Automatically created by po2msg.sed - h - s/.*/0/ - x -} -# -# We copy all comments into the .msg file. Perhaps they can help. -# -/^#/ s/^#[ ]*/$ /p -# -# We copy the original message as a comment into the .msg file. -# -/^msgid/ { -# Does not work now -# /"$/! { -# s/\\$// -# s/$/ ... (more lines following)"/ -# } - s/^msgid[ ]*"\(.*\)"$/$ Original Message: \1/ - p -} -# -# The .msg file contains, other then the .po file, only the translations -# but each given a unique ID. Starting from 1 and incrementing by 1 for -# each message we assign them to the messages. -# It is important that the .po file used to generate the cat-id-tbl.c file -# (with po-to-tbl) is the same as the one used here. (At least the order -# of declarations must not be changed.) -# -/^msgstr/ { - s/msgstr[ ]*"\(.*\)"/\1/ - x -# The following nice solution is by -# Bruno - td -# Increment a decimal number in pattern space. -# First hide trailing `9' digits. - :d - s/9\(_*\)$/_\1/ - td -# Assure at least one digit is available. - s/^\(_*\)$/0\1/ -# Increment the last digit. - s/8\(_*\)$/9\1/ - s/7\(_*\)$/8\1/ - s/6\(_*\)$/7\1/ - s/5\(_*\)$/6\1/ - s/4\(_*\)$/5\1/ - s/3\(_*\)$/4\1/ - s/2\(_*\)$/3\1/ - s/1\(_*\)$/2\1/ - s/0\(_*\)$/1\1/ -# Convert the hidden `9' digits to `0's. - s/_/0/g - x -# Bring the line in the format ` ' - G - s/^[^\n]*$/& / - s/\(.*\)\n\([0-9]*\)/\2 \1/ -# Clear flag from last substitution. - tb -# Append the next line. - :b - N -# Look whether second part is a continuation line. - s/\(.*\n\)"\(.*\)"/\1\2/ -# Yes, then branch. - ta - P - D -# Note that `D' includes a jump to the start!! -# We found a continuation line. But before printing insert '\'. - :a - s/\(.*\)\(\n.*\)/\1\\\2/ - P -# We cannot use the sed command `D' here - s/.*\n\(.*\)/\1/ - tb -} -d diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/Makefile.in.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/Makefile.in.in deleted file mode 100644 index 629f3d4b46..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/Makefile.in.in +++ /dev/null @@ -1,250 +0,0 @@ -# Makefile for program source directory in GNU NLS utilities package. -# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper -# -# This file file be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# Please note that the actual code is *not* freely available. - -PACKAGE = @PACKAGE@ -VERSION = @VERSION@ - -DESTDIR = - -SHELL = /bin/sh -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ - -prefix = $(DESTDIR)@prefix@ -exec_prefix = @exec_prefix@ -datadir = $(prefix)/@DATADIRNAME@ -localedir = $(datadir)/locale -gnulocaledir = $(prefix)/share/locale -gettextsrcdir = $(prefix)/share/gettext/po -subdir = po - -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -MKINSTALLDIRS = ../scripts/mkinstalldirs - -CC = @CC@ -GENCAT = @GENCAT@ -GMSGFMT = PATH=../src:$$PATH @GMSGFMT@ -MSGFMT = @MSGFMT@ -XGETTEXT = PATH=../src:$$PATH @XGETTEXT@ -MSGMERGE = PATH=../src:$$PATH msgmerge - -DEFS = @DEFS@ -CFLAGS = @CFLAGS@ -CPPFLAGS = @CPPFLAGS@ - -INCLUDES = -I.. -I$(top_srcdir)/intl - -COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) - -SOURCES = cat-id-tbl.c -POFILES = @POFILES@ -GMOFILES = @GMOFILES@ -DISTFILES = Makefile.in.in POTFILES.in $(PACKAGE).pot \ -stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES) - -POTFILES = \ - -CATALOGS = @CATALOGS@ -CATOBJEXT = @CATOBJEXT@ -INSTOBJEXT = @INSTOBJEXT@ - -.SUFFIXES: -.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat - -.c.o: - $(COMPILE) $< - -.po.pox: - $(MAKE) $(PACKAGE).pot - $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox - -.po.mo: - $(MSGFMT) -o $@ $< - -.po.gmo: - file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ - && rm -f $$file && $(GMSGFMT) -o $$file $< - -.po.cat: - sed -f ../intl/po2msg.sed < $< > $*.msg \ - && rm -f $@ && $(GENCAT) $@ $*.msg - - -all: all-@USE_NLS@ - -all-yes: cat-id-tbl.c $(CATALOGS) -all-no: - -$(srcdir)/$(PACKAGE).pot: $(POTFILES) - $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ - --add-comments --keyword=_ --keyword=N_ \ - --files-from=$(srcdir)/POTFILES.in \ - && test ! -f $(PACKAGE).po \ - || ( rm -f $(srcdir)/$(PACKAGE).pot \ - && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot ) - -$(srcdir)/cat-id-tbl.c: stamp-cat-id; @: -$(srcdir)/stamp-cat-id: $(PACKAGE).pot - rm -f cat-id-tbl.tmp - sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \ - | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp - if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \ - rm cat-id-tbl.tmp; \ - else \ - echo cat-id-tbl.c changed; \ - rm -f $(srcdir)/cat-id-tbl.c; \ - mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \ - fi - cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id - - -install: install-exec install-data -install-exec: -install-data: install-data-@USE_NLS@ -install-data-no: all -install-data-yes: all - if test -r "$(MKINSTALLDIRS)"; then \ - $(MKINSTALLDIRS) $(datadir); \ - else \ - $(SHELL) ../scripts/mkinstalldirs $(datadir); \ - fi - @catalogs='$(CATALOGS)'; \ - for cat in $$catalogs; do \ - cat=`basename $$cat`; \ - case "$$cat" in \ - *.gmo) destdir=$(gnulocaledir);; \ - *) destdir=$(localedir);; \ - esac; \ - lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - dir=$$destdir/$$lang/LC_MESSAGES; \ - if test -r "$(MKINSTALLDIRS)"; then \ - $(MKINSTALLDIRS) $$dir; \ - else \ - $(SHELL) ../scripts/mkinstalldirs $$dir; \ - fi; \ - if test -r $$cat; then \ - $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ - echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \ - else \ - $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ - echo "installing $(srcdir)/$$cat as" \ - "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \ - fi; \ - if test -r $$cat.m; then \ - $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ - echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ - else \ - if test -r $(srcdir)/$$cat.m ; then \ - $(INSTALL_DATA) $(srcdir)/$$cat.m \ - $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ - echo "installing $(srcdir)/$$cat as" \ - "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ - else \ - true; \ - fi; \ - fi; \ - done - if test "$(PACKAGE)" = "gettext"; then \ - if test -r "$(MKINSTALLDIRS)"; then \ - $(MKINSTALLDIRS) $(gettextsrcdir); \ - else \ - $(SHELL) ../scripts/mkinstalldirs $(gettextsrcdir); \ - fi; \ - $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ - $(gettextsrcdir)/Makefile.in.in; \ - else \ - : ; \ - fi - -# Define this as empty until I found a useful application. -installcheck: - -uninstall: - catalogs='$(CATALOGS)'; \ - for cat in $$catalogs; do \ - cat=`basename $$cat`; \ - lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ - rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ - rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ - rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ - done - rm -f $(gettextsrcdir)/po-Makefile.in.in - -check: all - -cat-id-tbl.o: ../intl/libgettext.h - -dvi info tags TAGS ID: - -mostlyclean: - rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp - rm -fr *.o - -clean: mostlyclean - -distclean: clean - rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m - -maintainer-clean: distclean - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - rm -f $(GMOFILES) - -distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) -dist distdir: update-po $(DISTFILES) - dists="$(DISTFILES)"; \ - for file in $$dists; do \ - ln $(srcdir)/$$file $(distdir) 2> /dev/null \ - || cp -p $(srcdir)/$$file $(distdir) || echo ignore; \ - done - -update-po: Makefile - $(MAKE) $(PACKAGE).pot - PATH=`pwd`/../src:$$PATH; \ - cd $(srcdir); \ - catalogs='$(CATALOGS)'; \ - for cat in $$catalogs; do \ - cat=`basename $$cat`; \ - lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - mv $$lang.po $$lang.old.po; \ - echo "$$lang:"; \ - if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \ - rm -f $$lang.old.po; \ - else \ - echo "msgmerge for $$cat failed!"; \ - rm -f $$lang.po; \ - mv $$lang.old.po $$lang.po; \ - fi; \ - done - -POTFILES: POTFILES.in - ( if test 'x$(srcdir)' != 'x.'; then \ - posrcprefix='$(top_srcdir)/'; \ - else \ - posrcprefix="../"; \ - fi; \ - rm -f $@-t $@ \ - && (sed -e '/^#/d' -e '/^[ ]*$$/d' \ - -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ - | sed -e '$$s/\\$$//') > $@-t \ - && chmod a-w $@-t \ - && mv $@-t $@ ) - -Makefile: Makefile.in.in ../config.status POTFILES - cd .. \ - && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ - $(SHELL) ./config.status - -# 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: diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/POTFILES.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/POTFILES.in deleted file mode 100644 index 8b9106da56..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/POTFILES.in +++ /dev/null @@ -1,19 +0,0 @@ -apps/gsmsmsd.cc -apps/gsmsendsms.cc -apps/gsmpb.cc -apps/gsmctl.cc -apps/gsmsmsstore.cc -gsmlib/gsm_at.cc -gsmlib/gsm_error.cc -gsmlib/gsm_event.cc -gsmlib/gsm_me_ta.cc -gsmlib/gsm_nls.cc -gsmlib/gsm_parser.cc -gsmlib/gsm_phonebook.cc -gsmlib/gsm_sms.cc -gsmlib/gsm_sms_codec.cc -gsmlib/gsm_sms_store.cc -gsmlib/gsm_unix_serial.cc -gsmlib/gsm_util.cc -gsmlib/gsm_sorted_phonebook.cc -gsmlib/gsm_sorted_sms_store.cc diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/cat-id-tbl.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/cat-id-tbl.c deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/de.gmo b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/de.gmo deleted file mode 100644 index 7ac755ac73..0000000000 Binary files a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/de.gmo and /dev/null differ diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/de.po b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/de.po deleted file mode 100644 index 4d21ec7011..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/de.po +++ /dev/null @@ -1,1758 +0,0 @@ -# ************************************************************************* -# * GSM TA/ME library -# * -# * File: de.po -# * -# * Purpose: German translations -# * -# * Author: Peter Hofmann (software@pxh.de) -# * -# * Created: 11.11.1999 -# ************************************************************************* -# , fuzzy -msgid "" -msgstr "" -"Project-Id-Version: gsmlib 1.5\n" -"POT-Creation-Date: 2002-10-22 22:48+0200\n" -"PO-Revision-Date: 2002-10-16 23:21+0200\n" -"Last-Translator: Peter Hofmann \n" -"Language-Team: Peter Hofmann\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-15\n" -"Content-Transfer-Encoding: 8bit\n" - -# , c-format -#: apps/gsmsmsd.cc:164 -#, c-format -msgid "could not execute '%s'" -msgstr "konnte '%s' nicht ausfhren" - -# , c-format -#: apps/gsmsmsd.cc:168 -#, c-format -msgid "error writing to '%s'" -msgstr "Fehler beim Schreiben zu '%s'" - -# , c-format -#: apps/gsmsmsd.cc:196 -#, c-format -msgid "error when calling opendir('%s')(errno: %d/%s)" -msgstr "Fehler beim Aufruf von opendir('%s') (errno: %d/%s)" - -# , c-format -#: apps/gsmsmsd.cc:225 -#, c-format -msgid "count not open SMS spool file %s" -msgstr "kann SMS Spool-Datei '%s' nicht ffnen" - -# , c-format -#: apps/gsmsmsd.cc:341 apps/gsmsendsms.cc:144 apps/gsmpb.cc:311 -#: apps/gsmctl.cc:380 apps/gsmsmsstore.cc:179 -#, c-format -msgid ": version %s [compiled %s]" -msgstr ": Version %s [kompiliert am %s]" - -#: apps/gsmsmsd.cc:346 -msgid "" -": [-a action][-b baudrate][-C sca][-d device][-f][-h][-I init string]\n" -" [-s spool dir][-t][-v]{sms_type}" -msgstr "" -": [-a Aktion][-b Baud-Rate][-C sca][-d Gert][-f][-h][-I Init String]\n" -" [-s Spoolverzeichnis][-t][-v]{SMS-Typ}" - -#: apps/gsmsmsd.cc:350 -msgid "" -" -a, --action the action to execute when an SMS arrives\n" -" (SMS is send to stdin of action)" -msgstr "" -" -a, --action die auszufhrende Aktion, wenn eine SMS eintrifft\n" -" (Kurznachricht wird zur Standardeingabe der Aktion\n" -" geschrieben)" - -#: apps/gsmsmsd.cc:354 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 "" -" -b, --baudrate fr das Gert zu verwendende Baud-Rate\n" -" (Voreinstellung: 38400)" - -#: apps/gsmsmsd.cc:357 -msgid " -c, --concatenate start ID for concatenated SMS messages" -msgstr " -c, --concatenate Start-ID fr verbundene SMS-Nachrichten" - -#: apps/gsmsmsd.cc:359 apps/gsmsendsms.cc:158 apps/gsmsmsstore.cc:200 -msgid " -C, --sca SMS service centre address" -msgstr " -C, --sca SMS service centre address" - -#: apps/gsmsmsd.cc:360 -msgid " -d, --device sets the device to connect to" -msgstr " -d, --device stellt das Ziel-Gert ein" - -#: apps/gsmsmsd.cc:361 -msgid " -D, --direct enable direct routing of SMSs" -msgstr "" -" -D, --direct direkte Weiterleitung von SMSs ohne Zwischenspeicherung" - -#: apps/gsmsmsd.cc:362 -msgid " -f, --flush flush SMS from store" -msgstr " -f, --flush lsche und bearbeite SMS im Speicher" - -#: apps/gsmsmsd.cc:363 apps/gsmsendsms.cc:161 apps/gsmpb.cc:332 -#: apps/gsmctl.cc:394 apps/gsmsmsstore.cc:204 -msgid " -h, --help prints this message" -msgstr " -h, --help gibt diesen Hilfetext aus" - -#: apps/gsmsmsd.cc:364 apps/gsmsendsms.cc:162 apps/gsmpb.cc:335 -#: apps/gsmctl.cc:395 apps/gsmsmsstore.cc:205 -msgid " -I, --init device AT init sequence" -msgstr " -I, --init AT-Initialisierungssequenz" - -#: apps/gsmsmsd.cc:365 apps/gsmsendsms.cc:163 -msgid " -r, --requeststat request SMS status report" -msgstr " -r, --requeststat fordert SMS-Statusreport an" - -#: apps/gsmsmsd.cc:366 -msgid " -s, --spool spool directory for outgoing SMS" -msgstr " -s, --spool Spool-Verzeichnis fr zu sendende SMS" - -#: apps/gsmsmsd.cc:368 -msgid "" -" -t, --store name of SMS store to use for flush\n" -" and/or temporary SMS storage" -msgstr "" -" -t, --store gibt den zu verwendenden SMS-Speicher an (fr flush-\n" -" Option und/oder temporren SMS-Speicher)" - -#: apps/gsmsmsd.cc:371 apps/gsmsendsms.cc:167 apps/gsmpb.cc:343 -#: apps/gsmctl.cc:399 apps/gsmsmsstore.cc:213 -msgid " -v, --version prints version and exits" -msgstr " -v, --version gibt Versionsnummer aus und terminiert" - -#: apps/gsmsmsd.cc:372 apps/gsmsendsms.cc:169 apps/gsmpb.cc:346 -#: apps/gsmctl.cc:400 apps/gsmsmsstore.cc:218 -msgid " -X, --xonxoff switch on software handshake" -msgstr " -X, --xonxoff Software Handshake anschalten" - -#: apps/gsmsmsd.cc:374 -msgid " sms_type may be any combination of" -msgstr " SMS-Typ kann aus den folgenden Parametern kombiniert werden:" - -#: apps/gsmsmsd.cc:375 -msgid " sms, no_sms controls reception of normal SMS" -msgstr " sms, no_sms schaltet Empfang von normalen SMS an bzw. aus" - -#: apps/gsmsmsd.cc:377 -msgid " cb, no_cb controls reception of cell broadcast messages" -msgstr "" -" cb, no_cb schaltet Empfang von Zellen-weiten Nachrichten an bzw. " -"aus" - -#: apps/gsmsmsd.cc:379 -msgid " stat, no_stat controls reception of status reports" -msgstr " stat, no_stat schaltet Empfang von Status-Reports an bzw. aus" - -#: apps/gsmsmsd.cc:381 -msgid " default is \"sms cb stat\"" -msgstr " Die Voreinstellung ist \"sms cb stat\"." - -#: apps/gsmsmsd.cc:382 -msgid "If no action is given, the SMS is printed to stdout" -msgstr "" -"Wenn keine Aktion angegeben ist, wird die SMS auf der Standardausgabe\n" -"angezeigt." - -#: apps/gsmsmsd.cc:387 apps/gsmsendsms.cc:178 apps/gsmpb.cc:354 -#: apps/gsmctl.cc:414 apps/gsmsmsstore.cc:223 -msgid "unknown option" -msgstr "unbekannte Option" - -# , c-format -#: apps/gsmsmsd.cc:426 -#, c-format -msgid "error when calling sigaction() (errno: %d/%s)" -msgstr "Fehler beim Aufruf von sigaction() (errno: %d/%s)" - -#: apps/gsmsmsd.cc:446 -msgid "store name must be given for flush option" -msgstr "Speichername mu angegeben werden fr flush-Option" - -#. process the new message -#: apps/gsmsmsd.cc:454 apps/gsmsmsd.cc:522 -msgid "Type of message: " -msgstr "Typ der Nachricht: " - -#: apps/gsmsmsd.cc:458 apps/gsmsmsd.cc:526 -msgid "SMS message\n" -msgstr "SMS Nachricht\n" - -#: apps/gsmsmsd.cc:461 -msgid "submit report message\n" -msgstr "Submit-Report-Nachricht\n" - -#: apps/gsmsmsd.cc:464 apps/gsmsmsd.cc:532 -msgid "status report message\n" -msgstr "Status-Report-Nachricht\n" - -#: apps/gsmsmsd.cc:529 -msgid "cell broadcast message\n" -msgstr "Zellen-weite Nachricht\n" - -#: apps/gsmsmsd.cc:585 apps/gsmsmsd.cc:587 apps/gsmsendsms.cc:253 -#: apps/gsmpb.cc:503 apps/gsmctl.cc:631 apps/gsmsmsstore.cc:435 -msgid "[ERROR]: " -msgstr "[FEHLER]: " - -#: apps/gsmsmsd.cc:588 -msgid "(try setting sms_type, please refer to gsmsmsd manpage)" -msgstr "" -"(versuchen Sie, den sms_type zu setzen; siehe auch gsmsmsd Manual-Seite)" - -#: apps/gsmsendsms.cc:149 -msgid "" -": [-b baudrate][-c concatenatedID][-C sca][-d device][-h][-I init string]\n" -" [-t][-v][-X] phonenumber [text]" -msgstr "" -": [-b Baud-Rate][-c concatenatedID][-C sca][-d Gert][-h][-I Init String]\n" -" [-t][-v][-X] Telefonnummer [Text]" - -#: apps/gsmsendsms.cc:156 -msgid " -c, --concatenate ID for concatenated SMS messages" -msgstr " -c, --concatenate ID fr verbundene SMS-Nachrichten" - -#: apps/gsmsendsms.cc:159 apps/gsmctl.cc:392 -msgid " -d, --device sets the destination device to connect to" -msgstr " -d, --device stellt das Ziel-Gert ein" - -#: apps/gsmsendsms.cc:164 -msgid "" -" -t, --test convert text to GSM alphabet and vice\n" -" versa, no SMS message is sent" -msgstr "" -" -t, --test konvertiert den Text in das GSM-Alphabet und\n" -" wieder zurck. Es wird keine SMS-Nachricht versendet." - -#: apps/gsmsendsms.cc:171 -msgid " phonenumber recipient's phone number" -msgstr " Telefonummer die Telefonnummer des Empfngers" - -#: apps/gsmsendsms.cc:172 -msgid "" -" text optional text of the SMS message\n" -" if omitted: read from stdin" -msgstr "" -" text Text der SMS-Nachricht (optional),\n" -" wenn nicht angegeben: lese von der Standardeingabe" - -#: apps/gsmsendsms.cc:205 -msgid "phone number and text missing" -msgstr "weder Telefonnummer noch Text angegeben" - -#: apps/gsmsendsms.cc:208 apps/gsmsmsstore.cc:261 -msgid "more than two parameters given" -msgstr "mehr als zwei Parameter angegeben" - -#: apps/gsmsendsms.cc:224 -msgid "text is larger than 160 characters" -msgstr "der Text ist lnger als 160 Zeichen" - -# , c-format -#: apps/gsmpb.cc:102 apps/gsmpb.cc:491 -#, c-format -msgid "inserting '%s' tel# %s" -msgstr "fge ein '%s' Tel# %s" - -# , c-format -#: apps/gsmpb.cc:105 apps/gsmpb.cc:230 apps/gsmpb.cc:494 -#, c-format -msgid " (index #%d)" -msgstr " (Index #%d)" - -# , c-format -#: apps/gsmpb.cc:144 -#, c-format -msgid "updating '%s' tel# %s to new tel# %s" -msgstr "berschreibe '%s' Tel# %s mit neuer Tel# %s" - -# , c-format -#: apps/gsmpb.cc:177 -#, c-format -msgid "updating '%s' tel# %s to new tel# %s(index %d)" -msgstr "berschreibe '%s' Tel# %s mit neuer Tel# %s (Index %d)" - -# , c-format -#: apps/gsmpb.cc:227 -#, c-format -msgid "deleting '%s' tel# %s" -msgstr "lsche '%s' Tel# %s" - -#: apps/gsmpb.cc:316 -msgid "" -": [-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]" -msgstr "" -": [-b Baud-Rate][-c][-d Gert oder Datei][-h][-I Init String]\n" -" [-p Telefonbuchname][-s Gert oder Datei][-t Zeichensatz][-v][-V][-y][-X]" - -#: apps/gsmpb.cc:325 -msgid " -c, --copy copy source entries to destination" -msgstr " -c, --copy kopiere Quell-Eintrge zum Zielgert/-datei" - -#: apps/gsmpb.cc:327 -msgid "" -" -d, --destination sets the destination device to connect \n" -" to, or the file to write" -msgstr " -d, --destination setzt das Zielgert bzw. die Zieldatei" - -#: apps/gsmpb.cc:330 -msgid " -D, --destination-backend sets the destination backend" -msgstr " -D, --destination-backend stellt den Typ des Ziel-Backends ein" - -#: apps/gsmpb.cc:333 -msgid " -i, --index takes index positions into account" -msgstr " -i, --index bercksichtige die Indexpositionen der Eintrge" - -#: apps/gsmpb.cc:336 -msgid " -p, --phonebook name of phonebook to use" -msgstr " -p, --phonebook Name des zu verwendenden Telefonbuchs" - -#: apps/gsmpb.cc:337 apps/gsmsmsstore.cc:210 -msgid "" -" -s, --source sets the source device to connect to,\n" -" or the file to read" -msgstr " -s, --source setzt das Quellgert bzw. die Quelldatei" - -#: apps/gsmpb.cc:339 -msgid "" -" -t, --charset sets the character set to use for\n" -" phonebook entries" -msgstr " -t, --charset setzt den Zeichensatz fr Telefonbucheintrge" - -#: apps/gsmpb.cc:341 -msgid " -S, --source-backend sets the source backend" -msgstr " -S, --source-backend stellt den Typ des Ziel-Backends ein" - -#: apps/gsmpb.cc:344 apps/gsmsmsstore.cc:214 -msgid " -V, --verbose print detailed progress messages" -msgstr " -V, --verbose gibt detaillierte Fortschrittsmeldungen aus" - -#: apps/gsmpb.cc:347 -msgid "" -" -y, --synchronize synchronize destination with source\n" -" entries (destination is overwritten)\n" -" (see gsmpb(1) for details)" -msgstr "" -" -y, --synchronize synchronisiere das Zielgert/-datei mit der Quelle\n" -" (Zieleintrge werden eventuell berschrieben)\n" -" (siehe gsmpb(1) fr weitere Details)" - -#: apps/gsmpb.cc:360 -msgid "both source and destination must be given" -msgstr "sowohl Quellgert/-datei als auch Zielgert/-datei erforderlich" - -#: apps/gsmpb.cc:374 apps/gsmpb.cc:416 -msgid "phonebook name must be given" -msgstr "ein Telefonbuchname mu angegeben werden" - -# , c-format -#: apps/gsmpb.cc:441 -#, c-format -msgid "" -"text '%s' is too large to fit into destination (maximum size %d characters)" -msgstr "" -"Text '%s' ist zu gro fr das Zielgert (maximale Textlnge %d Zeichen)" - -# , c-format -#: apps/gsmpb.cc:447 -#, c-format -msgid "" -"phone number '%s' is too large to fit into destination (maximum size %d " -"characters)" -msgstr "" -"Telefonnummer '%s' ist zu gro fr das Zielgert (maximale Lnge %d Zeichen)" - -#: apps/gsmctl.cc:90 -msgid "active " -msgstr "aktiv" - -#: apps/gsmctl.cc:90 -msgid "inactive " -msgstr "inaktiv" - -#: apps/gsmctl.cc:91 -msgid "number: " -msgstr "Telefonnummer: " - -#: apps/gsmctl.cc:92 -msgid " subaddr: " -msgstr " Unteradresse: " - -#: apps/gsmctl.cc:93 -msgid " time: " -msgstr " Zeit: " - -#: apps/gsmctl.cc:105 -msgid " Manufacturer: " -msgstr " Hersteller: " - -#: apps/gsmctl.cc:106 -msgid " Model: " -msgstr " Modell: " - -#: apps/gsmctl.cc:107 -msgid " Revision: " -msgstr " Revision: " - -#: apps/gsmctl.cc:108 -msgid " Serial Number: " -msgstr " Seriennummer: " - -#: apps/gsmctl.cc:116 apps/gsmctl.cc:118 -msgid " Functionality Level: " -msgstr " Funktionalitts-Level: " - -#: apps/gsmctl.cc:118 -msgid "unsupported" -msgstr "Kommando nicht untersttzt" - -#: apps/gsmctl.cc:128 -msgid "> Status: " -msgstr "> Status: " - -#: apps/gsmctl.cc:131 gsmlib/gsm_error.cc:104 gsmlib/gsm_sms.cc:441 -#: gsmlib/gsm_sms_codec.cc:204 -msgid "unknown" -msgstr "unbekannt" - -#: apps/gsmctl.cc:132 -msgid "current" -msgstr "aktuell" - -#: apps/gsmctl.cc:133 -msgid "available" -msgstr "verfgbar" - -#: apps/gsmctl.cc:134 -msgid "forbidden" -msgstr "nicht whlbar" - -#: apps/gsmctl.cc:136 apps/gsmctl.cc:147 -msgid " Long name: '" -msgstr " Langname: '" - -#: apps/gsmctl.cc:137 apps/gsmctl.cc:148 -msgid " Short name: '" -msgstr " Kurzname: '" - -#: apps/gsmctl.cc:138 apps/gsmctl.cc:149 -msgid " Numeric name: " -msgstr " Numerischer Name: " - -#: apps/gsmctl.cc:150 -msgid " Mode: " -msgstr " Modus: " - -#: apps/gsmctl.cc:153 -msgid "automatic" -msgstr "automatisch" - -#: apps/gsmctl.cc:154 -msgid "manual" -msgstr "manuell" - -#: apps/gsmctl.cc:155 -msgid "deregister" -msgstr "abmelden" - -#: apps/gsmctl.cc:156 -msgid "manual/automatic" -msgstr "manuell/automatisch" - -#: apps/gsmctl.cc:172 apps/gsmctl.cc:247 -msgid " Voice" -msgstr " Sprache" - -#: apps/gsmctl.cc:176 apps/gsmctl.cc:185 apps/gsmctl.cc:194 -msgid " unknown" -msgstr " unbekannt" - -#: apps/gsmctl.cc:181 apps/gsmctl.cc:249 -msgid " Data" -msgstr " Daten" - -#: apps/gsmctl.cc:190 apps/gsmctl.cc:251 -msgid " Fax" -msgstr " Fax" - -#: apps/gsmctl.cc:229 -msgid "on" -msgstr "an" - -#: apps/gsmctl.cc:229 -msgid "off" -msgstr "aus" - -#: apps/gsmctl.cc:239 -msgid "UnconditionalReason" -msgstr "\"Alle Anrufe\"" - -#: apps/gsmctl.cc:240 -msgid "MobileBusyReason" -msgstr "\"Mobiltelefon besetzt\"" - -#: apps/gsmctl.cc:241 -msgid "NoReplyReason" -msgstr "\"Keine Antwort\"" - -#: apps/gsmctl.cc:242 -msgid "NotReachableReason" -msgstr "\"Nicht erreichbar\"" - -#: apps/gsmctl.cc:261 -msgid "0 ME is powered by the battery" -msgstr "0 ME wird von der Batterie gespeist" - -#: apps/gsmctl.cc:262 -msgid "1 ME has a battery connected, but is not powered by it" -msgstr "1 ME-Batterie ist vorhanden, liefert aber keinen Strom" - -#: apps/gsmctl.cc:264 -msgid "2 ME does not have a battery connected" -msgstr "2 ME-Batterie nicht angeschlossen" - -#: apps/gsmctl.cc:266 -msgid "3 Recognized power fault, calls inhibited" -msgstr "3 Problem mit der Energieversorgung, keine Anrufe mglich" - -# , c-format -#: apps/gsmctl.cc:323 -#, c-format -msgid "unknown facility class parameter '%c'" -msgstr "unbekannter Dienstmerkmal-Parameter '%c'" - -# , c-format -#: apps/gsmctl.cc:336 -#, c-format -msgid "not enough parameters, minimum number of parameters is %d" -msgstr "nicht gengend Parameter, die Mindestanzahl der Parameter ist %d" - -# , c-format -#: apps/gsmctl.cc:340 -#, c-format -msgid "too many parameters, maximum number of parameters is %d" -msgstr "zu viele Parameter, die Maximalanzahl der Parameter ist %d" - -#: apps/gsmctl.cc:385 -msgid "" -": [-b baudrate][-d device][-h][-I init string][-o operation]\n" -" [-v][-X]{parameters}" -msgstr "" -": [-b Baud-Rate][-d Gert][-h][-I Init String][-o Operation]\n" -" [-v][-X]{Parameter}" - -#: apps/gsmctl.cc:396 -msgid "" -" -o, --operation operation to perform on the mobile \n" -" phone with the specified parameters" -msgstr "" -" -o, --operation gibt die Operation an, die auf dem Mobiltelefon\n" -" mit den angegebenen Parametern ausgefhrt werden soll" - -#: apps/gsmctl.cc:402 -msgid "" -" 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" -msgstr "" -" Parameter die fr die Operation zu verwendenden Parameter\n" -" (wenn eine Operation ausgefhrt werden soll) oder\n" -" die Spezifikation der vom Mobiltelefon zu lesenden\n" -" Informationen" - -#: apps/gsmctl.cc:408 -msgid "" -"Refer to gsmctl(1) for details on the available parameters and operations." -msgstr "" -"Bitte beziehen Sie sich auf die Manual-Seite gsmctl(1) fr weitere Details\n" -"ber die untersttzten Parameter und Operationen." - -# , c-format -#: apps/gsmctl.cc:471 -#, c-format -msgid "unknown information parameter '%s'" -msgstr "unbekannter Informations-Parameter '%s'" - -# , c-format -#: apps/gsmctl.cc:520 -#, c-format -msgid "unknown opmode parameter '%s'" -msgstr "Unbekannter (Operations-)Modus-Parameter '%s'" - -# , c-format -#: apps/gsmctl.cc:588 -#, c-format -msgid "unknown forward reason parameter '%s'" -msgstr "unbekannter Weiterleitungsgrund-Parameter '%s'" - -# , c-format -#: apps/gsmctl.cc:604 -#, c-format -msgid "unknown forward mode parameter '%s'" -msgstr "unbekannter Weiterleitungs-Modus-Parameter '%s'" - -# , c-format -#: apps/gsmctl.cc:625 -#, c-format -msgid "unknown operation '%s'" -msgstr "unbekannte Operation '%s'" - -# , c-format -#: apps/gsmsmsstore.cc:91 apps/gsmsmsstore.cc:363 apps/gsmsmsstore.cc:380 -#, c-format -msgid "inserting entry #%d from source into destination" -msgstr "fge Eintrag #%d von Quellgert/-datei in Zielgert/-datei ein" - -# , c-format -#: apps/gsmsmsstore.cc:102 -#, c-format -msgid "incompatible options '%c' and '%c'" -msgstr "inkompatible Optionen '%c' und '%c'" - -#: apps/gsmsmsstore.cc:184 -msgid "" -": [-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]" -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}|[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 (Telefonnummer und\n" -" Text) in das Zielgert/-datei ein" - -#: apps/gsmsmsstore.cc:197 -msgid "" -" -c, --copy copy source entries to destination\n" -" (if indices are given, copy only these entries)" -msgstr "" -" -c, --copy kopiere Quell-Eintrge in das Zielgert/-datei\n" -" (wenn Indices angegeben sind, kopiere nur diese Eintrge)" - -#: apps/gsmsmsstore.cc:201 -msgid "" -" -d, --destination sets the destination device to\n" -" connect to, or the file to write to" -msgstr " -d, --destination setzt das Zielgert bzw. die Zieldatei" - -#: apps/gsmsmsstore.cc:206 -msgid "" -" -k, --backup backup new entries to destination\n" -" (if indices are given, copy only these entries)" -msgstr "" -" -k, --backup sichert alle neuen Eintrge in die Zieldatei/-gert\n" -" (wenn Indices angegeben sind, sichere nur diese Eintrge)" - -#: apps/gsmsmsstore.cc:209 -msgid " -l, --list list source to stdout" -msgstr "" -" -l, --list schreibe Liste der Quelleintrge auf die Standardausgabe" - -#: apps/gsmsmsstore.cc:212 -msgid " -t, --store name of SMS store to use" -msgstr " -t, --store gibt den zu verwendenden SMS-Speicher an" - -#: apps/gsmsmsstore.cc:216 -msgid " -x, --delete delete entries denoted by indices" -msgstr "" -" -x, --delete lsche die durch die Indices spezifizierten Eintrge" - -#: apps/gsmsmsstore.cc:229 -msgid "no operation option given" -msgstr "keine Operations-Option angegeben" - -#: apps/gsmsmsstore.cc:232 -msgid "both source and destination required" -msgstr "sowohl Quellgert/-datei als auch Zielgert/-datei erforderlich" - -#: apps/gsmsmsstore.cc:237 -msgid "destination must not be given" -msgstr "Zielgert/-datei darf nicht angegeben werden" - -#: apps/gsmsmsstore.cc:239 -msgid "source required" -msgstr "Quellgert/-datei erforderlich" - -#: apps/gsmsmsstore.cc:244 -msgid "source must not be given" -msgstr "Quellgert/-datei darf nicht angegeben werden" - -#: apps/gsmsmsstore.cc:246 -msgid "destination required" -msgstr "Zielgert/-datei erforderlich" - -# , c-format -#: apps/gsmsmsstore.cc:254 gsmlib/gsm_util.cc:285 -#, c-format -msgid "expected number, got '%s'" -msgstr "Zahl erwartet, nicht '%s'" - -#: apps/gsmsmsstore.cc:264 -msgid "not enough parameters given" -msgstr "nicht gengend Parameter angegeben" - -#: apps/gsmsmsstore.cc:269 -msgid "unexpected parameters" -msgstr "unerwartete Parameter" - -#: apps/gsmsmsstore.cc:280 apps/gsmsmsstore.cc:317 -msgid "store name must be given" -msgstr "Speichername mu angegeben werden" - -# , c-format -#: apps/gsmsmsstore.cc:344 apps/gsmsmsstore.cc:377 -#, c-format -msgid "no index '%s' in source" -msgstr "kein Index '%s' in der Quelldatei/-gert" - -# , c-format -#: apps/gsmsmsstore.cc:392 -#, c-format -msgid "index #%d" -msgstr "Index #%d" - -#: apps/gsmsmsstore.cc:406 -msgid "inserting new entry into destination" -msgstr "fge neuen Eintrag in das Zielgert/-datei ein" - -# , c-format -#: apps/gsmsmsstore.cc:421 -#, c-format -msgid "deleting entry #%d from destination" -msgstr "lsche Eintrag #%d von Zielgert/-datei" - -# , c-format -#: apps/gsmsmsstore.cc:426 -#, c-format -msgid "no index '%s' in destination" -msgstr "kein Index '%s' in Zielgert/-datei" - -#: gsmlib/gsm_at.cc:66 -msgid "unspecified ME/TA error" -msgstr "unspezifizierter ME/TA-Fehler" - -#: gsmlib/gsm_at.cc:76 -msgid "ME/TA error '" -msgstr "ME/TA-Fehler '" - -# , c-format -#: gsmlib/gsm_at.cc:80 -#, c-format -msgid "(code %s)" -msgstr "(Code %s)" - -#: gsmlib/gsm_at.cc:125 gsmlib/gsm_at.cc:215 gsmlib/gsm_at.cc:344 -msgid "ME/TA error '' (code not known)" -msgstr "ME/TA-Fehler '' (Code nicht bekannt)" - -# , c-format -#: gsmlib/gsm_at.cc:184 gsmlib/gsm_at.cc:365 -#, c-format -msgid "unexpected response '%s' when sending 'AT%s'" -msgstr "unerwartete Antwort '%s' beim Senden von 'AT%s'" - -#: gsmlib/gsm_at.cc:318 -msgid "unexpected character in PDU handshake" -msgstr "unerwartetes Zeichen im PDU-Handshake" - -#: gsmlib/gsm_error.cc:29 -msgid "phone failure" -msgstr "Telefon-Fehler" - -#: gsmlib/gsm_error.cc:32 -msgid "no connection to phone" -msgstr "keine Verbindung zum Telefon" - -#: gsmlib/gsm_error.cc:35 -msgid "phone adaptor link reserved" -msgstr "Telefonadapter-Verbindung reserviert" - -#: gsmlib/gsm_error.cc:38 gsmlib/gsm_error.cc:259 -msgid "operation not allowed" -msgstr "Operation nicht erlaubt" - -#: gsmlib/gsm_error.cc:41 gsmlib/gsm_error.cc:262 -msgid "operation not supported" -msgstr "Operation nicht untersttzt" - -#: gsmlib/gsm_error.cc:44 -msgid "ph SIM PIN required" -msgstr "ph SIM PIN erforderlich" - -#: gsmlib/gsm_error.cc:47 gsmlib/gsm_error.cc:271 -msgid "SIM not inserted" -msgstr "SIM nicht eingesteckt" - -#: gsmlib/gsm_error.cc:50 gsmlib/gsm_error.cc:274 -msgid "SIM PIN required" -msgstr "SIM PIN erforderlich" - -#: gsmlib/gsm_error.cc:53 gsmlib/gsm_error.cc:289 -msgid "SIM PUK required" -msgstr "SIM PUK erforderlich" - -#: gsmlib/gsm_error.cc:56 gsmlib/gsm_error.cc:280 -msgid "SIM failure" -msgstr "SIM-Fehler" - -#: gsmlib/gsm_error.cc:59 gsmlib/gsm_error.cc:283 -msgid "SIM busy" -msgstr "SIM beschftigt" - -#: gsmlib/gsm_error.cc:62 gsmlib/gsm_error.cc:286 -msgid "SIM wrong" -msgstr "falsche SIM" - -#: gsmlib/gsm_error.cc:65 -msgid "incorrect password" -msgstr "falsches Pawort" - -#: gsmlib/gsm_error.cc:68 gsmlib/gsm_error.cc:292 -msgid "SIM PIN2 required" -msgstr "SIM PIN2 erforderlich" - -#: gsmlib/gsm_error.cc:71 gsmlib/gsm_error.cc:295 -msgid "SIM PUK2 required" -msgstr "SIM PUK2 erforderlich" - -#: gsmlib/gsm_error.cc:74 gsmlib/gsm_error.cc:304 -msgid "memory full" -msgstr "Speicher voll" - -#: gsmlib/gsm_error.cc:77 -msgid "invalid index" -msgstr "ungltiger Index" - -#: gsmlib/gsm_error.cc:80 -msgid "not found" -msgstr "nicht gefunden" - -#: gsmlib/gsm_error.cc:83 gsmlib/gsm_error.cc:298 -msgid "memory failure" -msgstr "Speicher-Fehler" - -#: gsmlib/gsm_error.cc:86 -msgid "text string too long" -msgstr "Zeichenkette zu lang" - -#: gsmlib/gsm_error.cc:89 -msgid "invalid characters in text string" -msgstr "ungltige Zeichen in der Zeichenkette" - -#: gsmlib/gsm_error.cc:92 -msgid "dial string too long" -msgstr "zu whlende Telefonnummer zu lang" - -#: gsmlib/gsm_error.cc:95 -msgid "invalid characters in dial string" -msgstr "ungltige Zeichen in zu whlender Telefonnummer" - -#: gsmlib/gsm_error.cc:98 gsmlib/gsm_error.cc:310 -msgid "no network service" -msgstr "kein Netz" - -#: gsmlib/gsm_error.cc:101 gsmlib/gsm_error.cc:313 -msgid "network timeout" -msgstr "Netz-Zeitberschreitung" - -# , c-format -#: gsmlib/gsm_error.cc:107 -#, c-format -msgid "invalid ME error %d" -msgstr "ungltiger ME-Fehler %d" - -#: gsmlib/gsm_error.cc:117 -msgid "Unassigned (unallocated) number" -msgstr "nicht zugewiesene Nummer" - -#: gsmlib/gsm_error.cc:120 -msgid "Operator determined barring" -msgstr "vom Operator geschaltete Sperre" - -#: gsmlib/gsm_error.cc:123 -msgid "Call barred" -msgstr "Rufsperre" - -#: gsmlib/gsm_error.cc:126 -msgid "Network failure" -msgstr "Netz-Fehler" - -#: gsmlib/gsm_error.cc:129 -msgid "Short message transfer rejected" -msgstr "Kurznachrichten-bertragung zurckgewiesen" - -#: gsmlib/gsm_error.cc:133 gsmlib/gsm_error.cc:355 -msgid "Congestion" -msgstr "Netzberlastung" - -#: gsmlib/gsm_error.cc:136 -msgid "Destination out of service" -msgstr "Ziel auer Betrieb" - -#: gsmlib/gsm_error.cc:139 -msgid "Unidentified subscriber" -msgstr "unidentifizierter Teilnehmer" - -#: gsmlib/gsm_error.cc:142 -msgid "Facility rejected" -msgstr "Dienstmerkmal zurckgewiesen" - -#: gsmlib/gsm_error.cc:145 -msgid "Unknown subscriber" -msgstr "unbekannter Teilnehmer" - -#: gsmlib/gsm_error.cc:148 -msgid "Network out of order" -msgstr "Netz auer Betrieb" - -#: gsmlib/gsm_error.cc:151 -msgid "Temporary failure" -msgstr "temporrer Fehler" - -#: gsmlib/gsm_error.cc:154 -msgid "Resources unavailable, unspecified" -msgstr "Ressourcen nicht verfgbar, nicht spezifiziert" - -#: gsmlib/gsm_error.cc:157 -msgid "Requested facility not subscribed" -msgstr "angefordertes Dienstmerkmal nicht freigeschaltet" - -#: gsmlib/gsm_error.cc:160 -msgid "Requested facility not implemented" -msgstr "angefordertes Dienstmerkmal nicht implementiert" - -#: gsmlib/gsm_error.cc:163 -msgid "Invalid Transaction Identifier" -msgstr "ungltiger Transaktionsbezeichner" - -#: gsmlib/gsm_error.cc:166 -msgid "Semantically incorrect message" -msgstr "semantisch fehlerhafte Nachricht" - -#: gsmlib/gsm_error.cc:169 -msgid "Invalid mandatory information" -msgstr "ungltige, obligatorische Information" - -#: gsmlib/gsm_error.cc:172 -msgid "Message type non-existent or not implemented" -msgstr "Nachrichtentyp nicht existent bzw. nicht implementiert" - -#: gsmlib/gsm_error.cc:175 -msgid "Message not compatible with short message protocol state" -msgstr "Nachricht nicht vereinbar mit Kurznachrichten-Protokollstatus" - -#: gsmlib/gsm_error.cc:178 -msgid "Information element non-existent or not implemented" -msgstr "Informationselement nicht existent oder nicht implementiert" - -#: gsmlib/gsm_error.cc:181 -msgid "Protocol error, unspecified" -msgstr "Protokollfehler, nicht spezifiziert" - -#: gsmlib/gsm_error.cc:184 -msgid "Interworking, unspecified" -msgstr "Interworking, nicht spezifiziert" - -#: gsmlib/gsm_error.cc:187 -msgid "Telematic interworking not supported" -msgstr "Telematisches Interworking nicht untersttzt" - -#: gsmlib/gsm_error.cc:190 -msgid "Short message Type 0 not supported" -msgstr "Kurznachrichtentyp 0 nicht untersttzt" - -#: gsmlib/gsm_error.cc:193 -msgid "Cannot replace short message" -msgstr "kann Kurznachricht nicht ersetzen" - -#: gsmlib/gsm_error.cc:196 -msgid "Unspecified TP-PID error" -msgstr "unspezifizierter TP-PID-Fehler" - -#: gsmlib/gsm_error.cc:199 -msgid "Data coding scheme (alphabet) not supported" -msgstr "Datenkodierungsschema (Alphabet) nicht untersttzt" - -#: gsmlib/gsm_error.cc:202 -msgid "Message class not supported" -msgstr "Nachrichtenklasse nicht untersttzt" - -#: gsmlib/gsm_error.cc:205 -msgid "Unspecifiec TP-DCS error" -msgstr "unspezifizierter TP-DCS-Fehler" - -#: gsmlib/gsm_error.cc:208 -msgid "Command cannot be actioned" -msgstr "Kommando kann nicht ausgefhrt werden" - -#: gsmlib/gsm_error.cc:211 -msgid "Command unsupported" -msgstr "Kommando nicht untersttzt" - -#: gsmlib/gsm_error.cc:214 -msgid "Unspecified TP-Command error" -msgstr "unspezifizierter TP-Kommando-Fehler" - -#: gsmlib/gsm_error.cc:217 -msgid "TPDU not supported" -msgstr "TPDU nicht untersttzt" - -#: gsmlib/gsm_error.cc:220 -msgid "SC busy" -msgstr "SC besetzt" - -#: gsmlib/gsm_error.cc:223 -msgid "No SC subscription" -msgstr "SC nicht freigeschaltet" - -#: gsmlib/gsm_error.cc:226 -msgid "SC system failure" -msgstr "SC-Systemfehler" - -#: gsmlib/gsm_error.cc:229 -msgid "Invalid SME address" -msgstr "ungltige SME-Adresse" - -#: gsmlib/gsm_error.cc:232 -msgid "Destination SME barred" -msgstr "Ziel-SME gesperrt" - -#: gsmlib/gsm_error.cc:235 -msgid "SM Rejected-Duplicated SM" -msgstr "Kurznachricht zurckgewiesen - doppelte Kurznachricht" - -#: gsmlib/gsm_error.cc:238 -msgid "SIM SMS storage full" -msgstr "SIM-SMS-Speicher voll" - -#: gsmlib/gsm_error.cc:241 -msgid "No SMS storage capability in SIM" -msgstr "Keine SMS-Speicherfhigkeit in SIM" - -#: gsmlib/gsm_error.cc:244 -msgid "Error in MS" -msgstr "Fehler im MS" - -#: gsmlib/gsm_error.cc:247 -msgid "Memory Capacity Exceed" -msgstr "Speicherkapazitt berschritten" - -#: gsmlib/gsm_error.cc:250 -msgid "Unspecified error cause" -msgstr "unspezifizierter Fehlergrund" - -#: gsmlib/gsm_error.cc:253 -msgid "ME failure" -msgstr "ME-Fehler" - -#: gsmlib/gsm_error.cc:256 -msgid "SMS service of ME reserved" -msgstr "SMS-Dienst im ME reserviert" - -#: gsmlib/gsm_error.cc:265 -msgid "invalid PDU mode parameter" -msgstr "ungltiger PDU-Modus-Parameter" - -#: gsmlib/gsm_error.cc:268 -msgid "invalid text mode parameter" -msgstr "ungltiger Text-Modus-Parameter" - -#: gsmlib/gsm_error.cc:277 -msgid "PH-SIM PIN required" -msgstr "PH-SIM PIN erforderlich" - -#: gsmlib/gsm_error.cc:301 -msgid "invalid memory index" -msgstr "ungltiger Speicherindex" - -#: gsmlib/gsm_error.cc:307 -msgid "SMSC address unknown" -msgstr "SMSC-Adresse nicht bekannt" - -#: gsmlib/gsm_error.cc:316 -msgid "no +CNMA acknowledgement expected" -msgstr "keine +CNMA-Besttigung erwartet" - -#: gsmlib/gsm_error.cc:319 -msgid "unknown error" -msgstr "unbekannter Fehler" - -# , c-format -#: gsmlib/gsm_error.cc:322 -#, c-format -msgid "invalid SMS error %d" -msgstr "ungltiger SMS-Fehler %d" - -#: gsmlib/gsm_error.cc:335 -msgid "Short message received by the SME" -msgstr "Kurznachricht von der SME empfangen" - -#: gsmlib/gsm_error.cc:338 -msgid "" -"Short message forwarded by the SC to the SME but the SC is unable to confirm " -"delivery" -msgstr "" -"die Kurznachricht wurde vom SC zur SME weitergeleitet, aber das SC ist nicht " -"in der Lage, den Empfang zu besttigen" - -#: gsmlib/gsm_error.cc:342 -msgid "Short message replaced by the SC" -msgstr "Kurznachricht wurde vom SC ersetzt" - -#: gsmlib/gsm_error.cc:345 gsmlib/gsm_error.cc:373 gsmlib/gsm_error.cc:418 -msgid "reserved" -msgstr "reserviert" - -#: gsmlib/gsm_error.cc:358 -msgid "SME busy" -msgstr "SME besetzt" - -#: gsmlib/gsm_error.cc:361 -msgid "No response from SME" -msgstr "keine Antwort vom SME" - -#: gsmlib/gsm_error.cc:364 -msgid "Service rejected" -msgstr "Dienst zurckgewiesen" - -#: gsmlib/gsm_error.cc:367 gsmlib/gsm_error.cc:400 -msgid "Quality of service not available" -msgstr "Dienstqualitt nicht verfgbar" - -#: gsmlib/gsm_error.cc:370 -msgid "Error in SME" -msgstr "Fehler im SME" - -#: gsmlib/gsm_error.cc:377 -msgid " (Temporary error, SC is not making any more transfer attempts)" -msgstr " (temporrer Fehler, SC macht keine weiteren bertragungsversuche)" - -#: gsmlib/gsm_error.cc:380 -msgid " (Temporary error, SC still trying to transfer SM)" -msgstr " (temporrer Fehler, SC versucht weiterhin die SM zu bertragen)" - -#: gsmlib/gsm_error.cc:388 -msgid "Remote Procedure Error" -msgstr "Fern-Prozedur-Aufrufs-Fehler" - -#: gsmlib/gsm_error.cc:391 -msgid "Incompatible destination" -msgstr "inkompatibles Ziel" - -#: gsmlib/gsm_error.cc:394 -msgid "Connection rejected by SME" -msgstr "Verbindung vom SME zurckgewiesen" - -#: gsmlib/gsm_error.cc:397 -msgid "Not obtainable" -msgstr "nicht verfgbar" - -#: gsmlib/gsm_error.cc:403 -msgid "No interworking available" -msgstr "kein Interworking verfgbar" - -#: gsmlib/gsm_error.cc:406 -msgid "SM validity period expired" -msgstr "SM-Gltigkeitszeitraum berschritten" - -#: gsmlib/gsm_error.cc:409 -msgid "SM deleted by originating SME" -msgstr "SM von der sendenden SME gelscht" - -#: gsmlib/gsm_error.cc:412 -msgid "SM deleted by SC administration" -msgstr "SM von der SC-Administration gelscht" - -#: gsmlib/gsm_error.cc:415 -msgid "SM does not exit" -msgstr "SM macht keinen Exit" - -#: gsmlib/gsm_error.cc:421 -msgid " (Permanent Error, SC is not making any more transfer attempts)" -msgstr " (permanenter Fehler, SC macht keine weiteren bertragungsversuche)" - -# , c-format -#: gsmlib/gsm_event.cc:80 -#, c-format -msgid "unexpected number format %d" -msgstr "unerwartetes Telefonnummernformat %d" - -# , c-format -#: gsmlib/gsm_event.cc:100 -#, c-format -msgid "unexpected unsolicited event '%s'" -msgstr "unerwartetes asynchrones Ereignis '%s'" - -#: gsmlib/gsm_me_ta.cc:536 -msgid "unable to set operator" -msgstr "kann den Netzbetreiber nicht setzen" - -#: gsmlib/gsm_me_ta.cc:663 -msgid "call forward time must be in the range 0..30" -msgstr "Rufumleitungszeit muss im Bereich 0..30 sein" - -#: gsmlib/gsm_me_ta.cc:811 -msgid "Functionality Level commands not supported by ME" -msgstr "" -"Funktionalitts-Level-Kommandos werden vom Gert (ME) nicht untersttzt" - -#. If the number was just out of range, we get here. -#: gsmlib/gsm_me_ta.cc:830 -msgid "Requested Functionality Level out of range" -msgstr "Angeforderter Funktionalitts-Level auerhalb des erlaubten Bereichs" - -#: gsmlib/gsm_me_ta.cc:941 -msgid "unsupported alphabet for SMS" -msgstr "nicht untersttztes Alphabet fr SMS" - -#: gsmlib/gsm_me_ta.cc:950 -msgid "SMS text is larger than allowed" -msgstr "SMS-Text ist lnger als erlaubt" - -#: gsmlib/gsm_me_ta.cc:962 -msgid "not more than 255 concatenated SMSs allowed" -msgstr "nicht mehr als 255 verbundene SMSs erlaubt" - -#: gsmlib/gsm_me_ta.cc:995 -msgid "only serviceLevel 0 or 1 supported" -msgstr "nur Dienst-Level 0 oder 1 untersttzt" - -#: gsmlib/gsm_me_ta.cc:1108 gsmlib/gsm_me_ta.cc:1150 -msgid "cannot route SMS messages to TE" -msgstr "kann keine Kurznachrichten zum TE weiterleiten" - -#: gsmlib/gsm_me_ta.cc:1122 gsmlib/gsm_me_ta.cc:1164 -msgid "cannot route cell broadcast messages to TE" -msgstr "kann keine Zellen-weiten Nachrichten zum TE weiterleiten" - -#: gsmlib/gsm_me_ta.cc:1134 -msgid "cannot route status reports messages to TE" -msgstr "kann keine Status-Report-Nachrichten zum TE weiterleiten" - -#: gsmlib/gsm_me_ta.cc:1178 -msgid "cannot route status report messages to TE" -msgstr "kann keine Status-Report-Nachrichten zum TE weiterleiten" - -#: gsmlib/gsm_parser.cc:51 -msgid "expected parameter" -msgstr "Parameter erwartet" - -#: gsmlib/gsm_parser.cc:71 -msgid "expected '\"'" -msgstr "'\"' erwartet" - -#: gsmlib/gsm_parser.cc:109 -msgid "expected number" -msgstr "Zahl erwartet" - -# , c-format -#: gsmlib/gsm_parser.cc:120 -#, c-format -msgid "unexpected end of string '%s'" -msgstr "unerwartetes Ende der Zeichenkette '%s'" - -# , c-format -#: gsmlib/gsm_parser.cc:124 -#, c-format -msgid " (at position %d of string '%s')" -msgstr " (an Position %d der Zeichenkette '%s')" - -# , c-format -#: gsmlib/gsm_parser.cc:141 -#, c-format -msgid "expected '%c'" -msgstr "'%c' erwartet" - -#: gsmlib/gsm_parser.cc:165 -msgid "expected ')' or ','" -msgstr "')' oder ',' erwartet" - -#: gsmlib/gsm_parser.cc:251 -msgid "expected ')', ',' or '-'" -msgstr "')', ',' oder '-' erwartet" - -#: gsmlib/gsm_parser.cc:257 -msgid "range of the form a-b-c not allowed" -msgstr "Bereich der Form a-b-c nicht erlaubt" - -#: gsmlib/gsm_parser.cc:264 -msgid "range of the form a- no allowed" -msgstr "Bereich der Form a- nicht erlaubt" - -#: gsmlib/gsm_parser.cc:350 -msgid "expected comma" -msgstr "Komma erwartet" - -#: gsmlib/gsm_parser.cc:367 -msgid "expected end of line" -msgstr "Zeilenende erwartet" - -# , c-format -#: gsmlib/gsm_phonebook.cc:47 -#, c-format -msgid "" -"length of text '%s' exceeds maximum text length (%d characters) of phonebook " -"'%s'" -msgstr "" -"die Lnge des Texts '%s' berschreitet die maximale Textlnge (%d Zeichen) " -"des Telefonbuchs '%s'" - -# , c-format -#: gsmlib/gsm_phonebook.cc:55 -#, c-format -msgid "" -"length of telephone number '%s' exceeds maximum telephone number length (%d " -"characters) of phonebook '%s'" -msgstr "" -"die Lnge der Telefonnummer '%s' berschreitet die maximale " -"Telefonnummernlnge (%d Zeichen) des Telefonbuchs '%s'" - -#: gsmlib/gsm_phonebook.cc:275 -msgid "phonebook full" -msgstr "Telefonbuch voll" - -#: gsmlib/gsm_phonebook.cc:291 -msgid "attempt to overwrite phonebook entry" -msgstr "Versuch, einen Telefonbucheintrag zu berschreiben" - -#: gsmlib/gsm_phonebook.cc:569 -msgid "SIM card changed while accessing phonebook" -msgstr "SIM-Karte wurde gewechselt beim Zugriff auf Telefonbuch" - -#: gsmlib/gsm_sms.cc:66 gsmlib/gsm_sms.cc:85 gsmlib/gsm_sms.cc:175 -msgid "unhandled SMS TPDU type" -msgstr "unerwarteter SMS TPDU-Typ" - -#: gsmlib/gsm_sms.cc:107 -msgid "can only send SMS-SUBMIT and SMS-COMMAND TPDUs" -msgstr "kann nur SMS-SUBMIT und SMS-COMMAND TPDUs senden" - -#: gsmlib/gsm_sms.cc:111 -msgid "no device given for sending SMS" -msgstr "kein Gert zum Versenden von SMS angegeben" - -#: gsmlib/gsm_sms.cc:283 -msgid "Message type: SMS-DELIVER" -msgstr "Nachrichtentyp: SMS-DELIVER" - -#: gsmlib/gsm_sms.cc:284 gsmlib/gsm_sms.cc:426 gsmlib/gsm_sms.cc:531 -#: gsmlib/gsm_sms.cc:618 gsmlib/gsm_sms.cc:723 gsmlib/gsm_sms.cc:829 -msgid "SC address: '" -msgstr "SC-Adresse: '" - -#: gsmlib/gsm_sms.cc:285 gsmlib/gsm_sms.cc:532 -msgid "More messages to send: " -msgstr "Mehr Nachrichten zu versenden: " - -#: gsmlib/gsm_sms.cc:286 gsmlib/gsm_sms.cc:445 -msgid "Reply path: " -msgstr "Antwortpfad: " - -#: gsmlib/gsm_sms.cc:287 gsmlib/gsm_sms.cc:446 -msgid "User data header indicator: " -msgstr "Benutzerdatenvorspann (Indikation): " - -#: gsmlib/gsm_sms.cc:289 -msgid "Status report indication: " -msgstr "Status-Report-Indikation: " - -#: gsmlib/gsm_sms.cc:290 -msgid "Originating address: '" -msgstr "Senderadresse: '" - -#: gsmlib/gsm_sms.cc:292 gsmlib/gsm_sms.cc:452 gsmlib/gsm_sms.cc:621 -#: gsmlib/gsm_sms.cc:729 gsmlib/gsm_sms.cc:836 -msgid "Protocol identifier: 0x" -msgstr "Protokollbezeichner: 0x" - -#: gsmlib/gsm_sms.cc:294 gsmlib/gsm_sms.cc:454 gsmlib/gsm_sms.cc:733 -#: gsmlib/gsm_sms.cc:840 -msgid "Data coding scheme: " -msgstr "Datenkodierungsschema: " - -#: gsmlib/gsm_sms.cc:295 gsmlib/gsm_sms.cc:536 gsmlib/gsm_sms.cc:830 -msgid "SC timestamp: " -msgstr "SC-Zeitstempel: " - -#: gsmlib/gsm_sms.cc:296 gsmlib/gsm_sms.cc:456 gsmlib/gsm_sms.cc:735 -#: gsmlib/gsm_sms.cc:842 -msgid "User data length: " -msgstr "Benutzerdatenlnge: " - -#: gsmlib/gsm_sms.cc:297 gsmlib/gsm_sms.cc:457 -msgid "User data header: 0x" -msgstr "Benutzerdatenvorspann: 0x" - -#: gsmlib/gsm_sms.cc:302 gsmlib/gsm_sms.cc:461 gsmlib/gsm_sms.cc:736 -#: gsmlib/gsm_sms.cc:843 -msgid "User data: '" -msgstr "Benutzerdaten: '" - -#: gsmlib/gsm_sms.cc:425 -msgid "Message type: SMS-SUBMIT" -msgstr "Nachrichtentyp: SMS-SUBMIT" - -#: gsmlib/gsm_sms.cc:427 -msgid "Reject duplicates: " -msgstr "Duplikate zurckweisen: " - -#: gsmlib/gsm_sms.cc:428 -msgid "Validity period format: " -msgstr "Gltigkeitszeitraum-Format: " - -#: gsmlib/gsm_sms.cc:432 gsmlib/gsm_sms_codec.cc:183 -msgid "not present" -msgstr "nicht vorhanden" - -#: gsmlib/gsm_sms.cc:435 -msgid "relative" -msgstr "relativ" - -#: gsmlib/gsm_sms.cc:438 -msgid "absolute" -msgstr "absolut" - -#: gsmlib/gsm_sms.cc:448 gsmlib/gsm_sms.cc:620 -msgid "Status report request: " -msgstr "Status-Report-Anforderung: " - -#: gsmlib/gsm_sms.cc:449 gsmlib/gsm_sms.cc:534 gsmlib/gsm_sms.cc:619 -msgid "Message reference: " -msgstr "Nachrichtenreferenz: " - -#: gsmlib/gsm_sms.cc:450 gsmlib/gsm_sms.cc:626 -msgid "Destination address: '" -msgstr "Zieladresse: '" - -#: gsmlib/gsm_sms.cc:455 -msgid "Validity period: " -msgstr "Gltigkeitszeitraum: " - -#: gsmlib/gsm_sms.cc:530 -msgid "Message type: SMS-STATUS-REPORT" -msgstr "Nachrichtentyp: SMS-STATUS-REPORT" - -#: gsmlib/gsm_sms.cc:533 -msgid "Status report qualifier: " -msgstr "Status-Report-Attribut: " - -#: gsmlib/gsm_sms.cc:535 -msgid "Recipient address: '" -msgstr "Empfngeradresse: '" - -#: gsmlib/gsm_sms.cc:537 -msgid "Discharge time: " -msgstr "Aussendezeit: " - -#: gsmlib/gsm_sms.cc:538 -msgid "Status: 0x" -msgstr "Status: 0x" - -#: gsmlib/gsm_sms.cc:617 -msgid "Message type: SMS-COMMAND" -msgstr "Nachrichtentyp: SMS-COMMAND" - -#: gsmlib/gsm_sms.cc:623 -msgid "Command type: 0x" -msgstr "Kommandotyp: 0x" - -#: gsmlib/gsm_sms.cc:625 -msgid "Message number: " -msgstr "Nachrichtennummer: " - -#: gsmlib/gsm_sms.cc:628 -msgid "Command data length: " -msgstr "Kommandodatenlnge: " - -#: gsmlib/gsm_sms.cc:629 -msgid "Command data: '" -msgstr "Kommandodaten: '" - -#: gsmlib/gsm_sms.cc:722 -msgid "Message type: SMS-DELIVER-REPORT" -msgstr "Nachrichtentyp: SMS-DELIVER-REPORT" - -#: gsmlib/gsm_sms.cc:724 gsmlib/gsm_sms.cc:831 -msgid "Protocol identifier present: " -msgstr "Protokollbezeichner prsent: " - -#: gsmlib/gsm_sms.cc:726 gsmlib/gsm_sms.cc:833 -msgid "Data coding scheme present: " -msgstr "Datenkodierungsschema prsent: " - -#: gsmlib/gsm_sms.cc:727 gsmlib/gsm_sms.cc:834 -msgid "User data length present: " -msgstr "Benutzerdatenlnge prsent: " - -#: gsmlib/gsm_sms.cc:828 -msgid "Message type: SMS-SUBMIT-REPORT" -msgstr "Nachrichtentyp: SMS-SUBMIT-REPORT" - -#: gsmlib/gsm_sms_codec.cc:188 gsmlib/gsm_sms_codec.cc:190 -msgid " minutes" -msgstr " Minuten" - -#: gsmlib/gsm_sms_codec.cc:192 -msgid " days" -msgstr " Tage" - -#: gsmlib/gsm_sms_codec.cc:194 -msgid " weeks" -msgstr " Wochen" - -#: gsmlib/gsm_sms_codec.cc:213 -msgid "compressed " -msgstr "komprimiert " - -#: gsmlib/gsm_sms_codec.cc:218 -msgid "voicemail message waiting" -msgstr "Sprachnachricht abrufbar" - -#: gsmlib/gsm_sms_codec.cc:221 -msgid "fax message waiting" -msgstr "Faxnachricht abrufbar" - -#: gsmlib/gsm_sms_codec.cc:224 -msgid "electronic mail message waiting" -msgstr "E-Mail-Nachricht abrufbar" - -#: gsmlib/gsm_sms_codec.cc:227 -msgid "other message waiting" -msgstr "andere Nachricht abrufbar" - -#: gsmlib/gsm_sms_codec.cc:234 -msgid "default alphabet" -msgstr "Standardalphabet" - -#: gsmlib/gsm_sms_codec.cc:237 -msgid "8-bit alphabet" -msgstr "8-Bit Alphabet" - -#: gsmlib/gsm_sms_codec.cc:240 -msgid "16-bit alphabet" -msgstr "16-bit Alphabet" - -#: gsmlib/gsm_sms_codec.cc:243 -msgid "reserved alphabet" -msgstr "reserviertes Alphabet" - -#: gsmlib/gsm_sms_codec.cc:256 -msgid "bad hexadecimal PDU format" -msgstr "fehlerhaftes hexadezimales PDU-Format" - -#: 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 -msgid "premature end of PDU" -msgstr "Vorzeitiges Ende der PDU" - -#: gsmlib/gsm_sms_codec.cc:473 -msgid "unknown time period format" -msgstr "Unbekanntes Zeitperiodenformat" - -#: gsmlib/gsm_unix_serial.cc:119 -msgid "interrupted when reading from TA" -msgstr "Unterbrechung beim Lesen vom TA" - -#: gsmlib/gsm_unix_serial.cc:144 -msgid "reading from TA" -msgstr "beim Lesen vom TA" - -#: gsmlib/gsm_unix_serial.cc:149 -msgid "timeout when reading from TA" -msgstr "Zeitberschreitung beim Lesen vom TA" - -# , c-format -#: gsmlib/gsm_unix_serial.cc:176 -#, c-format -msgid "opening device '%s'" -msgstr "beim ffnen von Gert '%s'" - -#: gsmlib/gsm_unix_serial.cc:182 -msgid "getting file status flags failed" -msgstr "Lesen der Dateistatus-Flags fehlgeschlagen" - -#: gsmlib/gsm_unix_serial.cc:185 -msgid "switching of non-blocking mode failed" -msgstr "Abschalten des Non-Blocking Mode fehlgeschlagen" - -#: gsmlib/gsm_unix_serial.cc:198 -msgid "clearing DTR failed" -msgstr "Zurcksetzen von DTR fehlgeschlagen" - -#: gsmlib/gsm_unix_serial.cc:202 -msgid "setting DTR failed" -msgstr "Setzen von DTR fehlgeschlagen" - -# , c-format -#: gsmlib/gsm_unix_serial.cc:206 -#, c-format -msgid "tcgetattr device '%s'" -msgstr "tcgetattr Gert '%s'" - -# , c-format -#: gsmlib/gsm_unix_serial.cc:233 -#, c-format -msgid "tcsetattr device '%s'" -msgstr "tcsetattr Gert '%s'" - -# , c-format -#. no response after 3 tries -#: gsmlib/gsm_unix_serial.cc:287 -#, c-format -msgid "reset modem failed '%s'" -msgstr "Zurcksetzen des Modems '%s' fehlgeschlagen" - -#: gsmlib/gsm_unix_serial.cc:332 gsmlib/gsm_unix_serial.cc:364 -msgid "interrupted when writing to TA" -msgstr "Unterbrechnung beim Schreiben auf den TA" - -#: gsmlib/gsm_unix_serial.cc:347 gsmlib/gsm_unix_serial.cc:356 -msgid "writing to TA" -msgstr "beim Schreiben auf den TA" - -#: gsmlib/gsm_unix_serial.cc:377 -msgid "timeout when writing to TA" -msgstr "Zeitberschreitung beim Schreiben auf den TA" - -# , c-format -#: gsmlib/gsm_unix_serial.cc:438 -#, c-format -msgid "unknown baudrate '%s'" -msgstr "unbekannte Baud-Rate '%s'" - -# , c-format -#: gsmlib/gsm_util.cc:205 -#, c-format -msgid "error when calling stat('%s') (errno: %d/%s)" -msgstr "Fehler beim Aufruf von stat('%s') (errno: %d/%s)" - -# , c-format -#: gsmlib/gsm_util.cc:236 -#, c-format -msgid "file '%s' is neither file nor character device" -msgstr "Datei '%s' ist weder eine regulre Datei noch einen Zeichengert" - -#: gsmlib/gsm_util.cc:240 -msgid "maxmimum number of symbolic links exceeded" -msgstr "maximale Anzahl der symbolischen Links berschritten" - -# , c-format -#: gsmlib/gsm_util.cc:250 -#, c-format -msgid "error renaming '%s' to '%s'" -msgstr "Fehler beim Umbenennen von '%s' zu '%s'" - -# , c-format -#: gsmlib/gsm_util.cc:348 -#, c-format -msgid "text '%s' contains illegal character '\"'" -msgstr "der Text '%s' enthlt das illegale Zeichen '\"'" - -# , c-format -#: gsmlib/gsm_util.cc:358 -#, c-format -msgid "illegal character in telephone number '%s'" -msgstr "ungltiges Zeichen in der Telefonnummer '%s'" - -# , c-format -#: gsmlib/gsm_sorted_phonebook.cc:95 -#, c-format -msgid "error reading from file '%s" -msgstr "Fehler beim Lesen von Datei '%s'" - -# , c-format -#: gsmlib/gsm_sorted_phonebook.cc:109 -#, c-format -msgid "entry '%s' lacks index" -msgstr "Eintrag '%s' hat keinen Index" - -# , c-format -#: gsmlib/gsm_sorted_phonebook.cc:118 gsmlib/gsm_sorted_phonebook.cc:124 -#, c-format -msgid "line '%s' has invalid format" -msgstr "Zeile '%s' hat ungltiges Format" - -# , c-format -#: gsmlib/gsm_sorted_phonebook.cc:173 gsmlib/gsm_sorted_sms_store.cc:159 -#, c-format -msgid "error opening file '%s' for writing" -msgstr "Fehler beim ffnen der Datei '%s' zum Schreiben" - -#: gsmlib/gsm_sorted_phonebook.cc:174 gsmlib/gsm_sorted_phonebook.cc:193 -#: gsmlib/gsm_sorted_sms_store.cc:67 gsmlib/gsm_sorted_sms_store.cc:160 -msgid "" -msgstr "" - -# , c-format -#: gsmlib/gsm_sorted_phonebook.cc:192 gsmlib/gsm_sorted_sms_store.cc:66 -#, c-format -msgid "error writing to file '%s'" -msgstr "Fehler beim Schreiben in die Datei '%s'" - -#: gsmlib/gsm_sorted_phonebook.cc:216 -msgid "attempt to change phonebook read from " -msgstr "Versuch, von der Standardeingabe gelesenes Telefonbuch zu verndern" - -# , c-format -#: gsmlib/gsm_sorted_phonebook.cc:229 gsmlib/gsm_sorted_sms_store.cc:215 -#, c-format -msgid "cannot open file '%s'" -msgstr "kann Datei '%s' nicht ffnen" - -#: gsmlib/gsm_sorted_phonebook.cc:244 gsmlib/gsm_sorted_sms_store.cc:55 -#: gsmlib/gsm_sorted_sms_store.cc:228 -msgid "" -msgstr "" - -#: gsmlib/gsm_sorted_phonebook.cc:361 -msgid "indices must be unique in phonebook" -msgstr "Indices im Telefonbuch mssen eindeutig sein" - -# , c-format -#: gsmlib/gsm_sorted_sms_store.cc:54 -#, c-format -msgid "error reading from file '%s'" -msgstr "Fehler beim Lesen aus der Datei '%s'" - -# , c-format -#: gsmlib/gsm_sorted_sms_store.cc:87 -#, c-format -msgid "file '%s' has wrong version" -msgstr "Datei '%s' hat die falsche Version" - -# , c-format -#: gsmlib/gsm_sorted_sms_store.cc:99 gsmlib/gsm_sorted_sms_store.cc:111 -#, c-format -msgid "corrupt SMS store file '%s'" -msgstr "beschdigte SMS-Speicherdatei '%s'" - -#: gsmlib/gsm_sorted_sms_store.cc:204 -msgid "attempt to change SMS store read from " -msgstr "" -"Versuch, SMS-Speicher zu verndern, der von der Standardeingabe gelesen wurde" - -#~ msgid "cannot read current network operator" -#~ msgstr "kann den aktuellen Netzbetreiber nicht lesen" - -#~ msgid "Message type: SMS" -#~ msgstr "Nachrichtentyp: SMS" - -#~ msgid "(no further information available)" -#~ msgstr "(keine weitere Information verfgbar)" diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/gsmlib.pot b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/gsmlib.pot deleted file mode 100644 index 1d0385cf4f..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/gsmlib.pot +++ /dev/null @@ -1,1689 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\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" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: apps/gsmsmsd.cc:172 -#, c-format -msgid "could not execute '%s'" -msgstr "" - -#: apps/gsmsmsd.cc:176 -#, c-format -msgid "error writing to '%s'" -msgstr "" - -#: 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:260 -#, c-format -msgid "count not open SMS spool file %s" -msgstr "" - -#: 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: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:448 -msgid "" -" -a, --action the action to execute when an SMS arrives\n" -" (SMS is send to stdin of action)" -msgstr "" - -#: 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:455 -msgid " -c, --concatenate start ID for concatenated SMS messages" -msgstr "" - -#: apps/gsmsmsd.cc:457 apps/gsmsendsms.cc:158 apps/gsmsmsstore.cc:200 -msgid " -C, --sca SMS service centre address" -msgstr "" - -#: apps/gsmsmsd.cc:458 -msgid " -d, --device sets the device to connect to" -msgstr "" - -#: apps/gsmsmsd.cc:459 -msgid " -D, --direct enable direct routing of SMSs" -msgstr "" - -#: apps/gsmsmsd.cc:460 -msgid " -f, --flush flush SMS from store" -msgstr "" - -#: 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: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: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:472 -msgid " -s, --spool spool directory for outgoing SMS" -msgstr "" - -#: 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: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: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:482 -msgid " sms_type may be any combination of" -msgstr "" - -#: apps/gsmsmsd.cc:483 -msgid " sms, no_sms controls reception of normal SMS" -msgstr "" - -#: apps/gsmsmsd.cc:485 -msgid " cb, no_cb controls reception of cell broadcast messages" -msgstr "" - -#: apps/gsmsmsd.cc:487 -msgid " stat, no_stat controls reception of status reports" -msgstr "" - -#: apps/gsmsmsd.cc:489 -msgid " default is \"sms cb stat\"" -msgstr "" - -#: apps/gsmsmsd.cc:490 -msgid "If no action is given, the SMS is printed to stdout" -msgstr "" - -#: 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:542 -#, c-format -msgid "error when calling sigaction() (errno: %d/%s)" -msgstr "" - -#: apps/gsmsmsd.cc:562 -msgid "store name must be given for flush option" -msgstr "" - -#. process the new message -#: apps/gsmsmsd.cc:570 apps/gsmsmsd.cc:638 -msgid "Type of message: " -msgstr "" - -#: apps/gsmsmsd.cc:574 apps/gsmsmsd.cc:642 -msgid "SMS message\n" -msgstr "" - -#: apps/gsmsmsd.cc:577 -msgid "submit report message\n" -msgstr "" - -#: apps/gsmsmsd.cc:580 apps/gsmsmsd.cc:648 -msgid "status report message\n" -msgstr "" - -#: apps/gsmsmsd.cc:645 -msgid "cell broadcast message\n" -msgstr "" - -#: 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:704 -msgid "(try setting sms_type, please refer to gsmsmsd manpage)" -msgstr "" - -#: apps/gsmsendsms.cc:149 -msgid "" -": [-b baudrate][-c concatenatedID][-C sca][-d device][-h][-I init string]\n" -" [-t][-v][-X] phonenumber [text]" -msgstr "" - -#: apps/gsmsendsms.cc:156 -msgid " -c, --concatenate ID for concatenated SMS messages" -msgstr "" - -#: apps/gsmsendsms.cc:159 apps/gsmctl.cc:392 -msgid " -d, --device sets the destination device to connect to" -msgstr "" - -#: apps/gsmsendsms.cc:164 -msgid "" -" -t, --test convert text to GSM alphabet and vice\n" -" versa, no SMS message is sent" -msgstr "" - -#: apps/gsmsendsms.cc:171 -msgid " phonenumber recipient's phone number" -msgstr "" - -#: apps/gsmsendsms.cc:172 -msgid "" -" text optional text of the SMS message\n" -" if omitted: read from stdin" -msgstr "" - -#: apps/gsmsendsms.cc:205 -msgid "phone number and text missing" -msgstr "" - -#: apps/gsmsendsms.cc:208 apps/gsmsmsstore.cc:261 -msgid "more than two parameters given" -msgstr "" - -#: apps/gsmsendsms.cc:224 -msgid "text is larger than 160 characters" -msgstr "" - -#: apps/gsmpb.cc:102 apps/gsmpb.cc:491 -#, c-format -msgid "inserting '%s' tel# %s" -msgstr "" - -#: apps/gsmpb.cc:105 apps/gsmpb.cc:230 apps/gsmpb.cc:494 -#, c-format -msgid " (index #%d)" -msgstr "" - -#: apps/gsmpb.cc:144 -#, c-format -msgid "updating '%s' tel# %s to new tel# %s" -msgstr "" - -#: apps/gsmpb.cc:177 -#, c-format -msgid "updating '%s' tel# %s to new tel# %s(index %d)" -msgstr "" - -#: apps/gsmpb.cc:227 -#, c-format -msgid "deleting '%s' tel# %s" -msgstr "" - -#: apps/gsmpb.cc:316 -msgid "" -": [-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]" -msgstr "" - -#: apps/gsmpb.cc:325 -msgid " -c, --copy copy source entries to destination" -msgstr "" - -#: apps/gsmpb.cc:327 -msgid "" -" -d, --destination sets the destination device to connect \n" -" to, or the file to write" -msgstr "" - -#: apps/gsmpb.cc:330 -msgid " -D, --destination-backend sets the destination backend" -msgstr "" - -#: apps/gsmpb.cc:333 -msgid " -i, --index takes index positions into account" -msgstr "" - -#: apps/gsmpb.cc:336 -msgid " -p, --phonebook name of phonebook to use" -msgstr "" - -#: apps/gsmpb.cc:337 apps/gsmsmsstore.cc:210 -msgid "" -" -s, --source sets the source device to connect to,\n" -" or the file to read" -msgstr "" - -#: apps/gsmpb.cc:339 -msgid "" -" -t, --charset sets the character set to use for\n" -" phonebook entries" -msgstr "" - -#: apps/gsmpb.cc:341 -msgid " -S, --source-backend sets the source backend" -msgstr "" - -#: apps/gsmpb.cc:344 apps/gsmsmsstore.cc:214 -msgid " -V, --verbose print detailed progress messages" -msgstr "" - -#: apps/gsmpb.cc:347 -msgid "" -" -y, --synchronize synchronize destination with source\n" -" entries (destination is overwritten)\n" -" (see gsmpb(1) for details)" -msgstr "" - -#: apps/gsmpb.cc:360 -msgid "both source and destination must be given" -msgstr "" - -#: apps/gsmpb.cc:374 apps/gsmpb.cc:416 -msgid "phonebook name must be given" -msgstr "" - -#: apps/gsmpb.cc:441 -#, c-format -msgid "" -"text '%s' is too large to fit into destination (maximum size %d characters)" -msgstr "" - -#: apps/gsmpb.cc:447 -#, c-format -msgid "" -"phone number '%s' is too large to fit into destination (maximum size %d " -"characters)" -msgstr "" - -#: apps/gsmctl.cc:90 -msgid "active " -msgstr "" - -#: apps/gsmctl.cc:90 -msgid "inactive " -msgstr "" - -#: apps/gsmctl.cc:91 -msgid "number: " -msgstr "" - -#: apps/gsmctl.cc:92 -msgid " subaddr: " -msgstr "" - -#: apps/gsmctl.cc:93 -msgid " time: " -msgstr "" - -#: apps/gsmctl.cc:105 -msgid " Manufacturer: " -msgstr "" - -#: apps/gsmctl.cc:106 -msgid " Model: " -msgstr "" - -#: apps/gsmctl.cc:107 -msgid " Revision: " -msgstr "" - -#: apps/gsmctl.cc:108 -msgid " Serial Number: " -msgstr "" - -#: apps/gsmctl.cc:116 apps/gsmctl.cc:118 -msgid " Functionality Level: " -msgstr "" - -#: apps/gsmctl.cc:118 -msgid "unsupported" -msgstr "" - -#: apps/gsmctl.cc:128 -msgid "> Status: " -msgstr "" - -#: apps/gsmctl.cc:131 gsmlib/gsm_error.cc:104 gsmlib/gsm_sms.cc:441 -#: gsmlib/gsm_sms_codec.cc:205 -msgid "unknown" -msgstr "" - -#: apps/gsmctl.cc:132 -msgid "current" -msgstr "" - -#: apps/gsmctl.cc:133 -msgid "available" -msgstr "" - -#: apps/gsmctl.cc:134 -msgid "forbidden" -msgstr "" - -#: apps/gsmctl.cc:136 apps/gsmctl.cc:147 -msgid " Long name: '" -msgstr "" - -#: apps/gsmctl.cc:137 apps/gsmctl.cc:148 -msgid " Short name: '" -msgstr "" - -#: apps/gsmctl.cc:138 apps/gsmctl.cc:149 -msgid " Numeric name: " -msgstr "" - -#: apps/gsmctl.cc:150 -msgid " Mode: " -msgstr "" - -#: apps/gsmctl.cc:153 -msgid "automatic" -msgstr "" - -#: apps/gsmctl.cc:154 -msgid "manual" -msgstr "" - -#: apps/gsmctl.cc:155 -msgid "deregister" -msgstr "" - -#: apps/gsmctl.cc:156 -msgid "manual/automatic" -msgstr "" - -#: apps/gsmctl.cc:172 apps/gsmctl.cc:247 -msgid " Voice" -msgstr "" - -#: apps/gsmctl.cc:176 apps/gsmctl.cc:185 apps/gsmctl.cc:194 -msgid " unknown" -msgstr "" - -#: apps/gsmctl.cc:181 apps/gsmctl.cc:249 -msgid " Data" -msgstr "" - -#: apps/gsmctl.cc:190 apps/gsmctl.cc:251 -msgid " Fax" -msgstr "" - -#: apps/gsmctl.cc:229 -msgid "on" -msgstr "" - -#: apps/gsmctl.cc:229 -msgid "off" -msgstr "" - -#: apps/gsmctl.cc:239 -msgid "UnconditionalReason" -msgstr "" - -#: apps/gsmctl.cc:240 -msgid "MobileBusyReason" -msgstr "" - -#: apps/gsmctl.cc:241 -msgid "NoReplyReason" -msgstr "" - -#: apps/gsmctl.cc:242 -msgid "NotReachableReason" -msgstr "" - -#: apps/gsmctl.cc:261 -msgid "0 ME is powered by the battery" -msgstr "" - -#: apps/gsmctl.cc:262 -msgid "1 ME has a battery connected, but is not powered by it" -msgstr "" - -#: apps/gsmctl.cc:264 -msgid "2 ME does not have a battery connected" -msgstr "" - -#: apps/gsmctl.cc:266 -msgid "3 Recognized power fault, calls inhibited" -msgstr "" - -#: apps/gsmctl.cc:323 -#, c-format -msgid "unknown facility class parameter '%c'" -msgstr "" - -#: apps/gsmctl.cc:336 -#, c-format -msgid "not enough parameters, minimum number of parameters is %d" -msgstr "" - -#: apps/gsmctl.cc:340 -#, c-format -msgid "too many parameters, maximum number of parameters is %d" -msgstr "" - -#: apps/gsmctl.cc:385 -msgid "" -": [-b baudrate][-d device][-h][-I init string][-o operation]\n" -" [-v][-X]{parameters}" -msgstr "" - -#: apps/gsmctl.cc:396 -msgid "" -" -o, --operation operation to perform on the mobile \n" -" phone with the specified parameters" -msgstr "" - -#: apps/gsmctl.cc:402 -msgid "" -" 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" -msgstr "" - -#: apps/gsmctl.cc:408 -msgid "" -"Refer to gsmctl(1) for details on the available parameters and operations." -msgstr "" - -#: apps/gsmctl.cc:471 -#, c-format -msgid "unknown information parameter '%s'" -msgstr "" - -#: apps/gsmctl.cc:520 -#, c-format -msgid "unknown opmode parameter '%s'" -msgstr "" - -#: apps/gsmctl.cc:588 -#, c-format -msgid "unknown forward reason parameter '%s'" -msgstr "" - -#: apps/gsmctl.cc:604 -#, c-format -msgid "unknown forward mode parameter '%s'" -msgstr "" - -#: apps/gsmctl.cc:625 -#, c-format -msgid "unknown operation '%s'" -msgstr "" - -#: apps/gsmsmsstore.cc:91 apps/gsmsmsstore.cc:358 apps/gsmsmsstore.cc:375 -#, c-format -msgid "inserting entry #%d from source into destination" -msgstr "" - -#: apps/gsmsmsstore.cc:102 -#, c-format -msgid "incompatible options '%c' and '%c'" -msgstr "" - -#: apps/gsmsmsstore.cc:184 -msgid "" -": [-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]" -msgstr "" - -#: apps/gsmsmsstore.cc:191 -msgid "" -" -a, --add add new SMS submit message\n" -" (phonenumber and text) to destination" -msgstr "" - -#: apps/gsmsmsstore.cc:197 -msgid "" -" -c, --copy copy source entries to destination\n" -" (if indices are given, copy only these entries)" -msgstr "" - -#: apps/gsmsmsstore.cc:201 -msgid "" -" -d, --destination sets the destination device to\n" -" connect to, or the file to write to" -msgstr "" - -#: apps/gsmsmsstore.cc:206 -msgid "" -" -k, --backup backup new entries to destination\n" -" (if indices are given, copy only these entries)" -msgstr "" - -#: apps/gsmsmsstore.cc:209 -msgid " -l, --list list source to stdout" -msgstr "" - -#: apps/gsmsmsstore.cc:212 -msgid " -t, --store name of SMS store to use" -msgstr "" - -#: apps/gsmsmsstore.cc:216 -msgid " -x, --delete delete entries denoted by indices" -msgstr "" - -#: apps/gsmsmsstore.cc:229 -msgid "no operation option given" -msgstr "" - -#: apps/gsmsmsstore.cc:232 -msgid "both source and destination required" -msgstr "" - -#: apps/gsmsmsstore.cc:237 -msgid "destination must not be given" -msgstr "" - -#: apps/gsmsmsstore.cc:239 -msgid "source required" -msgstr "" - -#: apps/gsmsmsstore.cc:244 -msgid "source must not be given" -msgstr "" - -#: apps/gsmsmsstore.cc:246 -msgid "destination required" -msgstr "" - -#: apps/gsmsmsstore.cc:254 gsmlib/gsm_util.cc:286 -#, c-format -msgid "expected number, got '%s'" -msgstr "" - -#: apps/gsmsmsstore.cc:264 -msgid "not enough parameters given" -msgstr "" - -#: apps/gsmsmsstore.cc:269 -msgid "unexpected parameters" -msgstr "" - -#: apps/gsmsmsstore.cc:280 apps/gsmsmsstore.cc:312 -msgid "store name must be given" -msgstr "" - -#: apps/gsmsmsstore.cc:339 apps/gsmsmsstore.cc:372 -#, c-format -msgid "no index '%s' in source" -msgstr "" - -#: apps/gsmsmsstore.cc:387 -#, c-format -msgid "index #%d" -msgstr "" - -#: apps/gsmsmsstore.cc:401 -msgid "inserting new entry into destination" -msgstr "" - -#: apps/gsmsmsstore.cc:416 -#, c-format -msgid "deleting entry #%d from destination" -msgstr "" - -#: apps/gsmsmsstore.cc:421 -#, c-format -msgid "no index '%s' in destination" -msgstr "" - -#: gsmlib/gsm_at.cc:66 -msgid "unspecified ME/TA error" -msgstr "" - -#: gsmlib/gsm_at.cc:76 -msgid "ME/TA error '" -msgstr "" - -#: gsmlib/gsm_at.cc:80 -#, c-format -msgid "(code %s)" -msgstr "" - -#: gsmlib/gsm_at.cc:125 gsmlib/gsm_at.cc:215 gsmlib/gsm_at.cc:344 -msgid "ME/TA error '' (code not known)" -msgstr "" - -#: gsmlib/gsm_at.cc:184 gsmlib/gsm_at.cc:365 -#, c-format -msgid "unexpected response '%s' when sending 'AT%s'" -msgstr "" - -#: gsmlib/gsm_at.cc:318 -msgid "unexpected character in PDU handshake" -msgstr "" - -#: gsmlib/gsm_error.cc:29 -msgid "phone failure" -msgstr "" - -#: gsmlib/gsm_error.cc:32 -msgid "no connection to phone" -msgstr "" - -#: gsmlib/gsm_error.cc:35 -msgid "phone adaptor link reserved" -msgstr "" - -#: gsmlib/gsm_error.cc:38 gsmlib/gsm_error.cc:259 -msgid "operation not allowed" -msgstr "" - -#: gsmlib/gsm_error.cc:41 gsmlib/gsm_error.cc:262 -msgid "operation not supported" -msgstr "" - -#: gsmlib/gsm_error.cc:44 -msgid "ph SIM PIN required" -msgstr "" - -#: gsmlib/gsm_error.cc:47 gsmlib/gsm_error.cc:271 -msgid "SIM not inserted" -msgstr "" - -#: gsmlib/gsm_error.cc:50 gsmlib/gsm_error.cc:274 -msgid "SIM PIN required" -msgstr "" - -#: gsmlib/gsm_error.cc:53 gsmlib/gsm_error.cc:289 -msgid "SIM PUK required" -msgstr "" - -#: gsmlib/gsm_error.cc:56 gsmlib/gsm_error.cc:280 -msgid "SIM failure" -msgstr "" - -#: gsmlib/gsm_error.cc:59 gsmlib/gsm_error.cc:283 -msgid "SIM busy" -msgstr "" - -#: gsmlib/gsm_error.cc:62 gsmlib/gsm_error.cc:286 -msgid "SIM wrong" -msgstr "" - -#: gsmlib/gsm_error.cc:65 -msgid "incorrect password" -msgstr "" - -#: gsmlib/gsm_error.cc:68 gsmlib/gsm_error.cc:292 -msgid "SIM PIN2 required" -msgstr "" - -#: gsmlib/gsm_error.cc:71 gsmlib/gsm_error.cc:295 -msgid "SIM PUK2 required" -msgstr "" - -#: gsmlib/gsm_error.cc:74 gsmlib/gsm_error.cc:304 -msgid "memory full" -msgstr "" - -#: gsmlib/gsm_error.cc:77 -msgid "invalid index" -msgstr "" - -#: gsmlib/gsm_error.cc:80 -msgid "not found" -msgstr "" - -#: gsmlib/gsm_error.cc:83 gsmlib/gsm_error.cc:298 -msgid "memory failure" -msgstr "" - -#: gsmlib/gsm_error.cc:86 -msgid "text string too long" -msgstr "" - -#: gsmlib/gsm_error.cc:89 -msgid "invalid characters in text string" -msgstr "" - -#: gsmlib/gsm_error.cc:92 -msgid "dial string too long" -msgstr "" - -#: gsmlib/gsm_error.cc:95 -msgid "invalid characters in dial string" -msgstr "" - -#: gsmlib/gsm_error.cc:98 gsmlib/gsm_error.cc:310 -msgid "no network service" -msgstr "" - -#: gsmlib/gsm_error.cc:101 gsmlib/gsm_error.cc:313 -msgid "network timeout" -msgstr "" - -#: gsmlib/gsm_error.cc:107 -#, c-format -msgid "invalid ME error %d" -msgstr "" - -#: gsmlib/gsm_error.cc:117 -msgid "Unassigned (unallocated) number" -msgstr "" - -#: gsmlib/gsm_error.cc:120 -msgid "Operator determined barring" -msgstr "" - -#: gsmlib/gsm_error.cc:123 -msgid "Call barred" -msgstr "" - -#: gsmlib/gsm_error.cc:126 -msgid "Network failure" -msgstr "" - -#: gsmlib/gsm_error.cc:129 -msgid "Short message transfer rejected" -msgstr "" - -#: gsmlib/gsm_error.cc:133 gsmlib/gsm_error.cc:355 -msgid "Congestion" -msgstr "" - -#: gsmlib/gsm_error.cc:136 -msgid "Destination out of service" -msgstr "" - -#: gsmlib/gsm_error.cc:139 -msgid "Unidentified subscriber" -msgstr "" - -#: gsmlib/gsm_error.cc:142 -msgid "Facility rejected" -msgstr "" - -#: gsmlib/gsm_error.cc:145 -msgid "Unknown subscriber" -msgstr "" - -#: gsmlib/gsm_error.cc:148 -msgid "Network out of order" -msgstr "" - -#: gsmlib/gsm_error.cc:151 -msgid "Temporary failure" -msgstr "" - -#: gsmlib/gsm_error.cc:154 -msgid "Resources unavailable, unspecified" -msgstr "" - -#: gsmlib/gsm_error.cc:157 -msgid "Requested facility not subscribed" -msgstr "" - -#: gsmlib/gsm_error.cc:160 -msgid "Requested facility not implemented" -msgstr "" - -#: gsmlib/gsm_error.cc:163 -msgid "Invalid Transaction Identifier" -msgstr "" - -#: gsmlib/gsm_error.cc:166 -msgid "Semantically incorrect message" -msgstr "" - -#: gsmlib/gsm_error.cc:169 -msgid "Invalid mandatory information" -msgstr "" - -#: gsmlib/gsm_error.cc:172 -msgid "Message type non-existent or not implemented" -msgstr "" - -#: gsmlib/gsm_error.cc:175 -msgid "Message not compatible with short message protocol state" -msgstr "" - -#: gsmlib/gsm_error.cc:178 -msgid "Information element non-existent or not implemented" -msgstr "" - -#: gsmlib/gsm_error.cc:181 -msgid "Protocol error, unspecified" -msgstr "" - -#: gsmlib/gsm_error.cc:184 -msgid "Interworking, unspecified" -msgstr "" - -#: gsmlib/gsm_error.cc:187 -msgid "Telematic interworking not supported" -msgstr "" - -#: gsmlib/gsm_error.cc:190 -msgid "Short message Type 0 not supported" -msgstr "" - -#: gsmlib/gsm_error.cc:193 -msgid "Cannot replace short message" -msgstr "" - -#: gsmlib/gsm_error.cc:196 -msgid "Unspecified TP-PID error" -msgstr "" - -#: gsmlib/gsm_error.cc:199 -msgid "Data coding scheme (alphabet) not supported" -msgstr "" - -#: gsmlib/gsm_error.cc:202 -msgid "Message class not supported" -msgstr "" - -#: gsmlib/gsm_error.cc:205 -msgid "Unspecifiec TP-DCS error" -msgstr "" - -#: gsmlib/gsm_error.cc:208 -msgid "Command cannot be actioned" -msgstr "" - -#: gsmlib/gsm_error.cc:211 -msgid "Command unsupported" -msgstr "" - -#: gsmlib/gsm_error.cc:214 -msgid "Unspecified TP-Command error" -msgstr "" - -#: gsmlib/gsm_error.cc:217 -msgid "TPDU not supported" -msgstr "" - -#: gsmlib/gsm_error.cc:220 -msgid "SC busy" -msgstr "" - -#: gsmlib/gsm_error.cc:223 -msgid "No SC subscription" -msgstr "" - -#: gsmlib/gsm_error.cc:226 -msgid "SC system failure" -msgstr "" - -#: gsmlib/gsm_error.cc:229 -msgid "Invalid SME address" -msgstr "" - -#: gsmlib/gsm_error.cc:232 -msgid "Destination SME barred" -msgstr "" - -#: gsmlib/gsm_error.cc:235 -msgid "SM Rejected-Duplicated SM" -msgstr "" - -#: gsmlib/gsm_error.cc:238 -msgid "SIM SMS storage full" -msgstr "" - -#: gsmlib/gsm_error.cc:241 -msgid "No SMS storage capability in SIM" -msgstr "" - -#: gsmlib/gsm_error.cc:244 -msgid "Error in MS" -msgstr "" - -#: gsmlib/gsm_error.cc:247 -msgid "Memory Capacity Exceed" -msgstr "" - -#: gsmlib/gsm_error.cc:250 -msgid "Unspecified error cause" -msgstr "" - -#: gsmlib/gsm_error.cc:253 -msgid "ME failure" -msgstr "" - -#: gsmlib/gsm_error.cc:256 -msgid "SMS service of ME reserved" -msgstr "" - -#: gsmlib/gsm_error.cc:265 -msgid "invalid PDU mode parameter" -msgstr "" - -#: gsmlib/gsm_error.cc:268 -msgid "invalid text mode parameter" -msgstr "" - -#: gsmlib/gsm_error.cc:277 -msgid "PH-SIM PIN required" -msgstr "" - -#: gsmlib/gsm_error.cc:301 -msgid "invalid memory index" -msgstr "" - -#: gsmlib/gsm_error.cc:307 -msgid "SMSC address unknown" -msgstr "" - -#: gsmlib/gsm_error.cc:316 -msgid "no +CNMA acknowledgement expected" -msgstr "" - -#: gsmlib/gsm_error.cc:319 -msgid "unknown error" -msgstr "" - -#: gsmlib/gsm_error.cc:322 -#, c-format -msgid "invalid SMS error %d" -msgstr "" - -#: gsmlib/gsm_error.cc:335 -msgid "Short message received by the SME" -msgstr "" - -#: gsmlib/gsm_error.cc:338 -msgid "" -"Short message forwarded by the SC to the SME but the SC is unable to confirm " -"delivery" -msgstr "" - -#: gsmlib/gsm_error.cc:342 -msgid "Short message replaced by the SC" -msgstr "" - -#: gsmlib/gsm_error.cc:345 gsmlib/gsm_error.cc:373 gsmlib/gsm_error.cc:418 -msgid "reserved" -msgstr "" - -#: gsmlib/gsm_error.cc:358 -msgid "SME busy" -msgstr "" - -#: gsmlib/gsm_error.cc:361 -msgid "No response from SME" -msgstr "" - -#: gsmlib/gsm_error.cc:364 -msgid "Service rejected" -msgstr "" - -#: gsmlib/gsm_error.cc:367 gsmlib/gsm_error.cc:400 -msgid "Quality of service not available" -msgstr "" - -#: gsmlib/gsm_error.cc:370 -msgid "Error in SME" -msgstr "" - -#: gsmlib/gsm_error.cc:377 -msgid " (Temporary error, SC is not making any more transfer attempts)" -msgstr "" - -#: gsmlib/gsm_error.cc:380 -msgid " (Temporary error, SC still trying to transfer SM)" -msgstr "" - -#: gsmlib/gsm_error.cc:388 -msgid "Remote Procedure Error" -msgstr "" - -#: gsmlib/gsm_error.cc:391 -msgid "Incompatible destination" -msgstr "" - -#: gsmlib/gsm_error.cc:394 -msgid "Connection rejected by SME" -msgstr "" - -#: gsmlib/gsm_error.cc:397 -msgid "Not obtainable" -msgstr "" - -#: gsmlib/gsm_error.cc:403 -msgid "No interworking available" -msgstr "" - -#: gsmlib/gsm_error.cc:406 -msgid "SM validity period expired" -msgstr "" - -#: gsmlib/gsm_error.cc:409 -msgid "SM deleted by originating SME" -msgstr "" - -#: gsmlib/gsm_error.cc:412 -msgid "SM deleted by SC administration" -msgstr "" - -#: gsmlib/gsm_error.cc:415 -msgid "SM does not exit" -msgstr "" - -#: gsmlib/gsm_error.cc:421 -msgid " (Permanent Error, SC is not making any more transfer attempts)" -msgstr "" - -#: gsmlib/gsm_event.cc:80 -#, c-format -msgid "unexpected number format %d" -msgstr "" - -#: gsmlib/gsm_event.cc:100 -#, c-format -msgid "unexpected unsolicited event '%s'" -msgstr "" - -#: gsmlib/gsm_me_ta.cc:538 -msgid "unable to set operator" -msgstr "" - -#: gsmlib/gsm_me_ta.cc:665 -msgid "call forward time must be in the range 0..30" -msgstr "" - -#: 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:832 -msgid "Requested Functionality Level out of range" -msgstr "" - -#: gsmlib/gsm_me_ta.cc:943 -msgid "unsupported alphabet for SMS" -msgstr "" - -#: gsmlib/gsm_me_ta.cc:952 -msgid "SMS text is larger than allowed" -msgstr "" - -#: gsmlib/gsm_me_ta.cc:964 -msgid "not more than 255 concatenated SMSs allowed" -msgstr "" - -#: gsmlib/gsm_me_ta.cc:997 -msgid "only serviceLevel 0 or 1 supported" -msgstr "" - -#: 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:1124 gsmlib/gsm_me_ta.cc:1166 -msgid "cannot route cell broadcast messages to TE" -msgstr "" - -#: gsmlib/gsm_me_ta.cc:1136 -msgid "cannot route status reports messages to TE" -msgstr "" - -#: gsmlib/gsm_me_ta.cc:1180 -msgid "cannot route status report messages to TE" -msgstr "" - -#: gsmlib/gsm_parser.cc:51 -msgid "expected parameter" -msgstr "" - -#: gsmlib/gsm_parser.cc:71 -msgid "expected '\"'" -msgstr "" - -#: gsmlib/gsm_parser.cc:109 -msgid "expected number" -msgstr "" - -#: gsmlib/gsm_parser.cc:120 -#, c-format -msgid "unexpected end of string '%s'" -msgstr "" - -#: gsmlib/gsm_parser.cc:124 -#, c-format -msgid " (at position %d of string '%s')" -msgstr "" - -#: gsmlib/gsm_parser.cc:141 -#, c-format -msgid "expected '%c'" -msgstr "" - -#: gsmlib/gsm_parser.cc:165 -msgid "expected ')' or ','" -msgstr "" - -#: gsmlib/gsm_parser.cc:251 -msgid "expected ')', ',' or '-'" -msgstr "" - -#: gsmlib/gsm_parser.cc:257 -msgid "range of the form a-b-c not allowed" -msgstr "" - -#: gsmlib/gsm_parser.cc:264 -msgid "range of the form a- no allowed" -msgstr "" - -#: gsmlib/gsm_parser.cc:350 -msgid "expected comma" -msgstr "" - -#: gsmlib/gsm_parser.cc:367 -msgid "expected end of line" -msgstr "" - -#: gsmlib/gsm_phonebook.cc:47 -#, c-format -msgid "" -"length of text '%s' exceeds maximum text length (%d characters) of phonebook " -"'%s'" -msgstr "" - -#: gsmlib/gsm_phonebook.cc:55 -#, c-format -msgid "" -"length of telephone number '%s' exceeds maximum telephone number length (%d " -"characters) of phonebook '%s'" -msgstr "" - -#: gsmlib/gsm_phonebook.cc:275 -msgid "phonebook full" -msgstr "" - -#: gsmlib/gsm_phonebook.cc:291 -msgid "attempt to overwrite phonebook entry" -msgstr "" - -#: gsmlib/gsm_phonebook.cc:569 -msgid "SIM card changed while accessing phonebook" -msgstr "" - -#: gsmlib/gsm_sms.cc:66 gsmlib/gsm_sms.cc:85 gsmlib/gsm_sms.cc:175 -msgid "unhandled SMS TPDU type" -msgstr "" - -#: gsmlib/gsm_sms.cc:107 -msgid "can only send SMS-SUBMIT and SMS-COMMAND TPDUs" -msgstr "" - -#: gsmlib/gsm_sms.cc:111 -msgid "no device given for sending SMS" -msgstr "" - -#: gsmlib/gsm_sms.cc:283 -msgid "Message type: SMS-DELIVER" -msgstr "" - -#: gsmlib/gsm_sms.cc:284 gsmlib/gsm_sms.cc:426 gsmlib/gsm_sms.cc:531 -#: gsmlib/gsm_sms.cc:618 gsmlib/gsm_sms.cc:723 gsmlib/gsm_sms.cc:829 -msgid "SC address: '" -msgstr "" - -#: gsmlib/gsm_sms.cc:285 gsmlib/gsm_sms.cc:532 -msgid "More messages to send: " -msgstr "" - -#: gsmlib/gsm_sms.cc:286 gsmlib/gsm_sms.cc:445 -msgid "Reply path: " -msgstr "" - -#: gsmlib/gsm_sms.cc:287 gsmlib/gsm_sms.cc:446 -msgid "User data header indicator: " -msgstr "" - -#: gsmlib/gsm_sms.cc:289 -msgid "Status report indication: " -msgstr "" - -#: gsmlib/gsm_sms.cc:290 -msgid "Originating address: '" -msgstr "" - -#: gsmlib/gsm_sms.cc:292 gsmlib/gsm_sms.cc:452 gsmlib/gsm_sms.cc:621 -#: gsmlib/gsm_sms.cc:729 gsmlib/gsm_sms.cc:836 -msgid "Protocol identifier: 0x" -msgstr "" - -#: gsmlib/gsm_sms.cc:294 gsmlib/gsm_sms.cc:454 gsmlib/gsm_sms.cc:733 -#: gsmlib/gsm_sms.cc:840 -msgid "Data coding scheme: " -msgstr "" - -#: gsmlib/gsm_sms.cc:295 gsmlib/gsm_sms.cc:536 gsmlib/gsm_sms.cc:830 -msgid "SC timestamp: " -msgstr "" - -#: gsmlib/gsm_sms.cc:296 gsmlib/gsm_sms.cc:456 gsmlib/gsm_sms.cc:735 -#: gsmlib/gsm_sms.cc:842 -msgid "User data length: " -msgstr "" - -#: gsmlib/gsm_sms.cc:297 gsmlib/gsm_sms.cc:457 -msgid "User data header: 0x" -msgstr "" - -#: gsmlib/gsm_sms.cc:302 gsmlib/gsm_sms.cc:461 gsmlib/gsm_sms.cc:736 -#: gsmlib/gsm_sms.cc:843 -msgid "User data: '" -msgstr "" - -#: gsmlib/gsm_sms.cc:425 -msgid "Message type: SMS-SUBMIT" -msgstr "" - -#: gsmlib/gsm_sms.cc:427 -msgid "Reject duplicates: " -msgstr "" - -#: gsmlib/gsm_sms.cc:428 -msgid "Validity period format: " -msgstr "" - -#: gsmlib/gsm_sms.cc:432 gsmlib/gsm_sms_codec.cc:184 -msgid "not present" -msgstr "" - -#: gsmlib/gsm_sms.cc:435 -msgid "relative" -msgstr "" - -#: gsmlib/gsm_sms.cc:438 -msgid "absolute" -msgstr "" - -#: gsmlib/gsm_sms.cc:448 gsmlib/gsm_sms.cc:620 -msgid "Status report request: " -msgstr "" - -#: gsmlib/gsm_sms.cc:449 gsmlib/gsm_sms.cc:534 gsmlib/gsm_sms.cc:619 -msgid "Message reference: " -msgstr "" - -#: gsmlib/gsm_sms.cc:450 gsmlib/gsm_sms.cc:626 -msgid "Destination address: '" -msgstr "" - -#: gsmlib/gsm_sms.cc:455 -msgid "Validity period: " -msgstr "" - -#: gsmlib/gsm_sms.cc:530 -msgid "Message type: SMS-STATUS-REPORT" -msgstr "" - -#: gsmlib/gsm_sms.cc:533 -msgid "Status report qualifier: " -msgstr "" - -#: gsmlib/gsm_sms.cc:535 -msgid "Recipient address: '" -msgstr "" - -#: gsmlib/gsm_sms.cc:537 -msgid "Discharge time: " -msgstr "" - -#: gsmlib/gsm_sms.cc:538 -msgid "Status: 0x" -msgstr "" - -#: gsmlib/gsm_sms.cc:617 -msgid "Message type: SMS-COMMAND" -msgstr "" - -#: gsmlib/gsm_sms.cc:623 -msgid "Command type: 0x" -msgstr "" - -#: gsmlib/gsm_sms.cc:625 -msgid "Message number: " -msgstr "" - -#: gsmlib/gsm_sms.cc:628 -msgid "Command data length: " -msgstr "" - -#: gsmlib/gsm_sms.cc:629 -msgid "Command data: '" -msgstr "" - -#: gsmlib/gsm_sms.cc:722 -msgid "Message type: SMS-DELIVER-REPORT" -msgstr "" - -#: gsmlib/gsm_sms.cc:724 gsmlib/gsm_sms.cc:831 -msgid "Protocol identifier present: " -msgstr "" - -#: gsmlib/gsm_sms.cc:726 gsmlib/gsm_sms.cc:833 -msgid "Data coding scheme present: " -msgstr "" - -#: gsmlib/gsm_sms.cc:727 gsmlib/gsm_sms.cc:834 -msgid "User data length present: " -msgstr "" - -#: gsmlib/gsm_sms.cc:828 -msgid "Message type: SMS-SUBMIT-REPORT" -msgstr "" - -#: gsmlib/gsm_sms_codec.cc:189 gsmlib/gsm_sms_codec.cc:191 -msgid " minutes" -msgstr "" - -#: gsmlib/gsm_sms_codec.cc:193 -msgid " days" -msgstr "" - -#: gsmlib/gsm_sms_codec.cc:195 -msgid " weeks" -msgstr "" - -#: gsmlib/gsm_sms_codec.cc:214 -msgid "compressed " -msgstr "" - -#: gsmlib/gsm_sms_codec.cc:219 -msgid "voicemail message waiting" -msgstr "" - -#: gsmlib/gsm_sms_codec.cc:222 -msgid "fax message waiting" -msgstr "" - -#: gsmlib/gsm_sms_codec.cc:225 -msgid "electronic mail message waiting" -msgstr "" - -#: gsmlib/gsm_sms_codec.cc:228 -msgid "other message waiting" -msgstr "" - -#: gsmlib/gsm_sms_codec.cc:235 -msgid "default alphabet" -msgstr "" - -#: gsmlib/gsm_sms_codec.cc:238 -msgid "8-bit alphabet" -msgstr "" - -#: gsmlib/gsm_sms_codec.cc:241 -msgid "16-bit alphabet" -msgstr "" - -#: gsmlib/gsm_sms_codec.cc:244 -msgid "reserved alphabet" -msgstr "" - -#: gsmlib/gsm_sms_codec.cc:257 -msgid "bad hexadecimal PDU format" -msgstr "" - -#: 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:474 -msgid "unknown time period format" -msgstr "" - -#: gsmlib/gsm_unix_serial.cc:121 -msgid "interrupted when reading from TA" -msgstr "" - -#: 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:151 -msgid "timeout when reading from TA" -msgstr "" - -#: gsmlib/gsm_unix_serial.cc:178 -#, c-format -msgid "opening device '%s'" -msgstr "" - -#: gsmlib/gsm_unix_serial.cc:185 -msgid "getting file status flags failed" -msgstr "" - -#: gsmlib/gsm_unix_serial.cc:190 -msgid "switching of non-blocking mode failed" -msgstr "" - -#: gsmlib/gsm_unix_serial.cc:205 -msgid "clearing DTR failed" -msgstr "" - -#: gsmlib/gsm_unix_serial.cc:211 -msgid "setting DTR failed" -msgstr "" - -#: gsmlib/gsm_unix_serial.cc:216 -#, c-format -msgid "tcgetattr device '%s'" -msgstr "" - -#: gsmlib/gsm_unix_serial.cc:245 -#, c-format -msgid "tcsetattr device '%s'" -msgstr "" - -#: gsmlib/gsm_unix_serial.cc:303 -#, c-format -msgid "reset modem failed '%s'" -msgstr "" - -#: gsmlib/gsm_unix_serial.cc:348 gsmlib/gsm_unix_serial.cc:380 -msgid "interrupted when writing to TA" -msgstr "" - -#: gsmlib/gsm_unix_serial.cc:363 gsmlib/gsm_unix_serial.cc:372 -msgid "writing to TA" -msgstr "" - -#: gsmlib/gsm_unix_serial.cc:393 -msgid "timeout when writing to TA" -msgstr "" - -#: gsmlib/gsm_unix_serial.cc:454 -#, c-format -msgid "unknown baudrate '%s'" -msgstr "" - -#: gsmlib/gsm_util.cc:206 -#, c-format -msgid "error when calling stat('%s') (errno: %d/%s)" -msgstr "" - -#: gsmlib/gsm_util.cc:237 -#, c-format -msgid "file '%s' is neither file nor character device" -msgstr "" - -#: gsmlib/gsm_util.cc:241 -msgid "maxmimum number of symbolic links exceeded" -msgstr "" - -#: gsmlib/gsm_util.cc:251 -#, c-format -msgid "error renaming '%s' to '%s'" -msgstr "" - -#: gsmlib/gsm_util.cc:349 -#, c-format -msgid "text '%s' contains illegal character '\"'" -msgstr "" - -#: gsmlib/gsm_util.cc:359 -#, c-format -msgid "illegal character in telephone number '%s'" -msgstr "" - -#: gsmlib/gsm_sorted_phonebook.cc:96 -#, c-format -msgid "error reading from file '%s" -msgstr "" - -#: gsmlib/gsm_sorted_phonebook.cc:110 -#, c-format -msgid "entry '%s' lacks index" -msgstr "" - -#: 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:174 gsmlib/gsm_sorted_sms_store.cc:159 -#, c-format -msgid "error opening file '%s' for writing" -msgstr "" - -#: 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:193 gsmlib/gsm_sorted_sms_store.cc:66 -#, c-format -msgid "error writing to file '%s'" -msgstr "" - -#: gsmlib/gsm_sorted_phonebook.cc:217 -msgid "attempt to change phonebook read from " -msgstr "" - -#: 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:245 gsmlib/gsm_sorted_sms_store.cc:55 -#: gsmlib/gsm_sorted_sms_store.cc:228 -msgid "" -msgstr "" - -#: gsmlib/gsm_sorted_phonebook.cc:362 -msgid "indices must be unique in phonebook" -msgstr "" - -#: gsmlib/gsm_sorted_sms_store.cc:54 -#, c-format -msgid "error reading from file '%s'" -msgstr "" - -#: gsmlib/gsm_sorted_sms_store.cc:87 -#, c-format -msgid "file '%s' has wrong version" -msgstr "" - -#: gsmlib/gsm_sorted_sms_store.cc:99 gsmlib/gsm_sorted_sms_store.cc:111 -#, c-format -msgid "corrupt SMS store file '%s'" -msgstr "" - -#: gsmlib/gsm_sorted_sms_store.cc:204 -msgid "attempt to change SMS store read from " -msgstr "" diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/stamp-cat-id b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/stamp-cat-id deleted file mode 100644 index 9788f70238..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/po/stamp-cat-id +++ /dev/null @@ -1 +0,0 @@ -timestamp diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/Makefile.am b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/Makefile.am deleted file mode 100644 index 53f51ac19a..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -## Process this file with automake to produce Makefile.in -# ************************************************************************* -# * GSM TA/ME library -# * -# * File: Makefile.am -# * -# * Purpose: scripts Makefile -# * -# * Author: Peter Hofmann (software@pxh.de) -# * -# * Created: 5.6.1999 -# ************************************************************************* - -EXTRA_DIST = config.sub ltconfig missing \ - config.guess install-sh ltmain.sh mkinstalldirs debugconfig.sh diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/Makefile.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/Makefile.in deleted file mode 100644 index 6129036172..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/Makefile.in +++ /dev/null @@ -1,259 +0,0 @@ -# Makefile.in generated by automake 1.6.3 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# ************************************************************************* -# * GSM TA/ME library -# * -# * File: Makefile.am -# * -# * Purpose: scripts Makefile -# * -# * Author: Peter Hofmann (software@pxh.de) -# * -# * Created: 5.6.1999 -# ************************************************************************* -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -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 = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ - -EXEEXT = @EXEEXT@ -OBJEXT = @OBJEXT@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -AMTAR = @AMTAR@ -AS = @AS@ -AWK = @AWK@ -BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ -CATOBJEXT = @CATOBJEXT@ -CC = @CC@ -CPP = @CPP@ -CXX = @CXX@ -DATADIRNAME = @DATADIRNAME@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -ECHO = @ECHO@ -GENCAT = @GENCAT@ -GLIBC21 = @GLIBC21@ -GMSGFMT = @GMSGFMT@ -GSM_VERSION = @GSM_VERSION@ -HAVE_LIB = @HAVE_LIB@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INSTOBJEXT = @INSTOBJEXT@ -INTLBISON = @INTLBISON@ -INTLLIBS = @INTLLIBS@ -INTLOBJS = @INTLOBJS@ -INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ -LIB = @LIB@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIB = @LTLIB@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -MKINSTALLDIRS = @MKINSTALLDIRS@ -OBJDUMP = @OBJDUMP@ -PACKAGE = @PACKAGE@ -POSUB = @POSUB@ -RANLIB = @RANLIB@ -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@ - -EXTRA_DIST = config.sub ltconfig missing \ - config.guess install-sh ltmain.sh mkinstalldirs debugconfig.sh - -subdir = scripts -mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/gsm_config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = -DIST_COMMON = Makefile.am Makefile.in config.guess config.rpath \ - config.sub depcomp install-sh ltconfig ltmain.sh missing \ - mkinstalldirs -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu scripts/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -tags: TAGS -TAGS: - -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @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; \ - 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; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile - -installdirs: - -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-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 -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -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-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -distclean-am: clean-am distclean-generic distclean-libtool - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -uninstall-am: uninstall-info-am - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool uninstall uninstall-am uninstall-info-am - -# 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: diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/config.guess b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/config.guess deleted file mode 100755 index 1f5c50c0d1..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/config.guess +++ /dev/null @@ -1,1420 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. - -timestamp='2014-03-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 -# the Free Software Foundation; either version 3 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, see . -# -# 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. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). -# -# Originally written by Per Bothner. -# -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD -# -# Please send patches with a ChangeLog entry to config-patches@gnu.org. - - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright 1992-2014 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." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap '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. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# 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 ; - 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 ; 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) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -case "${UNAME_SYSTEM}" in -Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu - - eval $set_cc_for_build - cat <<-EOF > $dummy.c - #include - #if defined(__UCLIBC__) - LIBC=uclibc - #elif defined(__dietlibc__) - LIBC=dietlibc - #else - LIBC=gnu - #endif - EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` - ;; -esac - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-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. - # - # 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_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 -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # 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 ;; - *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} - 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:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *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. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - 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 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - 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 ;; - arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - 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 - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - 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 ;; - s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH="x86_64" - fi - fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - 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 ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - 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) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - 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 - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $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 ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - 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 ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - 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 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - 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 ;; - *:AIX:*:[4567]) - 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 - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - 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]) - 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 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - 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 - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (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 -q __LP64__ - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - 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 ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - 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 ;; - 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 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - authenticamd | genuineintel | EM64T) - 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 ;; - 8664:Windows_NT:*) - echo x86_64-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 i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - 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/[-(].*//'`-${LIBC} - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - 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-${LIBC} - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi - else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf - fi - fi - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; - crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; - frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } - ;; - openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} - exit ;; - or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} - exit ;; - ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} - exit ;; - ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; - x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - 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 ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - 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.[02]*:*) - 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 - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - 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 ;; - 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|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|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/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 ;; - 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 i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - 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 ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - 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; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { 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; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - 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; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - 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 ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - 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 ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - 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 ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc - fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - fi - elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 - fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; - NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - 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 ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; - x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; -esac - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/config.rpath b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/config.rpath deleted file mode 100755 index 5ead7586a7..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/config.rpath +++ /dev/null @@ -1,513 +0,0 @@ -#! /bin/sh -# Output a system dependent set of variables, describing how to set the -# run time search path of shared libraries in an executable. -# -# Copyright 1996-2002 Free Software Foundation, Inc. -# Taken from GNU libtool, 2001 -# 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. -# -# The first argument passed to this file is the canonical host specification, -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld -# should be set by the caller. -# -# The set of defined variables is at the end of this script. - -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -libext=a -shlibext= - -host="$1" -host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - -wl= -if test "$GCC" = yes; then - wl='-Wl,' -else - case "$host_os" in - aix3* | aix4* | aix5*) - wl='-Wl,' - ;; - hpux9* | hpux10* | hpux11*) - wl='-Wl,' - ;; - irix5* | irix6*) - wl='-Wl,' - ;; - linux*) - echo '__INTEL_COMPILER' > conftest.$ac_ext - if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null - then - : - else - # Intel icc - wl='-Qoption,ld,' - fi - ;; - osf3* | osf4* | osf5*) - wl='-Wl,' - ;; - solaris*) - wl='-Wl,' - ;; - sunos4*) - wl='-Qoption ld ' - ;; - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - if test "x$host_vendor" = xsni; then - wl='-LD' - else - wl='-Wl,' - fi - ;; - esac -fi - -hardcode_libdir_flag_spec= -hardcode_libdir_separator= -hardcode_direct=no -hardcode_minus_L=no - -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 - case "$host_os" in - aix3* | aix4* | aix5*) - # On AIX, the GNU linker is very broken - ld_shlibs=no - ;; - amigaos*) - 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 - : - 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' - ;; - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - : - else - ld_shlibs=no - fi - ;; - sunos4*) - hardcode_direct=yes - ;; - *) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - : - else - ld_shlibs=no - fi - ;; - esac - if test "$ld_shlibs" = yes; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - fi -else - case "$host_os" in - aix3*) - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes; 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 - 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 - hardcode_direct=yes - 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 - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - esac - fi - if test "$aix_use_runtimelinking" = yes; then - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - else - hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' - fi - fi - ;; - amigaos*) - 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=' ' - libext=lib - ;; - darwin* | rhapsody*) - hardcode_direct=yes - ;; - freebsd1*) - ld_shlibs=no - ;; - freebsd2.2*) - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - ;; - freebsd2*) - hardcode_direct=yes - hardcode_minus_L=yes - ;; - freebsd*) - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - ;; - hpux9* | hpux10* | hpux11*) - 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. - ;; - irix5* | irix6*) - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - netbsd*) - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - ;; - newsos6) - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - openbsd*) - hardcode_direct=yes - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - else - case "$host_os" in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - osf3*) - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - osf4* | osf5*) - if test "$GCC" = yes; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - # Both cc and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - hardcode_libdir_separator=: - ;; - sco3.2v5*) - ;; - solaris*) - hardcode_libdir_flag_spec='-R$libdir' - ;; - sunos4*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - ;; - sysv4) - if test "x$host_vendor" = xsno; then - hardcode_direct=yes # is this really true??? - else - hardcode_direct=no # Motorola manual says yes, but my tests say they lie - fi - ;; - sysv4.3*) - ;; - sysv5*) - hardcode_libdir_flag_spec= - ;; - uts4*) - hardcode_libdir_flag_spec='-L$libdir' - ;; - dgux*) - hardcode_libdir_flag_spec='-L$libdir' - ;; - sysv4*MP*) - if test -d /usr/nec; then - ld_shlibs=yes - fi - ;; - sysv4.2uw2*) - hardcode_direct=yes - hardcode_minus_L=no - ;; - sysv5uw7* | unixware7*) - ;; - *) - ld_shlibs=no - ;; - esac -fi - -# Check dynamic linker characteristics -libname_spec='lib$name' -sys_lib_dlsearch_path_spec="/lib /usr/lib" -sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -case "$host_os" in - aix3*) - shlibext=so - ;; - aix4* | aix5*) - shlibext=so - ;; - amigaos*) - shlibext=ixlibrary - ;; - beos*) - shlibext=so - ;; - bsdi4*) - shlibext=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" - ;; - cygwin* | mingw* | pw32*) - case $GCC,$host_os in - yes,cygwin*) - shlibext=dll.a - ;; - yes,mingw*) - shlibext=dll - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` - ;; - yes,pw32*) - shlibext=dll - ;; - *) - shlibext=dll - ;; - esac - ;; - darwin* | rhapsody*) - shlibext=dylib - ;; - freebsd1*) - ;; - freebsd*) - shlibext=so - ;; - gnu*) - shlibext=so - ;; - hpux9* | hpux10* | hpux11*) - shlibext=sl - ;; - irix5* | irix6*) - shlibext=so - case "$host_os" in - irix5*) - libsuff= shlibsuff= - ;; - *) - case $LD in - *-32|*"-32 ") libsuff= shlibsuff= ;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 ;; - *) libsuff= shlibsuff= ;; - esac - ;; - esac - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - ;; - linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) - ;; - linux-gnu*) - shlibext=so - ;; - netbsd*) - shlibext=so - ;; - newsos6) - shlibext=so - ;; - openbsd*) - shlibext=so - ;; - os2*) - libname_spec='$name' - shlibext=dll - ;; - osf3* | osf4* | osf5*) - shlibext=so - 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*) - shlibext=so - ;; - solaris*) - shlibext=so - ;; - sunos4*) - shlibext=so - ;; - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - shlibext=so - case "$host_vendor" in - motorola) - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - uts4*) - shlibext=so - ;; - dgux*) - shlibext=so - ;; - sysv4*MP*) - if test -d /usr/nec; then - shlibext=so - fi - ;; -esac - -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' -escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` -escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` -escaped_sys_lib_search_path_spec=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` -escaped_sys_lib_dlsearch_path_spec=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` - -sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. -# -# 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. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). - - -# Please send patches with a ChangeLog entry to config-patches@gnu.org. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright 1992-2014 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." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# 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* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -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 | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -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/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # 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/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | 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 \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none - ;; - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | 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-* | sv1-* | sx?-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # 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) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - 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 - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | 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 - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - 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 - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - 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 - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - 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-*) - basic_machine=ns32k-pc532 - ;; - 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 | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - 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-* | 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 | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - 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/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - 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 - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tile*) - basic_machine=$basic_machine-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 - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -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* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -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|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -nacl*) - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - c8051-*) - os=-elf - ;; - hexagon-*) - os=-elf - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - ;; - 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 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/debugconfig.sh b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/debugconfig.sh deleted file mode 100755 index c9f597fed4..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/debugconfig.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh - -CXXFLAGS="-g -Wall" ./configure --disable-shared diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/depcomp b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/depcomp deleted file mode 100755 index 807b991f4a..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/depcomp +++ /dev/null @@ -1,423 +0,0 @@ -#! /bin/sh - -# depcomp - compile a program generating dependencies as side-effects -# Copyright 1999, 2000 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. - -# 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. - -# Originally written by Alexandre Oliva . - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi -# `libtool' can also be set to `yes' or `no'. - -if test -z "$depfile"; then - base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` - dir=`echo "$object" | sed 's,/.*$,/,'` - if test "$dir" = "$object"; then - dir= - fi - # FIXME: should be _deps on DOS. - depfile="$dir.deps/$base" -fi - -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. - "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory -## that the space means something, we add a space to the output as -## well. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the - # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> $depfile - echo >> $depfile - - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> $depfile - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. This file always lives in the current directory. - # Also, the AIX compiler puts `$object:' at the start of each line; - # $object doesn't have directory information. - stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` - tmpdepfile="$stripped.u" - outname="$stripped.o" - if test "$libtool" = yes; then - "$@" -Wc,-M - else - "$@" -M - fi - - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - - if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" - sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - tmpdepfile1="$dir.libs/$base.lo.d" - tmpdepfile2="$dir.libs/$base.d" - "$@" -Wc,-MD - else - tmpdepfile1="$dir$base.o.d" - tmpdepfile2="$dir$base.d" - "$@" -MD - fi - - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - if test -f "$tmpdepfile1"; then - tmpdepfile="$tmpdepfile1" - else - tmpdepfile="$tmpdepfile2" - fi - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a space and a tab in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the proprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. We will use -o /dev/null later, - # however we can't do the remplacement now because - # `-o $object' might simply not be used - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - "$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # X makedepend - shift - cleared=no - for arg in "$@"; do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - -*) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix="`echo $object | sed 's/^.*\././'`" - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the proprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E | - sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the proprocessed file to stdout, regardless of -o, - # because we must use -o when running libtool. - "$@" || exit $? - IFS=" " - for arg - do - case "$arg" in - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/install-sh b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/install-sh deleted file mode 100755 index e8436696c1..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/install-sh +++ /dev/null @@ -1,250 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# -# Copyright 1991 by the Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/ltconfig b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/ltconfig deleted file mode 100755 index e3afc39777..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/ltconfig +++ /dev/null @@ -1,3115 +0,0 @@ -#! /bin/sh - -# ltconfig - Create a system-specific libtool. -# 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 -# 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. - -# A lot of this script is taken from autoconf-2.10. - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} -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`} - 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 "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -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' || - test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then - # 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="${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' && - test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = 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' && - 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 -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 - 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' && - 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 - CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - 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" - 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}" "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi - -# 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' - -# The name of this program. -progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` - -# Constants: -PROGRAM=ltconfig -PACKAGE=libtool -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." - -# Global variables: -default_ofile=libtool -can_build_shared=yes -enable_shared=yes -# 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= -ac_config_guess= -ac_config_sub= -host= -nonopt= -ofile="$default_ofile" -verify_host=yes -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. -args= -prev= -for option -do - case "$option" in - -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - eval "$prev=\$option" - prev= - continue - fi - - case "$option" in - --help) cat <&2 - echo "$help" 1>&2 - exit 1 - ;; - - *) - if test -z "$ltmain"; then - ltmain="$option" - elif test -z "$host"; then -# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 -# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then -# echo "$progname: warning \`$option' is not a valid host type" 1>&2 -# fi - host="$option" - else - echo "$progname: too many arguments" 1>&2 - echo "$help" 1>&2 - exit 1 - fi ;; - esac -done - -if test -z "$ltmain"; then - echo "$progname: you must specify a LTMAIN file" 1>&2 - echo "$help" 1>&2 - exit 1 -fi - -if test ! -f "$ltmain"; then - echo "$progname: \`$ltmain' does not exist" 1>&2 - echo "$help" 1>&2 - exit 1 -fi - -# Quote any args containing shell metacharacters. -ltconfig_args= -for arg -do - case "$arg" in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ltconfig_args="$ltconfig_args '$arg'" ;; - *) ltconfig_args="$ltconfig_args $arg" ;; - esac -done - -# A relevant subset of AC_INIT. - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 5 compiler messages saved in config.log -# 6 checking for... messages and results -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>>./config.log - -# NLS nuisances. -# 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 "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. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - -if test -z "$srcdir"; then - # Assume the source directory is the same one as the path to LTMAIN. - srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` - test "$srcdir" = "$ltmain" && srcdir=. -fi - -trap "$rm conftest*; exit 1" 1 2 15 -if test "$verify_host" = yes; then - # Check for config.guess and config.sub. - ac_aux_dir= - for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/config.guess; then - ac_aux_dir=$ac_dir - break - fi - done - if test -z "$ac_aux_dir"; then - echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 - echo "$help" 1>&2 - exit 1 - fi - ac_config_guess=$ac_aux_dir/config.guess - ac_config_sub=$ac_aux_dir/config.sub - - # Make sure we can run config.sub. - if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : - else - echo "$progname: cannot run $ac_config_sub" 1>&2 - echo "$help" 1>&2 - exit 1 - fi - - echo $ac_n "checking host system type""... $ac_c" 1>&6 - - host_alias=$host - case "$host_alias" in - "") - if host_alias=`$SHELL $ac_config_guess`; then : - else - echo "$progname: cannot guess host type; you must specify one" 1>&2 - echo "$help" 1>&2 - exit 1 - fi ;; - esac - host=`$SHELL $ac_config_sub $host_alias` - echo "$ac_t$host" 1>&6 - - # Make sure the host verified. - test -z "$host" && exit 1 - -elif test -z "$host"; then - echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 - echo "$help" 1>&2 - exit 1 -else - host_alias=$host -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 - -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - -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 cru $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -# 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}${PATH_SEPARATOR}" - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then - RANLIB="ranlib" - result="ranlib" - break - fi - done - IFS="$save_ifs" - - echo "$ac_t$result" 1>&6 -fi - -if test -n "$RANLIB"; then - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" -fi - -# 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. -if test "$with_gcc" != yes || test -z "$CC"; then - # 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}${PATH_SEPARATOR}" - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then - CC="gcc" - break - fi - done - IFS="$save_ifs" - - if test -n "$CC"; then - echo "$ac_t$CC" 1>&6 - else - echo "$ac_t"no 1>&6 - fi - fi - - # 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}${PATH_SEPARATOR}" - cc_rejected=no - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/cc || test -f $dir/cc$ac_exeext; then - if test "$dir/cc" = "/usr/ucb/cc"; then - cc_rejected=yes - continue - fi - CC="cc" - break - fi - done - IFS="$save_ifs" - if test $cc_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same name, so the bogon will be chosen - # first if we set CC to just the name; use the full file name. - shift - set dummy "$dir/cc" "$@" - shift - CC="$@" - fi - fi - - if test -n "$CC"; then - echo "$ac_t$CC" 1>&6 - else - echo "$ac_t"no 1>&6 - fi - - if test -z "$CC"; then - echo "$progname: error: no acceptable cc found in \$PATH" 1>&2 - exit 1 - fi - fi - - # 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: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 - with_gcc=yes - fi - $rm conftest.c - echo "$ac_t$with_gcc" 1>&6 -fi - -# Allow CC to be a program name with arguments. -set dummy $CC -compiler="$2" - -echo $ac_n "checking for object suffix... $ac_c" 1>&6 -$rm conftest* -echo 'int i = 1;' > conftest.c -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 - - for ac_file in conftest.*; do - case $ac_file in - *.c) ;; - *) objext=`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* -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= -wl= -link_static_flag= -no_builtin_flag= - -if test "$with_gcc" = yes; then - wl='-Wl,' - link_static_flag='-static' - - case "$host_os" in - beos* | irix5* | irix6* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - 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*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # 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' - ;; - esac -else - # PORTME Check for PIC flags for the system compiler. - case "$host_os" in - aix3* | aix4*) - # All AIX code is PIC. - link_static_flag='-bnso -bI:/lib/syscalls.exp' - ;; - - hpux9* | hpux10* | hpux11*) - # Is there a better link_static_flag that works with the bundled CC? - wl='-Wl,' - link_static_flag="${wl}-a ${wl}archive" - pic_flag='+Z' - ;; - - irix5* | irix6*) - wl='-Wl,' - link_static_flag='-non_shared' - # PIC (with -KPIC) is the default. - ;; - - cygwin* | mingw* | os2*) - # We can build DLLs from non-PIC. - ;; - - osf3* | osf4* | osf5*) - # All OSF/1 code is PIC. - wl='-Wl,' - link_static_flag='-non_shared' - ;; - - sco3.2v5*) - pic_flag='-Kpic' - link_static_flag='-dn' - special_shlib_compile_flags='-belf' - ;; - - solaris*) - pic_flag='-KPIC' - link_static_flag='-Bstatic' - wl='-Wl,' - ;; - - sunos4*) - pic_flag='-PIC' - link_static_flag='-Bstatic' - wl='-Qoption ld ' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - pic_flag='-KPIC' - link_static_flag='-Bstatic' - wl='-Wl,' - ;; - - uts4*) - 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 - ;; - esac -fi - -if test -n "$pic_flag"; then - echo "$ac_t$pic_flag" 1>&6 - - # Check to make sure the pic_flag actually works. - echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6 - $rm conftest* - echo "int some_variable = 0;" > conftest.c - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $pic_flag -DPIC" - 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 - - 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" - ;; - esac - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - can_build_shared=no - pic_flag= - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" - $rm conftest* -else - echo "$ac_t"none 1>&6 -fi - -# 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 -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 out/conftest.err; then - echo "$ac_t"no 1>&6 - compiler_c_o=no - else - echo "$ac_t"yes 1>&6 - compiler_c_o=yes - fi -else - # Append any errors to the config.log. - cat out/conftest.err 1>&5 - compiler_c_o=no - echo "$ac_t"no 1>&6 -fi -CFLAGS="$save_CFLAGS" -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 - echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6 - $rm conftest* - echo "int some_variable = 0;" > conftest.c - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -c -o conftest.lo" - 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 - if test -s conftest.err; then - echo "$ac_t"no 1>&6 - compiler_o_lo=no - else - echo "$ac_t"yes 1>&6 - compiler_o_lo=yes - fi - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - compiler_o_lo=no - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" - $rm conftest* -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 $ac_n "checking if we can lock with hard links... $ac_c" 1>&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 "$ac_t$hard_links" 1>&6 - $rm conftest* - if test "$hard_links" = no; then - echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 - need_locks=warn - fi -else - need_locks=no -fi - -if test "$with_gcc" = yes; then - # Check to see if options -fno-rtti -fno-exceptions are supported by compiler - echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 - $rm conftest* - echo "int some_variable = 0;" > conftest.c - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" - 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 - else - echo "$ac_t"yes 1>&6 - compiler_rtti_exceptions=yes - fi - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - compiler_rtti_exceptions=no - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" - $rm conftest* - - if test "$compiler_rtti_exceptions" = "yes"; then - no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' - else - no_builtin_flag=' -fno-builtin' - fi - -fi - -# Check for any special shared library compilation flags. -if test -n "$special_shlib_compile_flags"; then - echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2 - if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then : - else - echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2 - can_build_shared=no - fi -fi - -echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6 -$rm conftest* -echo 'main(){return(0);}' > conftest.c -save_LDFLAGS="$LDFLAGS" -LDFLAGS="$LDFLAGS $link_static_flag" -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 - link_static_flag= -fi -LDFLAGS="$save_LDFLAGS" -$rm conftest* - -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 conftest.dat - if ln -s X conftest.dat 2>/dev/null; then - $rm conftest.dat - LN_S="ln -s" - else - LN_S=ln - fi - if test "$LN_S" = "ln -s"; then - echo "$ac_t"yes 1>&6 - else - echo "$ac_t"no 1>&6 - fi -fi - -# Make sure LD is an absolute path. -if test -z "$LD"; then - ac_prog=ld - 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: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]:[\\/]*) - 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 are not 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 $ac_n "checking for GNU ld... $ac_c" 1>&6 - echo "$progname:1015: checking for GNU ld" >&5 - else - echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 - echo "$progname:1018: checking for non-GNU ld" >&5 - fi - - 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 - 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 "$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" - fi - - if test -n "$LD"; then - echo "$ac_t$LD" 1>&6 - else - echo "$ac_t"no 1>&6 - fi - - if test -z "$LD"; then - echo "$progname: error: no acceptable ld found in \$PATH" 1>&2 - exit 1 - fi -fi - -# Check to see if it really is or is not GNU ld. -echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6 -# I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then - with_gnu_ld=yes -else - with_gnu_ld=no -fi -echo "$ac_t$with_gnu_ld" 1>&6 - -# See if the linker supports building shared libraries. -echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 - -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= -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 -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)' - 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 $linkopts ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - 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 - - # 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' - - 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 $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; 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*) - # 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 $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 - if test "$with_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*) - 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)' - 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*) - # 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`' - ;; - - 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 $linkopts /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 $linkopts' - 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 $linkopts' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - 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 # 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 $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 $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*) - 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 $linkopts' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - os2*) - 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 $linkopts $objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' - ;; - - osf3*) - if test "$with_gcc" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - 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} $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=: - ;; - - 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 $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 - 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 - ;; - - sunos4*) - 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 $linkopts' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - 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 $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 - ;; - 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. - *) - 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 || 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=${NM="$ac_dir/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 "$NM" && NM=nm - ;; - esac - echo "$ac_t$NM" 1>&6 -fi - -# Check for command to grab the raw symbol name followed by C symbol from nm. -echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 - -# 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 -global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" - -# Define system-specific variables. -case "$host_os" in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw*) - symcode='[ABCDGISTW]' - ;; -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*) - symcode='[BCDEGRST]' - ;; -solaris*) - 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='[ABCDGISTW]' -fi - -# 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\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - $rm conftest* - cat > conftest.c <&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 -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c' - - cat <> conftest.c -#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/^. \(.*\) \(.*\)$/ {"\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 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_var in $nlist" >&5 - fi - else - echo "cannot run $global_symbol_pipe" >&5 - fi - else - 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 "${ac_t}failed" 1>&6 -fi - -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 -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 -echo "$ac_t$hardcode_action" 1>&6 - - -reload_flag= -reload_cmds='$LD$reload_flag -o $output$reload_objs' -echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6 -# PORTME Some linkers may need a different reload flag. -reload_flag='-r' -echo "$ac_t$reload_flag" 1>&6 -test -n "$reload_flag" && reload_flag=" $reload_flag" - -# PORTME Fill in your ld.so 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" -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_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*) - 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*) - 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 - 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 - ;; - -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' - 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= - ;; - -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*) - 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 - 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*) - # 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' - 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* | 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. -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 - deplibs_check_method=pass_all - - if test -f /lib/ld.so.1; then - dynamic_linker='GNU ld.so' - else - # Only the GNU ld.so supports shared libraries on MkLinux. - case "$host_cpu" in - powerpc*) dynamic_linker=no ;; - *) dynamic_linker='Linux ld.so' ;; - esac - fi - ;; - -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 - 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* | 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 - # 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*) - 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 - # 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*) - 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 - 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' - 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 "$ac_t$dynamic_linker" 1>&6 -test "$dynamic_linker" = no && can_build_shared=no - -# 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 -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 - -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes - -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 -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 -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" -if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then - ltecho="$CONFIG_SHELL \$0 --fallback-echo" -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_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 \ - 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 \ - 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 | \ - export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - 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\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case "$ltecho" in - *'\$0 --fallback-echo"') - ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - - trap "$rm \"$ofile\"; exit 1" 1 2 15 - echo "creating $ofile" - $rm "$ofile" - cat < "$ofile" -#! $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 ltconfig or ltmain.sh. -# -# 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 -# 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 -EOF - cfgfile="$ofile" - ;; - -*) - # Double-quote the variables that need it (for aesthetics). - 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 - - # Just create a config file. - cfgfile="$ofile.cfg" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - echo "creating $cfgfile" - $rm "$cfgfile" - cat < "$cfgfile" -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -EOF - ;; -esac - -cat <> "$cfgfile" -# 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 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=$LTCONFIG_VERSION - -# Shell to use when invoking shell scripts. -SHELL=$LTSHELL - -# 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 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=$ltecho - -# The archiver. -AR=$AR - -# The default C compiler. -CC=$CC - -# The linker used to build libraries. -LD=$LD - -# Whether we need hard or soft links. -LN_S=$LN_S - -# A BSD-compatible nm program. -NM=$NM - -# 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=$reload_flag -reload_cmds=$reload_cmds - -# How to pass a linker flag through the compiler. -wl=$wl - -# Object file suffix (normally "o"). -objext="$objext" - -# 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? -compiler_c_o=$compiler_c_o - -# Can we write directly to a .lo ? -compiler_o_lo=$compiler_o_lo - -# 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 - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$no_builtin_flag - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$export_dynamic_flag_spec - -# 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 - -# Format of library name prefix. -libname_spec=$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=$library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$RANLIB -old_archive_cmds=$old_archive_cmds -old_postinstall_cmds=$old_postinstall_cmds -old_postuninstall_cmds=$old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$old_archive_from_new_cmds - -# Commands used to build and install a shared archive. -archive_cmds=$archive_cmds -archive_expsym_cmds=$archive_expsym_cmds -postinstall_cmds=$postinstall_cmds -postuninstall_cmds=$postuninstall_cmds - -# Method to check whether dependent libraries are shared objects. -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 - -# Flag that forces no undefined symbols. -no_undefined_flag=$no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$finish_eval - -# 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 - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$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 - -# 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 -*.sh) - echo '### END LIBTOOL CONFIG' >> "$ofile" - echo >> "$ofile" - case "$host_os" in - aix3*) - cat <<\EOF >> "$ofile" - -# 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 - - # Append the ltmain.sh script. - 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" - ;; - -*) - # Compile the libtool program. - 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: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/ltmain.sh b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/ltmain.sh deleted file mode 100644 index db4982d8a9..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/ltmain.sh +++ /dev/null @@ -1,6538 +0,0 @@ -# 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, 2003, 2004, 2005 -# 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., 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. - 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, and then maybe $echo will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -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 -do - arg="$1" - shift - - case $arg in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - 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" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case $arg in - --help) - show_help=yes - ;; - - --version) - $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' $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" - set -x - preserve_args="$preserve_args $arg" - ;; - - --dry-run | -n) - run=: - ;; - - --features) - $echo "host: $host" - if test "$build_libtool_libs" = yes; then - $echo "enable shared libraries" - else - $echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - $echo "enable static libraries" - else - $echo "disable static libraries" - fi - exit $? - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --preserve-dup-deps) duplicate_deps="yes" ;; - - --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) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE -fi - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -if test -z "$show_help"; then - - # 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 | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) - mode=link - for arg - do - case $arg in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case $mode in - # libtool compile mode - compile) - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - - for arg - do - case $arg_mode in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal - ;; - - target ) - libobj="$arg" - arg_mode=normal - 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 - ;; - - -static | -prefer-pic | -prefer-non-pic) - later="$later $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -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/^ //"` - - # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" - continue - ;; - - * ) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - 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, 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 - - base_compile="$base_compile $lastarg" - done # for arg - - case $arg_mode in - arg) - $echo "$modename: you must specify an argument for -Xcompile" - exit $EXIT_FAILURE - ;; - target) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit $EXIT_FAILURE - ;; - *) - # 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='[cCFSifmso]' - case $libobj in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.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/"` - - case $libobj in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - 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 $EXIT_FAILURE - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - $run $rm $removelist - 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 - cygwin* | mingw* | pw32* | os2*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - 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 $EXIT_FAILURE" 1 2 15 - else - output_obj= - need_locks=no - lockfile= - fi - - # 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 "$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 "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - $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 "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - 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 - exit $error - fi - 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 "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - 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 - 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 <&2 - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - else - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - fi - build_libtool_libs=no - build_old_libs=yes - prefer_static_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test - ;; - *) qarg=$arg ;; - esac - libtool_args="$libtool_args $qarg" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case $prev in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$finalize_command @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit $EXIT_FAILURE - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat $save_arg` - do -# moreargs="$moreargs $fil" - arg=$fil - # 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 - */* | *\\*) . $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 $EXIT_FAILURE - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - xcompiler) - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" - prev= - compile_command="$compile_command $wl$qarg" - 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" - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -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 $EXIT_FAILURE - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - 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 - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # 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* | /*-*-irix*) - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - ;; - esac - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - exit $EXIT_FAILURE - fi - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - case :$dllsearchpath: in - *":$dir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-pw32* | *-*-beos*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-mingw* | *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-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 - ;; - - # 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 - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # The PATH hackery in wrapper scripts is required on Windows - # in order for the loader to find any dlls it needs. - $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 - $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -static) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Wl,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $wl$flag" - linker_flags="$linker_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # Some other compiler flag. - -* | +*) - # 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 - ;; - - *.$objext) - # A standard object. - objs="$objs $arg" - ;; - - *.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 - */* | *\\*) . $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 - ;; - - *.$libext) - # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - fi - continue - ;; - - # Some other compiler argument. - *) - # 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 - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done # argument parsing loop - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - 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" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - # Create the object directory. - if test ! -d "$output_objdir"; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test "$status" -ne 0 && test ! -d "$output_objdir"; then - exit $status - fi - fi - - # Determine the type of output - case $output in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) 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) - for deplib in $deplibs; do - if test "X$duplicate_deps" = "Xyes" ; then - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - libs="$libs $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - 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" ;; - esac - pre_post_deps="$pre_post_deps $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - case $linkmode in - lib) - passes="conv link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - 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 - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - 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 - -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 - 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 - 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 - 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 - 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*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - 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" 1>&2 - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - 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!" - deplibs="$deplib $deplibs" - fi - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - 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 - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - if test "$found" = yes || test -f "$lib"; then : - else - $echo "$modename: cannot find the library \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - - # Check to see that this really is a libtool archive. - 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 $EXIT_FAILURE - fi - - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - $echo "$modename: \`$lib' is not a convenience library" 1>&2 - 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 - linklib="$l" - done - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - 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 $EXIT_FAILURE - fi - 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. 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 - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - abs_ladir="$ladir" - fi - ;; - esac - laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - $echo "$modename: warning: library \`$lib' was moved." 1>&2 - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - 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//'` - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - 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" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - 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 - - # 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 # $linkmode,$pass = prog,link... - - 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 - 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 - set dummy $library_names - realname="$2" - shift; shift - libname=`eval \\$echo \"$libname_spec\"` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw*) - major=`expr $current - $age` - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # 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" - - # 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='~' - cmds=$extract_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - $show "generating import library for \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$old_archive_from_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - 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" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes; then - 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" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit $EXIT_FAILURE - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && \ - test "$hardcode_minus_L" != yes && \ - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) 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. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # 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. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # 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 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 "*** 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." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$newlib_search_path $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in - -L*) path="$deplib" ;; - *.la) - dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$deplib" && dir="." - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - fi - ;; - esac - if grep "^installed=no" $deplib > /dev/null; then - path="$absdir/$objdir" - else - 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 $EXIT_FAILURE - fi - if test "$absdir" != "$libdir"; then - $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 - fi - 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="$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 - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - 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" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - 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" - dlprefiles="$newdlprefiles" - fi - - 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 - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - objs="$objs$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - 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 $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$//'` - fi - ;; - esac - - 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 $EXIT_FAILURE - else - $echo - $echo "*** Warning: Linking the shared library $output against the non-libtool" - $echo "*** objects $objs is not portable!" - libobjs="$libobjs $objs" - fi - fi - - if test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test "$#" -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # 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/-version-number' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # 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|[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' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $revision in - 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' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $age in - 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' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - 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 $EXIT_FAILURE - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - minor_current=`expr $current + 1` - verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - irix | nonstopux) - major=`expr $current - $age + 1` - - 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="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=.`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - major=`expr $current - $age` - versuffix="-$major" - ;; - - *) - $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 - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - 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="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - fi - - if test "$mode" != relink; then - # 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. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - # 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'` - done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs="$deplibs -framework System" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-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" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # 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 behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $rm conftest.c - cat > conftest.c </dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null \ - | grep " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - 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 - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $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. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name=`expr $a_deplib : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test -n "$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 - 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 - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $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. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - 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." - else - $echo "*** Warning: inter-library dependencies are not known to be supported." - fi - $echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - 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." - 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." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - 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." - - 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." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - 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. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - 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" - shift; shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - for link - do - linknames="$linknames $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - 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 "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $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" - generated="$generated $gentop" - - 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" - fi - - # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? - 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 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 - # 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" || { - 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 $? - - 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. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case $output in - *.lo) - if test -n "$objs$old_deplibs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit $EXIT_FAILURE - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $run $rm $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${obj}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # Create the old-style object. - 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" - 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" - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - # 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 $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" - 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" - fi - - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *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 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - 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" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - case :$dllsearchpath: in - *":$libdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case $dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${outputname}.nm" - - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - - # Parse the name list into a source file. - $show "creating $output_objdir/$dlsyms" - - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $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 '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $run $rm $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/$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"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - 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 - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' - else - $echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr void * -#else -# define lt_ptr char * -# define const -#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; -} -lt_preloaded_symbols[] = -{\ -" - - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag";; - esac - esac - - # Now compile the dynamic symbol file. - $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" - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - - # Transform the symbol file into the correct name. - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi - - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - status=$? - - # Delete the generated files. - if test -n "$dlsyms"; then - $show "$rm $output_objdir/${outputname}S.${objext}" - $run $rm "$output_objdir/${outputname}S.${objext}" - fi - - exit $status - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $run $rm $output - # Link the executable and exit - $show "$link_command" - $run eval "$link_command" || exit $? - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $echo for shipping. - 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 - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # 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$,,'` ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *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 $EXIT_FAILURE" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# 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='$sed_quote_subst' - -# 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 - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variable: - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$echo are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $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\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $mkdir \"\$progdir\" - else - $rm \"\$progdir/\$file\" - fi" - - $echo >> $output "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $echo \"\$relink_command_output\" >&2 - $rm \"\$progdir/\$file\" - exit $EXIT_FAILURE - fi - fi - - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $rm \"\$progdir/\$program\"; - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $rm \"\$progdir/\$file\" - fi" - else - $echo >> $output "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $echo >> $output "\ - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $echo >> $output "\ - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" - exit $EXIT_FAILURE - fi - else - # The program doesn't exist. - \$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 $EXIT_FAILURE - fi -fi\ -" - chmod +x $output - fi - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - 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 - cmds=$old_archive_from_new_cmds - else - # 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 - fi - - 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 $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - 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 - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` - 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 $EXIT_FAILURE - fi - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - for lib in $dlfiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - 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 $EXIT_FAILURE - fi - newdlfiles="$newdlfiles $libdir/$name" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - 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 $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 | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - esac - $echo > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# 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' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $echo >> $output "\ -relink_command=\"$relink_command\"" - fi - done - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? - ;; - esac - exit $EXIT_SUCCESS - ;; - - # libtool install mode - install) - modename="$modename: install" - - # There may be an optional sh(1) argument at the beginning of - # 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" | grep shtool > /dev/null; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - 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 - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -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 - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test "$#" -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - 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 $EXIT_FAILURE - fi - - library_names= - old_library= - relink_command= - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ - test "X$dir" = "X$file/" && dir= - dir="$dir$objdir" - - 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\$%%"` - - # 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 $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%"` - else - relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - $echo "$modename: warning: relinking \`$file'" 1>&2 - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - exit $EXIT_FAILURE - fi - fi - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$srcname $destdir/$realname" - $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? - if test -n "$stripme" && test -n "$striplib"; then - $show "$striplib $destdir/$realname" - $run eval "$striplib $destdir/$realname" || exit $? - fi - - 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 && { $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" - cmds=$postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $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 - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run eval "$install_prog \$staticobj \$staticdest" || exit $? - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - 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. - 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 $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 \`$wrapper'" 1>&2 - exit $EXIT_FAILURE - fi - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - 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 $wrapper in - */* | *\\*) . ${wrapper} ;; - *) . ./${wrapper} ;; - esac - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes && test -z "$run"; then - tmpdir="/tmp" - test -n "$TMPDIR" && tmpdir="$TMPDIR" - 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$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'` - - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - ${rm}r "$tmpdir" - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file'" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` - ;; - esac - ;; - esac - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && ${rm}r "$tmpdir" - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - 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. - 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 - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - 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" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = : && exit $EXIT_SUCCESS - - $echo "----------------------------------------------------------------------" - $echo "Libraries have been installed in:" - for libdir in $libdirs; do - $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:" - if test -n "$shlibpath_var"; then - $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" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $echo " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $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'" - 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 $EXIT_SUCCESS - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit $EXIT_FAILURE - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - dir= - case $file in - *.la) - # Check to see that this really is a libtool archive. - 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 $EXIT_FAILURE - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit $EXIT_FAILURE - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -*) ;; - *) - # Do a test to see if this is really a libtool program. - 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 ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" - fi - $echo "$cmd$args" - exit $EXIT_SUCCESS - fi - ;; - - # libtool clean and uninstall mode - clean | uninstall) - modename="$modename: $mode" - rm="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) rm="$rm $arg"; rmforce=yes ;; - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - 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="$origobjdir" - else - objdir="$dir/$origobjdir" - fi - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - test "$mode" = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if (test -L "$file") >/dev/null 2>&1 \ - || (test -h "$file") >/dev/null 2>&1 \ - || test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - - if test "$mode" = uninstall; then - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - 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 - exit_status=1 - fi - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - 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 - exit_status=1 - fi - done - IFS="$save_ifs" - fi - # FIXME: should reinstall the best remaining shared library. - fi - fi - ;; - - *.lo) - # 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 - ;; - - *) - 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 - - # 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 - ;; - esac - $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 - if test -d "$dir"; then - $show "rmdir $dir" - $run rmdir $dir >/dev/null 2>&1 - fi - done - - exit $exit_status - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test -z "$exec_cmd"; then - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - fi -fi # test -z "$show_help" - -if test -n "$exec_cmd"; then - eval exec $exec_cmd - exit $EXIT_FAILURE -fi - -# We need to display help for each of the modes. -case $mode in -"") $echo \ -"Usage: $modename [OPTION]... [MODE-ARG]... - -Provide generalized library-building support services. - - --config show all configuration variables - --debug enable verbose shell tracing --n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --finish same as \`--mode=finish' - --help display this help message and exit - --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: - - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - 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. - -Report bugs to ." - exit $EXIT_SUCCESS - ;; - -clean) - $echo \ -"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - -compile) - $echo \ -"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only - -static always build a \`.o' file suitable for static linking - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - -execute) - $echo \ -"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - -finish) - $echo \ -"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - -install) - $echo \ -"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -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 - -static do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - -uninstall) - $echo \ -"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; -esac - -$echo -$echo "Try \`$modename --help' for more information about other modes." - -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 -# sh-indentation:2 -# End: diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/missing b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/missing deleted file mode 100755 index 6a37006e8f..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/missing +++ /dev/null @@ -1,336 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. -# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 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, 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. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -run=: - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -case "$1" in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case "$1" in - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch]" - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing 0.4 - GNU automake" - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - - aclocal*) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case "$f" in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake*) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the - proper tools for further handling them. - You can get \`$1Help2man' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` - test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if [ ! -f y.tab.h ]; then - echo >y.tab.h - fi - if [ ! -f y.tab.c ]; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex|flex) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if [ ! -f lex.yy.c ]; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` - fi - if [ -f "$file" ]; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit 1 - fi - ;; - - makeinfo) - if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then - # We have makeinfo, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` - fi - touch $file - ;; - - tar) - shift - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - fi - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case "$firstarg" in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case "$firstarg" in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequirements for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/mkinstalldirs b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/mkinstalldirs deleted file mode 100755 index 4324e052bb..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/scripts/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.1 1999/06/27 07:45:05 cvs Exp $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/stamp-h.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/stamp-h.in deleted file mode 100644 index 9788f70238..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/stamp-h.in +++ /dev/null @@ -1 +0,0 @@ -timestamp diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/Makefile.am b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/Makefile.am deleted file mode 100644 index 5213164a76..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/Makefile.am +++ /dev/null @@ -1,65 +0,0 @@ -## Process this file with automake to produce Makefile.in -# ************************************************************************* -# * GSM TA/ME library -# * -# * File: Makefile.am -# * -# * Purpose: tests Makefile -# * -# * Author: Peter Hofmann (software@pxh.de) -# * -# * Created: 21.5.1999 -# ************************************************************************* - -INCLUDES = -I.. - -noinst_PROGRAMS = testsms testsms2 testparser testgsmlib testpb testpb2 \ - testspb testssms testcb - -TESTS = runspb.sh runspb2.sh runssms.sh runsms.sh \ - runparser.sh runspbi.sh - -# test files used for file-based phonebook and SMS testing -EXTRA_DIST = spb.pb runspb.sh runspb2.sh runssms.sh runsms.sh \ - runparser.sh \ - spb.pb spb2.pb \ - testparser-output.txt testspb-output.txt \ - testssms-output.txt testsms-output.txt \ - testspb2-output.txt \ - runspbi.sh spbi2-orig.pb spbi1.pb testspbi-output.txt - -# build testsms from testsms.cc and libgsmme.la -testsms_SOURCES = testsms.cc -testsms_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build testsms2 from testsms2.cc and libgsmme.la -testsms2_SOURCES = testsms2.cc -testsms2_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build testparser from testparser.cc and libgsmme.la -testparser_SOURCES = testparser.cc -testparser_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build testgsmlib from testgsmlib.cc and libgsmme.la -testgsmlib_SOURCES = testgsmlib.cc -testgsmlib_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build testpb from testpb.cc and libgsmme.la -testpb_SOURCES = testpb.cc -testpb_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build testpb2 from testpb2.cc and libgsmme.la -testpb2_SOURCES = testpb2.cc -testpb2_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build testspb from testspb.cc and libgsmme.la -testspb_SOURCES = testspb.cc -testspb_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build testssms from testssms.cc and libgsmme.la -testssms_SOURCES = testssms.cc -testssms_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build testcb from testcb.cc and libgsmme.la -testcb_SOURCES = testcb.cc -testcb_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/Makefile.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/Makefile.in deleted file mode 100644 index e949e268ff..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/Makefile.in +++ /dev/null @@ -1,544 +0,0 @@ -# Makefile.in generated by automake 1.6.3 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# ************************************************************************* -# * GSM TA/ME library -# * -# * File: Makefile.am -# * -# * Purpose: tests Makefile -# * -# * Author: Peter Hofmann (software@pxh.de) -# * -# * Created: 21.5.1999 -# ************************************************************************* -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -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 = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ - -EXEEXT = @EXEEXT@ -OBJEXT = @OBJEXT@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -AMTAR = @AMTAR@ -AS = @AS@ -AWK = @AWK@ -BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ -CATOBJEXT = @CATOBJEXT@ -CC = @CC@ -CPP = @CPP@ -CXX = @CXX@ -DATADIRNAME = @DATADIRNAME@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -ECHO = @ECHO@ -GENCAT = @GENCAT@ -GLIBC21 = @GLIBC21@ -GMSGFMT = @GMSGFMT@ -GSM_VERSION = @GSM_VERSION@ -HAVE_LIB = @HAVE_LIB@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INSTOBJEXT = @INSTOBJEXT@ -INTLBISON = @INTLBISON@ -INTLLIBS = @INTLLIBS@ -INTLOBJS = @INTLOBJS@ -INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ -LIB = @LIB@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIB = @LTLIB@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -MKINSTALLDIRS = @MKINSTALLDIRS@ -OBJDUMP = @OBJDUMP@ -PACKAGE = @PACKAGE@ -POSUB = @POSUB@ -RANLIB = @RANLIB@ -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@ - -INCLUDES = -I.. - -noinst_PROGRAMS = testsms testsms2 testparser testgsmlib testpb testpb2 \ - testspb testssms testcb - - -TESTS = runspb.sh runspb2.sh runssms.sh runsms.sh \ - runparser.sh runspbi.sh - - -# test files used for file-based phonebook and SMS testing -EXTRA_DIST = spb.pb runspb.sh runspb2.sh runssms.sh runsms.sh \ - runparser.sh \ - spb.pb spb2.pb \ - testparser-output.txt testspb-output.txt \ - testssms-output.txt testsms-output.txt \ - testspb2-output.txt \ - runspbi.sh spbi2-orig.pb spbi1.pb testspbi-output.txt - - -# build testsms from testsms.cc and libgsmme.la -testsms_SOURCES = testsms.cc -testsms_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build testsms2 from testsms2.cc and libgsmme.la -testsms2_SOURCES = testsms2.cc -testsms2_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build testparser from testparser.cc and libgsmme.la -testparser_SOURCES = testparser.cc -testparser_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build testgsmlib from testgsmlib.cc and libgsmme.la -testgsmlib_SOURCES = testgsmlib.cc -testgsmlib_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build testpb from testpb.cc and libgsmme.la -testpb_SOURCES = testpb.cc -testpb_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build testpb2 from testpb2.cc and libgsmme.la -testpb2_SOURCES = testpb2.cc -testpb2_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build testspb from testspb.cc and libgsmme.la -testspb_SOURCES = testspb.cc -testspb_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build testssms from testssms.cc and libgsmme.la -testssms_SOURCES = testssms.cc -testssms_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) - -# build testcb from testcb.cc and libgsmme.la -testcb_SOURCES = testcb.cc -testcb_LDADD = ../gsmlib/libgsmme.la $(INTLLIBS) -subdir = tests -mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/gsm_config.h -CONFIG_CLEAN_FILES = -noinst_PROGRAMS = testsms$(EXEEXT) testsms2$(EXEEXT) testparser$(EXEEXT) \ - testgsmlib$(EXEEXT) testpb$(EXEEXT) testpb2$(EXEEXT) \ - testspb$(EXEEXT) testssms$(EXEEXT) testcb$(EXEEXT) -PROGRAMS = $(noinst_PROGRAMS) - -am_testcb_OBJECTS = testcb.$(OBJEXT) -testcb_OBJECTS = $(am_testcb_OBJECTS) -testcb_DEPENDENCIES = ../gsmlib/libgsmme.la -testcb_LDFLAGS = -am_testgsmlib_OBJECTS = testgsmlib.$(OBJEXT) -testgsmlib_OBJECTS = $(am_testgsmlib_OBJECTS) -testgsmlib_DEPENDENCIES = ../gsmlib/libgsmme.la -testgsmlib_LDFLAGS = -am_testparser_OBJECTS = testparser.$(OBJEXT) -testparser_OBJECTS = $(am_testparser_OBJECTS) -testparser_DEPENDENCIES = ../gsmlib/libgsmme.la -testparser_LDFLAGS = -am_testpb_OBJECTS = testpb.$(OBJEXT) -testpb_OBJECTS = $(am_testpb_OBJECTS) -testpb_DEPENDENCIES = ../gsmlib/libgsmme.la -testpb_LDFLAGS = -am_testpb2_OBJECTS = testpb2.$(OBJEXT) -testpb2_OBJECTS = $(am_testpb2_OBJECTS) -testpb2_DEPENDENCIES = ../gsmlib/libgsmme.la -testpb2_LDFLAGS = -am_testsms_OBJECTS = testsms.$(OBJEXT) -testsms_OBJECTS = $(am_testsms_OBJECTS) -testsms_DEPENDENCIES = ../gsmlib/libgsmme.la -testsms_LDFLAGS = -am_testsms2_OBJECTS = testsms2.$(OBJEXT) -testsms2_OBJECTS = $(am_testsms2_OBJECTS) -testsms2_DEPENDENCIES = ../gsmlib/libgsmme.la -testsms2_LDFLAGS = -am_testspb_OBJECTS = testspb.$(OBJEXT) -testspb_OBJECTS = $(am_testspb_OBJECTS) -testspb_DEPENDENCIES = ../gsmlib/libgsmme.la -testspb_LDFLAGS = -am_testssms_OBJECTS = testssms.$(OBJEXT) -testssms_OBJECTS = $(am_testssms_OBJECTS) -testssms_DEPENDENCIES = ../gsmlib/libgsmme.la -testssms_LDFLAGS = - -DEFS = @DEFS@ -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/testcb.Po ./$(DEPDIR)/testgsmlib.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/testparser.Po ./$(DEPDIR)/testpb.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/testpb2.Po ./$(DEPDIR)/testsms.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/testsms2.Po ./$(DEPDIR)/testspb.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/testssms.Po -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -CXXFLAGS = @CXXFLAGS@ -DIST_SOURCES = $(testcb_SOURCES) $(testgsmlib_SOURCES) \ - $(testparser_SOURCES) $(testpb_SOURCES) $(testpb2_SOURCES) \ - $(testsms_SOURCES) $(testsms2_SOURCES) $(testspb_SOURCES) \ - $(testssms_SOURCES) -DIST_COMMON = Makefile.am Makefile.in -SOURCES = $(testcb_SOURCES) $(testgsmlib_SOURCES) $(testparser_SOURCES) $(testpb_SOURCES) $(testpb2_SOURCES) $(testsms_SOURCES) $(testsms2_SOURCES) $(testspb_SOURCES) $(testssms_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .cc .lo .o .obj -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu tests/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -testcb$(EXEEXT): $(testcb_OBJECTS) $(testcb_DEPENDENCIES) - @rm -f testcb$(EXEEXT) - $(CXXLINK) $(testcb_LDFLAGS) $(testcb_OBJECTS) $(testcb_LDADD) $(LIBS) -testgsmlib$(EXEEXT): $(testgsmlib_OBJECTS) $(testgsmlib_DEPENDENCIES) - @rm -f testgsmlib$(EXEEXT) - $(CXXLINK) $(testgsmlib_LDFLAGS) $(testgsmlib_OBJECTS) $(testgsmlib_LDADD) $(LIBS) -testparser$(EXEEXT): $(testparser_OBJECTS) $(testparser_DEPENDENCIES) - @rm -f testparser$(EXEEXT) - $(CXXLINK) $(testparser_LDFLAGS) $(testparser_OBJECTS) $(testparser_LDADD) $(LIBS) -testpb$(EXEEXT): $(testpb_OBJECTS) $(testpb_DEPENDENCIES) - @rm -f testpb$(EXEEXT) - $(CXXLINK) $(testpb_LDFLAGS) $(testpb_OBJECTS) $(testpb_LDADD) $(LIBS) -testpb2$(EXEEXT): $(testpb2_OBJECTS) $(testpb2_DEPENDENCIES) - @rm -f testpb2$(EXEEXT) - $(CXXLINK) $(testpb2_LDFLAGS) $(testpb2_OBJECTS) $(testpb2_LDADD) $(LIBS) -testsms$(EXEEXT): $(testsms_OBJECTS) $(testsms_DEPENDENCIES) - @rm -f testsms$(EXEEXT) - $(CXXLINK) $(testsms_LDFLAGS) $(testsms_OBJECTS) $(testsms_LDADD) $(LIBS) -testsms2$(EXEEXT): $(testsms2_OBJECTS) $(testsms2_DEPENDENCIES) - @rm -f testsms2$(EXEEXT) - $(CXXLINK) $(testsms2_LDFLAGS) $(testsms2_OBJECTS) $(testsms2_LDADD) $(LIBS) -testspb$(EXEEXT): $(testspb_OBJECTS) $(testspb_DEPENDENCIES) - @rm -f testspb$(EXEEXT) - $(CXXLINK) $(testspb_LDFLAGS) $(testspb_OBJECTS) $(testspb_LDADD) $(LIBS) -testssms$(EXEEXT): $(testssms_OBJECTS) $(testssms_DEPENDENCIES) - @rm -f testssms$(EXEEXT) - $(CXXLINK) $(testssms_LDFLAGS) $(testssms_OBJECTS) $(testssms_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcb.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testgsmlib.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testparser.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testpb.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testpb2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testsms.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testsms2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testspb.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testssms.Po@am__quote@ - -distclean-depend: - -rm -rf ./$(DEPDIR) - -.cc.o: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -.cc.obj: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CXXCOMPILE) -c -o $@ `cygpath -w $<` - -.cc.lo: -@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< -CXXDEPMODE = @CXXDEPMODE@ - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -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; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - 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; } \ - 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 - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH - -check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; \ - srcdir=$(srcdir); export srcdir; \ - list='$(TESTS)'; \ - if test -n "$$list"; then \ - for tst in $$list; do \ - if test -f ./$$tst; then dir=./; \ - elif test -f $$tst; then dir=; \ - else dir="$(srcdir)/"; fi; \ - if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *" $$tst "*) \ - xpass=`expr $$xpass + 1`; \ - failed=`expr $$failed + 1`; \ - echo "XPASS: $$tst"; \ - ;; \ - *) \ - echo "PASS: $$tst"; \ - ;; \ - esac; \ - elif test $$? -ne 77; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *" $$tst "*) \ - xfail=`expr $$xfail + 1`; \ - echo "XFAIL: $$tst"; \ - ;; \ - *) \ - failed=`expr $$failed + 1`; \ - echo "FAIL: $$tst"; \ - ;; \ - esac; \ - fi; \ - done; \ - if test "$$failed" -eq 0; then \ - if test "$$xfail" -eq 0; then \ - banner="All $$all tests passed"; \ - else \ - banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ - fi; \ - else \ - if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all tests failed"; \ - else \ - banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ - fi; \ - fi; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - echo "$$dashes"; \ - test "$$failed" -eq 0; \ - else :; fi -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @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; \ - 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; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) check-TESTS -check: check-am -all-am: Makefile $(PROGRAMS) - -installdirs: - -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-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 -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -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-am - -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am - -distclean: distclean-am - -distclean-am: clean-am distclean-compile distclean-depend \ - distclean-generic distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -uninstall-am: uninstall-info-am - -.PHONY: GTAGS all all-am check check-TESTS check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS distclean distclean-compile \ - distclean-depend distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - tags uninstall uninstall-am uninstall-info-am - -# 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: diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runparser.sh b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runparser.sh deleted file mode 100755 index 9ee9d312f5..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runparser.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -errorexit() { - echo $1 - exit 1 -} - -# run the test -./testparser > testparser.log - -# check if output differs from what it should be -diff testparser.log testparser-output.txt diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runsms.sh b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runsms.sh deleted file mode 100755 index f027544ee7..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runsms.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -errorexit() { - echo $1 - exit 1 -} - -# prepare locales to make date format reproducible -LC_ALL=en_US -LANG=en -LINGUAS=en -export LC_ALL LANG LINGUAS - -# run the test -./testsms > testsms.log - -# check if output differs from what it should be -diff testsms.log testsms-output.txt diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runspb.sh b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runspb.sh deleted file mode 100755 index fb8c6200f8..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runspb.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -errorexit() { - echo $1 - exit 1 -} - -cp spb.pb spb-copy.pb || errorexit "could not copy spb.pb to spb-copy.pb" - -# run the test -./testspb > testspb.log - -# add new contents of phonebook file to the test log -cat spb-copy.pb >> testspb.log - -# check if output differs from what it should be -diff testspb.log testspb-output.txt diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runspb2.sh b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runspb2.sh deleted file mode 100755 index df8f123cae..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runspb2.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -errorexit() { - echo $1 - exit 1 -} - -cp spb2.pb spb-copy.pb || errorexit "could not copy spb2.pb to spb2-copy.pb" - -# run the test -./testspb > testspb2.log - -# add new contents of phonebook file to the test log -cat spb-copy.pb >> testspb2.log - -# check if output differs from what it should be -diff testspb2.log testspb2-output.txt diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runspbi.sh b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runspbi.sh deleted file mode 100755 index 94b5b459a4..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runspbi.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -errorexit() { - echo $1 - exit 1 -} - -cp spbi2-orig.pb spbi2.pb || - errorexit "could not copy spbi2-orig.pb to spbi2.pb" - -# run the test -../apps/gsmpb -V -i -s spbi1.pb -d spbi2.pb > testspbi.log - -# add new contents of phonebook file to the test log -cat spbi2.pb >> testspbi.log - -# check if output differs from what it should be -diff testspbi.log testspbi-output.txt diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runssms.sh b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runssms.sh deleted file mode 100755 index 5b11442189..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/runssms.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -errorexit() { - echo $1 - exit 1 -} - -rm -f sms.sms || errorexit "could not delete sms.sms" -touch sms.sms || errorexit "could not create sms.sms" - -# prepare locales to make date format reproducible -LC_ALL=en_US -LANG=en -LINGUAS=en -export LC_ALL LANG LINGUAS - -# run the test -./testssms > testssms.log - -# check if output differs from what it should be -diff testssms.log testssms-output.txt diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spb.pb b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spb.pb deleted file mode 100644 index debd672369..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spb.pb +++ /dev/null @@ -1,11 +0,0 @@ -|Dieter Meier|793045 -|Edgar Hofmann|42345 -|Goethe|847159 -|Hans Hofmann|12345 -|Hans-Dieter Schmidt|82345 -|Hans-Dieter Schmidt|13333345 -|Heiner Mller|7890 -|line with \||0815 -|line with\\|0815 -|One line\rback to start|0815 -|two\nline|0815 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spb2.pb b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spb2.pb deleted file mode 100644 index ed0c16cc73..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spb2.pb +++ /dev/null @@ -1,11 +0,0 @@ -|Dieter Meier|017793045 -|Edgar Hofmann|+4942345 -|Goethe|847159 -|Hans Hofmann|0171 -|Hans-Dieter Schmidt|82345 -|Hans-Dieter Schmidt|13333345 -|Heiner Mller|7890 -|line with \||0815 -|line with\\|0815 -|One line\rback to start|0815 -|two\nline|0815 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spbi1.pb b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spbi1.pb deleted file mode 100644 index 11b913f254..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spbi1.pb +++ /dev/null @@ -1,3 +0,0 @@ -1|Nummer 4|4444444 -3|Nummer 3|3333333 -5|same name|12345 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spbi2-orig.pb b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spbi2-orig.pb deleted file mode 100644 index 90f2337bbd..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/spbi2-orig.pb +++ /dev/null @@ -1,4 +0,0 @@ -2|Nummer 3|3333333 -4|Nummer 4|4444444 -5|same name|23456 - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testcb.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testcb.cc deleted file mode 100644 index 59617d864f..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testcb.cc +++ /dev/null @@ -1,40 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: testcb.cc -// * -// * Purpose: Test cell broadcast SMS -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 3.8.2001 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -int main(int argc, char *argv[]) -{ - try - { - CBMessageRef cbm = new CBMessage("001000320111C3343D0F82C51A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D100"); - - cout << cbm->toString(); - - cbm = new CBMessage("001000320111C4EAB3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D100"); - - cout << cbm->toString(); - } - catch (GsmException &ge) - { - cerr << argv[0] << _("[ERROR]: ") << ge.what() << endl; - } -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testgsmlib.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testgsmlib.cc deleted file mode 100755 index a40e74178d..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testgsmlib.cc +++ /dev/null @@ -1,179 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: testgsmlib.cc -// * -// * Purpose: Test general gsm functions (without SMS/phonebook) -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 17.5.1999 -// ************************************************************************* -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef WIN32 -#include -#include -#else -#include -#endif -#include -#include - -using namespace std; -using namespace gsmlib; - -// some time-consuming tests can be switched off by commenting out the -// following macros -#define TEST_OPERATOR_INFO - -void printForwardReason(string s, ForwardInfo &info) -{ - cout << " " << s << ": " - << (info._active ? "active " : "inactive ") - << "number: " << info._number - << " subaddr: " << info._subAddr - << " time: " << info._time << endl; -} - -int main(int argc, char *argv[]) -{ - try - { - cout << (string)"Opening device " + argv[1] << endl; -#ifdef WIN32 - Ref port = new Win32SerialPort((string)argv[1], 38400); -#else - Ref port = new UnixSerialPort((string)argv[1], B38400); -#endif - - cout << "Creating MeTa object" << endl; - MeTa m(port); - - cout << "Getting ME info" << endl; - MEInfo mei = m.getMEInfo(); - - cout << " Manufacturer: " << mei._manufacturer << endl - << " Model: " << mei._model << endl - << " Revision: " << mei._revision << endl - << " Serial Number: " << mei._serialNumber << endl << endl; - -#ifdef TEST_OPERATOR_INFO - try - { - cout << "Getting operator info" << endl; - vector opis = m.getAvailableOPInfo(); - for (vector::iterator i = opis.begin(); i != opis.end(); ++i) - { - cout << " Status: "; - switch (i->_status) - { - case 0: cout << "unknown"; break; - case 1: cout << "current"; break; - case 2: cout << "available"; break; - case 3: cout << "forbidden"; break; - } - cout << endl - << " Long name: '" << i->_longName << "' " - << " Short name: '" << i->_shortName << "' " - << " Numeric name: " << i->_numericName << endl; - } - } - catch (GsmException &ge) - { - if (ge.getErrorCode() == 0) - cout << "phone failure ignored" << endl; - else - throw; - } - cout << endl; -#endif // TEST_OPERATOR_INFO - - cout << "Current operator info" << endl; - OPInfo opi = m.getCurrentOPInfo(); - cout << " Long name: '" << opi._longName << "' " - << " Short name: '" << opi._shortName << "' " - << " Numeric name: " << opi._numericName << endl - << " Mode: "; - switch (opi._mode) - { - case 0: cout << "automatic"; break; - case 1: cout << "manual"; break; - case 2: cout << "deregister"; break; - case 4: cout << "manual/automatic"; break; - } - cout << endl; - - cout << "Facility lock capabilities" << endl << " "; - vector fclc = m.getFacilityLockCapabilities(); - for (vector::iterator i = fclc.begin(); i != fclc.end(); ++i) - cout << *i << " "; - cout << endl << endl; - - cout << "Facility lock states" << endl; - for (vector::iterator k = fclc.begin(); k != fclc.end(); ++k) - if (*k != "AB" && *k != "AG" && *k != "AC") - { - cout << " " << *k; - if (m.getFacilityLockStatus(*k, VoiceFacility)) - cout << " Voice"; - if (m.getFacilityLockStatus(*k, DataFacility)) - cout << " Data"; - if (m.getFacilityLockStatus(*k, FaxFacility)) - cout << " Fax"; - } - cout << endl; - - cout << "Facilities with password" << endl; - vector pwi = m.getPasswords(); - for (vector::iterator j = pwi.begin(); j != pwi.end(); ++j) - cout << " " << j->_facility << " len " << j->_maxPasswdLen << endl; - cout << endl; - - cout << "Network caller line identification identification: " - << (m.getNetworkCLIP() ? "on" : "off") << endl << endl; - - cout << "Call forwarding information" << endl; - for (int r = 0; r < 4; ++r) - { - switch (r) - { - case 0: cout << "UnconditionalReason" << endl; break; - case 1: cout << "MobileBusyReason" << endl; break; - case 2: cout << "NoReplyReason" << endl; break; - case 3: cout << "NotReachableReason" << endl; break; - } - ForwardInfo voice, fax, data; - m.getCallForwardInfo((ForwardReason)r, voice, fax, data); - printForwardReason("Voice", voice); - printForwardReason("Data", data); - printForwardReason("Fax", fax); - } - cout << endl; - - cout << "Battery charge status" << endl; - int bcs = m.getBatteryChargeStatus(); - switch (bcs) - { - case 0: cout << "ME is powered by the battery" << endl; break; - case 1: cout << "ME has a battery connected, but is not powered by it" - << endl; break; - case 2: cout << "ME does not have a battery connected" << endl; break; - case 3: cout << "Recognized power fault, calls inhibited" << endl; break; - } - cout << endl; - - cout << "Battery charge: " << m.getBatteryCharge() << endl << endl; - - cout << "Signal strength: " << m.getSignalStrength() << endl << endl; - - cout << "Bit error rate: " << m.getBitErrorRate() << endl << endl; - } - catch (GsmException &ge) - { - cerr << "GsmException '" << ge.what() << "'" << endl; - return 1; - } - return 0; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testparser-output.txt b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testparser-output.txt deleted file mode 100644 index a5b16e7fb3..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testparser-output.txt +++ /dev/null @@ -1,22 +0,0 @@ -Test 1 -(),("ME","SM","Which of the three items does not belong here?") - -Test 2 -(1-5),425,"+abcd"efgh" - -Test 3 -(1,2,3,4,5,7,11,12,25),425,Thisisatest."+a"ef"andsoforth - -Test 4 -(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,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125),(20),16 - -Test 5 -SM,7 - -Test 6 -(2,"S TELIA MOBITEL","S TELIA",24001) - -Error 1: expected ')' (at position 4 of string '(4-5') - -Error 3: expected end of line (at position 5 of string '"bla"bla"') - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testparser.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testparser.cc deleted file mode 100644 index 99b178d197..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testparser.cc +++ /dev/null @@ -1,200 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: testparser.cc -// * -// * Purpose: Test AT result code parser -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 17.5.1999 -// ************************************************************************* - -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -void printIntList(vector &vb) -{ - cout << "("; - int j = 0; - bool first = true; - for (vector::iterator i = vb.begin(); - i != vb.end(); ++i) - { - if (*i) - { - if (! first) cout << ","; - cout << j; - first = false; - } - ++j; - } - cout << ")"; -} - -void printIntRange(IntRange ir) -{ - cout << "(" << ir._low << "-" << ir._high << ")"; -} - -void printStringList(vector vs) -{ - bool first = true; - cout << "("; - for (vector::iterator i = vs.begin(); - i != vs.end(); ++i) - { - if (! first) cout << ","; - cout << "\"" << *i << "\""; - first = false; - } - cout << ")"; -} - -int main(int argc, char *argv[]) -{ - try - { - { - cout << "Test 1" << endl; - Parser p((string)",(\"ME\", \"SM\"," + - "\"Which of the three items does not belong here?\")"); - - vector vs1 = p.parseStringList(true); - p.parseComma(); - vector vs2 = p.parseStringList(); - bool comma = p.parseComma(true); - - printStringList(vs1); - cout << ","; - printStringList(vs2); - if (comma) cout << ","; - cout << endl << endl; - } - { - cout << "Test 2" << endl; - Parser p("(1-5),425,\"+abcd\"efgh\""); - - IntRange ir = p.parseRange(); - p.parseComma(); - int i = p.parseInt(); - p.parseComma(); - string s = p.parseString(false, true); - - printIntRange(ir); - cout << "," << i << ",\"" << s << "\"" << endl << endl; - } - { - cout << "Test 3" << endl; - Parser p("(7,1-5,12-11,25),425,This is a test.\"+a\"ef\" and so forth"); - - vector vb = p.parseIntList(); - p.parseComma(); - int i = p.parseInt(); - p.parseComma(); - string s = p.parseEol(); - - printIntList(vb); - cout << "," << i << "," << s << endl << endl; - } - { - cout << "Test 4" << endl; - Parser p("(1-125),20,16"); - - vector vb = p.parseIntList(); - p.parseComma(); - vector vb2 = p.parseIntList(); - p.parseComma(); - int j = p.parseInt(); - - printIntList(vb); - cout << ","; - printIntList(vb2); - cout << "," << j << endl << endl; - } - { - cout << "Test 5" << endl; - Parser p("SM,7"); - - string s = p.parseString(); - p.parseComma(); - int i = p.parseInt(); - - cout << s << "," << i << endl << endl; - } - { - cout << "Test 6" << endl; - Parser p("(2,\"S TELIA MOBITEL\",\"S TELIA\",\"24001\")"); - - p.parseChar('('); - int status = p.parseInt(); - p.parseComma(); - string longName = p.parseString(true); - p.parseComma(); - string shortName = p.parseString(true); - p.parseComma(); - int numericName; - try - { - numericName = p.parseInt(true); - } - catch (GsmException &e) - { - if (e.getErrorClass() == ParserError) - { - // the Ericsson GM12 GSM modem returns the numeric ID as string - string s = p.parseString(); - numericName = checkNumber(s); - } - else - throw e; - } - p.parseChar(')'); - - cout << "(" << status << ",\"" << longName << "\",\"" - << shortName << "\"," - << numericName << ")" << endl << endl; - } - } - catch (GsmException &p) - { - // these tests shouldn't throw exceptions - assert(0); - } - - // Now some tests that should provoke an error - try - { - Parser p("(4-5"); - p.parseRange(); - } - catch (GsmException &p) - { - cout << "Error 1: " << p.what() << endl << endl; - } - try - { - Parser p("(4-5,3-4-5)"); - p.parseIntList(); - } - catch (GsmException &p) - { - cout << "Error 2: " << p.what() << endl << endl; - } - try - { - Parser p("\"bla\"bla\""); - p.parseString(); - p.checkEol(); - } - catch (GsmException &p) - { - cout << "Error 3: " << p.what() << endl << endl; - } - -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testpb.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testpb.cc deleted file mode 100644 index 6f161349ef..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testpb.cc +++ /dev/null @@ -1,52 +0,0 @@ -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -void printPb(PhonebookEntry &e) -{ - cout << "number: " << e.telephone() - << " text: " << e.text() << endl; -} - -int main(int argc, char *argv[]) -{ - try - { - cout << (string)"Opening device " + argv[1] << endl; - Ref port = new UnixSerialPort((string)argv[1], B38400); - - cout << "Creating MeTa object" << endl; - MeTa m(port); - - cout << "Getting phonebook entries" << endl; - vector pbs = m.getPhoneBookStrings(); - for (vector::iterator i = pbs.begin(); i != pbs.end(); ++i) - { - PhonebookRef pb = m.getPhonebook(*i); - - cout << "Phonebook \"" << *i << "\" " << endl - << " Max number length: " << pb->getMaxTelephoneLen() << endl - << " Max text length: " << pb->getMaxTextLen() << endl - << " Capacity: " << pb->capacity() << endl - << " Size: " << pb->size() << endl; - - for (Phonebook::iterator j = pb->begin(); j != pb->end(); ++j) - if (! j->empty()) - cout << " Entry #" << j - pb->begin() - << "Number: \"" << j->telephone() << "\"" - << "Text: \"" << j->text() << "\"" << endl; - } - } - catch (GsmException &ge) - { - cerr << "GsmException '" << ge.what() << "'" << endl; - return 1; - } - return 0; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testpb2.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testpb2.cc deleted file mode 100644 index f9769f9bfc..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testpb2.cc +++ /dev/null @@ -1,75 +0,0 @@ -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -bool isbla(PhonebookEntry &e) -{ - // cerr << "****'" << e.text() << "'" << endl; - return e.text() == "blabla"; -} - -int main(int argc, char *argv[]) -{ - try - { - cout << (string)"Opening device " + argv[1] << endl; - Ref port = new UnixSerialPort((string)argv[1], B38400); - - cout << "Creating MeTa object" << endl; - MeTa m(port); - - cout << "Getting phonebook entries" << endl; - vector pbs = m.getPhoneBookStrings(); - if (pbs.begin() == pbs.end()) - { - cerr << "no phonebooks available" << endl; - exit(1); - } - - PhonebookRef pb = m.getPhonebook(*pbs.begin()); - - cout << "Phonebook \"" << pb->name() << "\" " << endl - << " Max number length: " << pb->getMaxTelephoneLen() << endl - << " Max text length: " << pb->getMaxTextLen() << endl - << " Capacity: " << pb->capacity() << endl; - - cout << "Inserting entry 'blabla'" << endl; - PhonebookEntry e("123456", "blabla"); - pb->insert(pb->end(), e); - - int j = -1; - for (int i = 50; i < 60; ++i) - if (pb()[i].empty()) - { - pb()[i].set("23456", "blabla"); - j = i; - break; - } - - pb->erase(pb->begin() + j); - - Phonebook::iterator k; - do - { - k = find_if(pb->begin(), pb->end(), isbla); - if (k != pb->end()) - { - cerr << "Erasing #" << k - pb->begin() << endl; - pb->erase(k, k + 1); - } - } - while (k != pb->end()); - } - catch (GsmException &ge) - { - cerr << "GsmException '" << ge.what() << "'" << endl; - return 1; - } - return 0; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testsms-output.txt b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testsms-output.txt deleted file mode 100644 index bee3c53bac..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testsms-output.txt +++ /dev/null @@ -1,167 +0,0 @@ ---------------------------------------------------------------------------- -Message type: SMS-DELIVER -SC address: '491710762100' -More messages to send: 1 -Reply path: 0 -User data header indicator: 0 -Status report indication: 0 -Originating address: '171' -Protocol identifier: 0x39 -Data coding scheme: default alphabet -SC timestamp: 04/16/1999 08:09:44 AM (+0200) -User data length: 160 -User data header: 0x -User data: 'T-D1 News bis 31.05.99 kostenlos testen! ber 90 Programme aus Politik, Wirtschaft, Brse, Sport direkt per SMS aufs Handy. Mehr darber unter der Kurzwahl 2323' ---------------------------------------------------------------------------- - - ---------------------------------------------------------------------------- -Message type: SMS-DELIVER -SC address: '491710762100' -More messages to send: 1 -Reply path: 0 -User data header indicator: 0 -Status report indication: 0 -Originating address: '01805000102' -Protocol identifier: 0x39 -Data coding scheme: default alphabet -SC timestamp: 12/17/1998 02:10:55 PM (+0100) -User data length: 159 -User data header: 0x -User data: 'Nicht vergessen! Die XtraWeihnachtsverlosung luft noch bis zum 24.12. Nutzen Sie jetzt Ihre Gewinnchance und faxen Sie Ihren Teiln.-Gutschein an 0180/5000 056' ---------------------------------------------------------------------------- - - ---------------------------------------------------------------------------- -Message type: SMS-DELIVER -SC address: '41794991200' -More messages to send: 1 -Reply path: 0 -User data header indicator: 0 -Status report indication: 0 -Originating address: 'dialing.de ' -Protocol identifier: 0x39 -Data coding scheme: default alphabet -SC timestamp: 04/21/2001 12:15:28 PM (+0000) -User data length: 0 -User data header: 0x -User data: '' ---------------------------------------------------------------------------- - - ---------------------------------------------------------------------------- -Message type: SMS-DELIVER -SC address: '41794991200' -More messages to send: 1 -Reply path: 0 -User data header indicator: 0 -Status report indication: 0 -Originating address: 'dialing.de ' -Protocol identifier: 0x39 -Data coding scheme: default alphabet -SC timestamp: 04/21/2001 12:15:28 PM (+0000) -User data length: 0 -User data header: 0x -User data: '' ---------------------------------------------------------------------------- - - ---------------------------------------------------------------------------- -Message type: SMS-DELIVER -SC address: '' -More messages to send: 0 -Reply path: 0 -User data header indicator: 0 -Status report indication: 0 -Originating address: '' -Protocol identifier: 0x0 -Data coding scheme: default alphabet -SC timestamp: 00/00/2000 12:00:00 AM (+0000) -User data length: 0 -User data header: 0x -User data: '' ---------------------------------------------------------------------------- - - ---------------------------------------------------------------------------- -Message type: SMS-DELIVER -SC address: '' -More messages to send: 0 -Reply path: 0 -User data header indicator: 0 -Status report indication: 0 -Originating address: '' -Protocol identifier: 0x0 -Data coding scheme: default alphabet -SC timestamp: 00/00/2000 12:00:00 AM (+0000) -User data length: 0 -User data header: 0x -User data: '' ---------------------------------------------------------------------------- - - ---------------------------------------------------------------------------- -Message type: SMS-DELIVER-REPORT -SC address: '' -Protocol identifier present: 0 -Data coding scheme present: 0 -User data length present: 0 ---------------------------------------------------------------------------- - - ---------------------------------------------------------------------------- -Message type: SMS-STATUS-REPORT -SC address: '' -More messages to send: 0 -Status report qualifier: 0 -Message reference: 0 -Recipient address: '' -SC timestamp: 00/00/2000 12:00:00 AM (+0000) -Discharge time: 00/00/2000 12:00:00 AM (+0000) -Status: 0x0 'Short message received by the SME' ---------------------------------------------------------------------------- - - ---------------------------------------------------------------------------- -Message type: SMS-COMMAND -SC address: '' -Message reference: 0 -Status report request: 1 -Protocol identifier: 0x0 -Command type: 0x0 -Message number: 0 -Destination address: '' -Command data length: 0 -Command data: '' ---------------------------------------------------------------------------- - - ---------------------------------------------------------------------------- -Message type: SMS-SUBMIT -SC address: '' -Reject duplicates: 1 -Validity period format: relative -Reply path: 0 -User data header indicator: 0 -Status report request: 0 -Message reference: 0 -Destination address: '' -Protocol identifier: 0x0 -Data coding scheme: default alphabet -Validity period: 2 days -User data length: 35 -User data header: 0x -User data: 'This is a submit message, isn't it?' ---------------------------------------------------------------------------- - - ---------------------------------------------------------------------------- -Message type: SMS-SUBMIT-REPORT -SC address: '' -SC timestamp: 00/00/2000 12:00:00 AM (+0000) -Protocol identifier present: 0 -Data coding scheme present: 0 -User data length present: 0 ---------------------------------------------------------------------------- - - diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testsms.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testsms.cc deleted file mode 100644 index bf5423b057..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testsms.cc +++ /dev/null @@ -1,80 +0,0 @@ -// ************************************************************************* -// * GSM TA/ME library -// * -// * File: testsms.cc -// * -// * Purpose: Test coder and encoder for SMS TPDUs -// * -// * Author: Peter Hofmann (software@pxh.de) -// * -// * Created: 17.5.1999 -// ************************************************************************* - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include - -using namespace std; -using namespace gsmlib; - -int main(int argc, char *argv[]) -{ - string pdu; - SMSMessageRef sms; - // test two SMS message I have received - sms = SMSMessage::decode("079194710167120004038571F1390099406180904480A0D41631067296EF7390383D07CD622E58CD95CB81D6EF39BDEC66BFE7207A794E2FBB4320AFB82C07E56020A8FC7D9687DBED32285C9F83A06F769A9E5EB340D7B49C3E1FA3C3663A0B24E4CBE76516680A7FCBE920725A5E5ED341F0B21C346D4E41E1BA790E4286DDE4BC0BD42CA3E5207258EE1797E5A0BA9B5E9683C86539685997EBEF61341B249BC966"); - cout << sms->toString() << endl; - - sms = SMSMessage::decode("0791947101671200040B851008050001F23900892171410155409FCEF4184D07D9CBF273793E2FBB432062BA0CC2D2E5E16B398D7687C768FADC5E96B3DFF3BAFB0C62EFEB663AC8FD1EA341E2F41CA4AFB741329A2B2673819C75BABEEC064DD36590BA4CD7D34149B4BC0C3A96EF69B77B8C0EBBC76550DD4D0699C3F8B21B344D974149B4BCEC0651CB69B6DBD53AD6E9F331BA9C7683C26E102C8683BD6A30180C04ABD900"); - cout << sms->toString() << endl; - - // test SMS decoding and encoding for messages with alphanumeric - // destination address - sms = SMSMessage::decode("07911497941902F00414D0E474989D769F5DE4320839001040122151820000"); - cout << sms->toString() << endl; - pdu = sms->encode(); - sms = SMSMessage::decode(pdu); - cout << sms->toString() << endl; - - // test all message types - sms = new SMSDeliverMessage(); - cout << sms->toString() << endl; - pdu = sms->encode(); - sms = SMSMessage::decode(pdu); - cout << sms->toString() << endl; - - // test all message types - sms = new SMSDeliverReportMessage(); - pdu = sms->encode(); - sms = SMSMessage::decode(pdu, false); - cout << sms->toString() << endl; - - // test all message types - sms = new SMSStatusReportMessage(); - pdu = sms->encode(); - sms = SMSMessage::decode(pdu); - cout << sms->toString() << endl; - - // test all message types - sms = new SMSCommandMessage(); - pdu = sms->encode(); - sms = SMSMessage::decode(pdu, false); - cout << sms->toString() << endl; - - // test all message types - SMSSubmitMessage *subsms = new SMSSubmitMessage(); - subsms->setUserData("This is a submit message, isn't it?"); - sms = subsms; - pdu = sms->encode(); - sms = SMSMessage::decode(pdu, false); - cout << sms->toString() << endl; - - // test all message types - sms = new SMSSubmitReportMessage(); - pdu = sms->encode(); - sms = SMSMessage::decode(pdu); - cout << sms->toString() << endl; - return 0; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testsms2.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testsms2.cc deleted file mode 100644 index cb9b395a86..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testsms2.cc +++ /dev/null @@ -1,89 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef WIN32 -#include -#else -#include -#endif -#include -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -int main(int argc, char *argv[]) -{ - try - { - cout << (string)"Opening device " + argv[1] << endl; -#ifdef WIN32 - Ref port = new Win32SerialPort((string)argv[1], 38400); -#else - Ref port = new UnixSerialPort((string)argv[1], B38400); -#endif - - cout << "Creating MeTa object" << endl; - MeTa m(port); - - cout << "Setting message service level to 1" << endl; - m.setMessageService(1); - - vector storeList = m.getSMSStoreNames(); - - for (vector::iterator stn = storeList.begin(); - stn != storeList.end(); ++stn) - { - cout << "Getting store \"" << *stn << "\"" << endl; - SMSStoreRef st = m.getSMSStore(*stn); - - SMSMessageRef sms; - cout << "Creating SMS Submit Message and putting it into store" << endl; - SMSSubmitMessage *subsms = new SMSSubmitMessage(); -// Address scAddr("+491710760000"); -// subsms->setServiceCentreAddress(scAddr); - Address destAddr("0177123456"); - subsms->setDestinationAddress(destAddr); - subsms->setUserData("This message was sent from the store."); - TimePeriod tp; - tp._format = TimePeriod::Relative; - tp._relativeTime = 100; - /*subsms->setValidityPeriod(tp); - subsms->setValidityPeriodFormat(tp._format); - subsms->setStatusReportRequest(true);*/ - sms = subsms; - SMSStore::iterator smsIter = st->insert(st->end(), SMSStoreEntry(sms)); - cout << "Message entered at index #" - << smsIter - st->begin() << endl; - - //m.sendSMS(sms); - SMSMessageRef ackPdu; - int messageRef = smsIter->send(ackPdu); - cout << "Message reference: " << messageRef << endl - << "ACK PDU:" << endl - << (ackPdu.isnull() ? "no ack pdu" : ackPdu->toString()) - << endl; - - /* cout << "Erasing all unsent messages" << endl; - for (SMSStore::iterator s = st->begin(); s != st->end(); ++s) - if (! s->empty() && s->status() == SMSStoreEntry::StoredUnsent) - st->erase(s);*/ - - cout << "Printing store \"" << *stn << "\"" << endl; - for (SMSStore::iterator s = st->begin(); s != st->end(); ++s) - if (! s->empty()) - cout << s->message()->toString(); - - break; // only do one store - } - } - catch (GsmException &ge) - { - cerr << "GsmException '" << ge.what() << "'" << endl; - return 1; - } - return 0; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspb-output.txt b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspb-output.txt deleted file mode 100644 index 83a56fa9f9..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspb-output.txt +++ /dev/null @@ -1,47 +0,0 @@ -Entries in pbs-copy.pb: - Text: Dieter Meier Telephone: 793045 - Text: Edgar Hofmann Telephone: 42345 - Text: Goethe Telephone: 847159 - Text: Hans Hofmann Telephone: 12345 - Text: Hans-Dieter Schmidt Telephone: 82345 - Text: Hans-Dieter Schmidt Telephone: 13333345 - Text: Heiner Mller Telephone: 7890 - Text: line with | Telephone: 0815 - Text: line with\ Telephone: 0815 - Text: One line back to start Telephone: 0815 - Text: two -line Telephone: 0815 -Removing entries with telephone == 0815 -Entries in pbs-copy.pb<2>: - Text: Hans Hofmann Telephone: 12345 - Text: Hans-Dieter Schmidt Telephone: 13333345 - Text: Edgar Hofmann Telephone: 42345 - Text: Heiner Mller Telephone: 7890 - Text: Dieter Meier Telephone: 793045 - Text: Hans-Dieter Schmidt Telephone: 82345 - Text: Goethe Telephone: 847159 -Inserting some entries -Entries in pbs-copy.pb<3>: - Text: Dieter Meier Telephone: 793045 - Text: Edgar Hofmann Telephone: 42345 - Text: Goethe Telephone: 847159 - Text: Hans Hofmann Telephone: 12345 - Text: Hans-Dieter Schmidt Telephone: 13333345 - Text: Hans-Dieter Schmidt Telephone: 41598254 - Text: Hans-Dieter Schmidt Telephone: 82345 - Text: Hans-Dieter|Hofmann Telephone: 34058 - Text: Heiner Mller Telephone: 7890 - Text: new line with continued Telephone: 08152 -Erasing all Hans-Dieter Schmidt entries -About to erase: - Text: Hans-Dieter Schmidt Telephone: 13333345 - Text: Hans-Dieter Schmidt Telephone: 41598254 - Text: Hans-Dieter Schmidt Telephone: 82345 -Writing back to file -|Dieter Meier|793045 -|Edgar Hofmann|42345 -|Goethe|847159 -|Hans Hofmann|12345 -|Hans-Dieter\|Hofmann|34058 -|Heiner Mller|7890 -|new line with \r continued|08152 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspb.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspb.cc deleted file mode 100644 index 43b9f512db..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspb.cc +++ /dev/null @@ -1,81 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -void printPb(PhonebookEntry &e) -{ - cout << "number: " << e.telephone() - << " text: " << e.text() << endl; -} - -int main(int argc, char *argv[]) -{ - try - { - // open phonebook file - SortedPhonebook pb((string)"spb-copy.pb", false); - - // print all entries - cout << "Entries in pbs-copy.pb:" << endl; - for (SortedPhonebook::iterator i = pb.begin(); i != pb.end(); ++i) - cout << " Text: " << i->text() - << " Telephone: " << i->telephone() << endl; - - // remove all entries with telephone == "0815" - cout << "Removing entries with telephone == 0815" << endl; - pb.setSortOrder(ByTelephone); - - string s = "0815"; - pb.erase(s); - - cout << "Entries in pbs-copy.pb<2>:" << endl; - for (SortedPhonebook::iterator i = pb.begin(); i != pb.end(); ++i) - cout << " Text: " << i->text() - << " Telephone: " << i->telephone() << endl; - - // insert some entries - cout << "Inserting some entries" << endl; - pb.insert(PhonebookEntryBase("08152", "new line with \r continued")); - pb.insert(PhonebookEntryBase("41598254", "Hans-Dieter Schmidt")); - pb.insert(PhonebookEntryBase("34058", "Hans-Dieter|Hofmann")); - - pb.setSortOrder(ByText); - cout << "Entries in pbs-copy.pb<3>:" << endl; - for (SortedPhonebook::iterator i = pb.begin(); i != pb.end(); ++i) - cout << " Text: " << i->text() - << " Telephone: " << i->telephone() << endl; - - // test erasing all "Hans-Dieter Schmidt" entries - cout << "Erasing all Hans-Dieter Schmidt entries" << endl; - s = "Hans-Dieter Schmidt"; - pair range = - pb.equal_range(s); - cout << "About to erase:" << endl; - for (SortedPhonebook::iterator i = range.first; i != range.second; ++i) - cout << " Text: " << i->text() - << " Telephone: " << i->telephone() << endl; - - pb.erase(range.first, range.second); - - // write back to file - cout << "Writing back to file" << endl; - pb.sync(); - - // tests the NoCopy class - //SortedPhonebook pb2("spb.pb"); - //pb2 = pb; - } - catch (GsmException &ge) - { - cerr << "GsmException '" << ge.what() << "'" << endl; - return 1; - } - return 0; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspb2-output.txt b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspb2-output.txt deleted file mode 100644 index 60e54ba669..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspb2-output.txt +++ /dev/null @@ -1,47 +0,0 @@ -Entries in pbs-copy.pb: - Text: Dieter Meier Telephone: 017793045 - Text: Edgar Hofmann Telephone: +4942345 - Text: Goethe Telephone: 847159 - Text: Hans Hofmann Telephone: 0171 - Text: Hans-Dieter Schmidt Telephone: 82345 - Text: Hans-Dieter Schmidt Telephone: 13333345 - Text: Heiner Mller Telephone: 7890 - Text: line with | Telephone: 0815 - Text: line with\ Telephone: 0815 - Text: One line back to start Telephone: 0815 - Text: two -line Telephone: 0815 -Removing entries with telephone == 0815 -Entries in pbs-copy.pb<2>: - Text: Edgar Hofmann Telephone: +4942345 - Text: Hans Hofmann Telephone: 0171 - Text: Dieter Meier Telephone: 017793045 - Text: Hans-Dieter Schmidt Telephone: 13333345 - Text: Heiner Mller Telephone: 7890 - Text: Hans-Dieter Schmidt Telephone: 82345 - Text: Goethe Telephone: 847159 -Inserting some entries -Entries in pbs-copy.pb<3>: - Text: Dieter Meier Telephone: 017793045 - Text: Edgar Hofmann Telephone: +4942345 - Text: Goethe Telephone: 847159 - Text: Hans Hofmann Telephone: 0171 - Text: Hans-Dieter Schmidt Telephone: 13333345 - Text: Hans-Dieter Schmidt Telephone: 41598254 - Text: Hans-Dieter Schmidt Telephone: 82345 - Text: Hans-Dieter|Hofmann Telephone: 34058 - Text: Heiner Mller Telephone: 7890 - Text: new line with continued Telephone: 08152 -Erasing all Hans-Dieter Schmidt entries -About to erase: - Text: Hans-Dieter Schmidt Telephone: 13333345 - Text: Hans-Dieter Schmidt Telephone: 41598254 - Text: Hans-Dieter Schmidt Telephone: 82345 -Writing back to file -|Dieter Meier|017793045 -|Edgar Hofmann|+4942345 -|Goethe|847159 -|Hans Hofmann|0171 -|Hans-Dieter\|Hofmann|34058 -|Heiner Mller|7890 -|new line with \r continued|08152 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspbi-output.txt b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspbi-output.txt deleted file mode 100644 index e4a33e2fa6..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testspbi-output.txt +++ /dev/null @@ -1,8 +0,0 @@ -updating 'same name' tel# 23456 to new tel# 12345(index 5) -deleting 'Nummer 3' tel# 3333333 (index #2) -deleting 'Nummer 4' tel# 4444444 (index #4) -inserting 'Nummer 4' tel# 4444444 (index #1) -inserting 'Nummer 3' tel# 3333333 (index #3) -1|Nummer 4|4444444 -3|Nummer 3|3333333 -5|same name|12345 diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testssms-output.txt b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testssms-output.txt deleted file mode 100644 index a0e7905939..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testssms-output.txt +++ /dev/null @@ -1,157 +0,0 @@ -Entries in sms.sms<0>: -Inserting some entries -Entries in sms.sms<1>: -Entry#2: ---------------------------------------------------------------------------- -Message type: SMS-SUBMIT -SC address: '' -Reject duplicates: 1 -Validity period format: relative -Reply path: 0 -User data header indicator: 0 -Status report request: 0 -Message reference: 0 -Destination address: '0177123456' -Protocol identifier: 0x0 -Data coding scheme: default alphabet -Validity period: 2 days -User data length: 9 -User data header: 0x -User data: 'submit me' ---------------------------------------------------------------------------- - - -Entry#3: ---------------------------------------------------------------------------- -Message type: SMS-SUBMIT -SC address: '' -Reject duplicates: 1 -Validity period format: relative -Reply path: 0 -User data header indicator: 0 -Status report request: 0 -Message reference: 0 -Destination address: '' -Protocol identifier: 0x0 -Data coding scheme: default alphabet -Validity period: 2 days -User data length: 35 -User data header: 0x -User data: 'This is a submit message, isn't it?' ---------------------------------------------------------------------------- - - -Entry#1: ---------------------------------------------------------------------------- -Message type: SMS-DELIVER -SC address: '491710762100' -More messages to send: 1 -Reply path: 0 -User data header indicator: 0 -Status report indication: 0 -Originating address: '01805000102' -Protocol identifier: 0x39 -Data coding scheme: default alphabet -SC timestamp: 12/17/1998 02:10:55 PM (+0100) -User data length: 159 -User data header: 0x -User data: 'Nicht vergessen! Die XtraWeihnachtsverlosung luft noch bis zum 24.12. Nutzen Sie jetzt Ihre Gewinnchance und faxen Sie Ihren Teiln.-Gutschein an 0180/5000 056' ---------------------------------------------------------------------------- - - -Entry#0: ---------------------------------------------------------------------------- -Message type: SMS-DELIVER -SC address: '491710762100' -More messages to send: 1 -Reply path: 0 -User data header indicator: 0 -Status report indication: 0 -Originating address: '171' -Protocol identifier: 0x39 -Data coding scheme: default alphabet -SC timestamp: 04/16/1999 08:09:44 AM (+0200) -User data length: 160 -User data header: 0x -User data: 'T-D1 News bis 31.05.99 kostenlos testen! ber 90 Programme aus Politik, Wirtschaft, Brse, Sport direkt per SMS aufs Handy. Mehr darber unter der Kurzwahl 2323' ---------------------------------------------------------------------------- - - -Entries in sms.sms<2>: -Entry#3: ---------------------------------------------------------------------------- -Message type: SMS-SUBMIT -SC address: '' -Reject duplicates: 1 -Validity period format: relative -Reply path: 0 -User data header indicator: 0 -Status report request: 0 -Message reference: 0 -Destination address: '' -Protocol identifier: 0x0 -Data coding scheme: default alphabet -Validity period: 2 days -User data length: 35 -User data header: 0x -User data: 'This is a submit message, isn't it?' ---------------------------------------------------------------------------- - - -Entry#2: ---------------------------------------------------------------------------- -Message type: SMS-SUBMIT -SC address: '' -Reject duplicates: 1 -Validity period format: relative -Reply path: 0 -User data header indicator: 0 -Status report request: 0 -Message reference: 0 -Destination address: '0177123456' -Protocol identifier: 0x0 -Data coding scheme: default alphabet -Validity period: 2 days -User data length: 9 -User data header: 0x -User data: 'submit me' ---------------------------------------------------------------------------- - - -Entry#1: ---------------------------------------------------------------------------- -Message type: SMS-DELIVER -SC address: '491710762100' -More messages to send: 1 -Reply path: 0 -User data header indicator: 0 -Status report indication: 0 -Originating address: '01805000102' -Protocol identifier: 0x39 -Data coding scheme: default alphabet -SC timestamp: 12/17/1998 02:10:55 PM (+0100) -User data length: 159 -User data header: 0x -User data: 'Nicht vergessen! Die XtraWeihnachtsverlosung luft noch bis zum 24.12. Nutzen Sie jetzt Ihre Gewinnchance und faxen Sie Ihren Teiln.-Gutschein an 0180/5000 056' ---------------------------------------------------------------------------- - - -Entry#0: ---------------------------------------------------------------------------- -Message type: SMS-DELIVER -SC address: '491710762100' -More messages to send: 1 -Reply path: 0 -User data header indicator: 0 -Status report indication: 0 -Originating address: '171' -Protocol identifier: 0x39 -Data coding scheme: default alphabet -SC timestamp: 04/16/1999 08:09:44 AM (+0200) -User data length: 160 -User data header: 0x -User data: 'T-D1 News bis 31.05.99 kostenlos testen! ber 90 Programme aus Politik, Wirtschaft, Brse, Sport direkt per SMS aufs Handy. Mehr darber unter der Kurzwahl 2323' ---------------------------------------------------------------------------- - - -Writing back to file diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testssms.cc b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testssms.cc deleted file mode 100644 index 4c30bd544f..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/tests/testssms.cc +++ /dev/null @@ -1,68 +0,0 @@ -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace gsmlib; - -int main(int argc, char *argv[]) -{ - try - { - // open SMS store file - SortedSMSStore sms((string)"sms.sms"); - - // print all entries - cout << "Entries in sms.sms<0>:" << endl; - for (SortedSMSStore::iterator i = sms.begin(); i != sms.end(); ++i) - cout << "Entry#" << i->index() << ":" << endl - << i->message()->toString() << endl; - - // insert some entries - cout << "Inserting some entries" << endl; - SMSMessageRef smsMessage; - // test two SMS message I have received - smsMessage = SMSMessage::decode("079194710167120004038571F1390099406180904480A0D41631067296EF7390383D07CD622E58CD95CB81D6EF39BDEC66BFE7207A794E2FBB4320AFB82C07E56020A8FC7D9687DBED32285C9F83A06F769A9E5EB340D7B49C3E1FA3C3663A0B24E4CBE76516680A7FCBE920725A5E5ED341F0B21C346D4E41E1BA790E4286DDE4BC0BD42CA3E5207258EE1797E5A0BA9B5E9683C86539685997EBEF61341B249BC966"); - sms.insert(SMSStoreEntry(smsMessage)); - - smsMessage = SMSMessage::decode("0791947101671200040B851008050001F23900892171410155409FCEF4184D07D9CBF273793E2FBB432062BA0CC2D2E5E16B398D7687C768FADC5E96B3DFF3BAFB0C62EFEB663AC8FD1EA341E2F41CA4AFB741329A2B2673819C75BABEEC064DD36590BA4CD7D34149B4BC0C3A96EF69B77B8C0EBBC76550DD4D0699C3F8B21B344D974149B4BCEC0651CB69B6DBD53AD6E9F331BA9C7683C26E102C8683BD6A30180C04ABD900"); - sms.insert(SMSStoreEntry(smsMessage)); - - smsMessage = new SMSSubmitMessage("submit me", "0177123456"); - sms.insert(SMSStoreEntry(smsMessage)); - - SMSSubmitMessage *subsms = new SMSSubmitMessage(); - subsms->setUserData("This is a submit message, isn't it?"); - smsMessage = subsms; - sms.insert(SMSStoreEntry(smsMessage)); - - // print all entries - cout << "Entries in sms.sms<1>:" << endl; - for (SortedSMSStore::iterator i = sms.begin(); i != sms.end(); ++i) - cout << "Entry#" << i->index() << ":" << endl - << i->message()->toString() << endl; - - // sort by telephone number - sms.setSortOrder(ByAddress); - - // print all entries - cout << "Entries in sms.sms<2>:" << endl; - for (SortedSMSStore::iterator i = sms.begin(); i != sms.end(); ++i) - cout << "Entry#" << i->index() << ":" << endl - << i->message()->toString() << endl; - - // write back to file - cout << "Writing back to file" << endl; - sms.sync(); - - } - catch (GsmException &ge) - { - cerr << "GsmException '" << ge.what() << "'" << endl; - return 1; - } - return 0; -} diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/COPYING b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/COPYING deleted file mode 100644 index 78e994dd75..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/COPYING +++ /dev/null @@ -1,5 +0,0 @@ -WARNING - - The files getopt.c and getopt.h in this subdirectory (win32) are - not covered by the GNU LIBRARY GENERAL PUBLIC LICENSE as - reproduced in ../COPYING. They carry their own license instead. diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/Makefile.am b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/Makefile.am deleted file mode 100644 index a666fabf31..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -## Process this file with automake to produce Makefile.in -# ************************************************************************* -# * GSM TA/ME library -# * -# * File: Makefile.am -# * -# * Purpose: win32 Makefile -# * -# * Author: Peter Hofmann (software@pxh.de) -# * -# * Created: 19.1.2001 -# ************************************************************************* - -EXTRA_DIST = getopt.c gsmctl.dsp gsmpb.dsp testgsmlib.dsp \ - getopt.h gsmlib.dsp gsmsendsms.dsp testsms.dsp \ - README.win gsm_config.h gsmlib.dsw gsmsmsstore.dsp \ - gsmsmsd.dsp testsms2.dsp diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/Makefile.in b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/Makefile.in deleted file mode 100644 index 4117eea211..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/Makefile.in +++ /dev/null @@ -1,259 +0,0 @@ -# Makefile.in generated by automake 1.6.3 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# ************************************************************************* -# * GSM TA/ME library -# * -# * File: Makefile.am -# * -# * Purpose: win32 Makefile -# * -# * Author: Peter Hofmann (software@pxh.de) -# * -# * Created: 19.1.2001 -# ************************************************************************* -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -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 = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ - -EXEEXT = @EXEEXT@ -OBJEXT = @OBJEXT@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -AMTAR = @AMTAR@ -AS = @AS@ -AWK = @AWK@ -BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ -CATOBJEXT = @CATOBJEXT@ -CC = @CC@ -CPP = @CPP@ -CXX = @CXX@ -DATADIRNAME = @DATADIRNAME@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -ECHO = @ECHO@ -GENCAT = @GENCAT@ -GLIBC21 = @GLIBC21@ -GMSGFMT = @GMSGFMT@ -GSM_VERSION = @GSM_VERSION@ -HAVE_LIB = @HAVE_LIB@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INSTOBJEXT = @INSTOBJEXT@ -INTLBISON = @INTLBISON@ -INTLLIBS = @INTLLIBS@ -INTLOBJS = @INTLOBJS@ -INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ -LIB = @LIB@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIB = @LTLIB@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -MKINSTALLDIRS = @MKINSTALLDIRS@ -OBJDUMP = @OBJDUMP@ -PACKAGE = @PACKAGE@ -POSUB = @POSUB@ -RANLIB = @RANLIB@ -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@ - -EXTRA_DIST = getopt.c gsmctl.dsp gsmpb.dsp testgsmlib.dsp \ - getopt.h gsmlib.dsp gsmsendsms.dsp testsms.dsp \ - README.win gsm_config.h gsmlib.dsw gsmsmsstore.dsp \ - gsmsmsd.dsp testsms2.dsp - -subdir = win32 -mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/gsm_config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = -DIST_COMMON = COPYING Makefile.am Makefile.in -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu win32/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -tags: TAGS -TAGS: - -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @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; \ - 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; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile - -installdirs: - -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-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 -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -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-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -distclean-am: clean-am distclean-generic distclean-libtool - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -uninstall-am: uninstall-info-am - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool uninstall uninstall-am uninstall-info-am - -# 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: diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/README.win b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/README.win deleted file mode 100644 index 17aa648dd1..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/README.win +++ /dev/null @@ -1,41 +0,0 @@ -INTRODUCTION - - This is a Win32 port of gsmlib contributed by Frediano Ziglio - (Frediano.Ziglio@omnitel.it) and adapted by me. You can use the - library for inclusion in your own programs or the command line tools - which have been ported (with the exception of gsmsmsd). - -COMPILATION - - You need Microsoft VC++ 6.0 to compile the library and command - line tools. Because I prefer to use the ending .cc for C++ files you - need to make some changes to your development environment. These are - documented by Microsoft under this URL (one line): - - http://support.microsoft.com/support/kb/articles/Q181/5/ - 06.ASP?LN=EN-US&SD=gn&FR=0&qry=.cc&rnk=1&src=DHCS_MSPSS_gn_SRCH&SPR=VCC - - The title of the document is "HOWTO: Make VC++ Recognize File - Extensions as C/C++ Files". - - Then open the workspace gsmlib.dsw with Developer - Studio. Compilation should be straightforward after that, just make a - batch build of everything. - - If you encounter problems you can use the debug versions and set - the environment variable GSMLIB_DEBUG to 1 or 2 to get debugging - output. - -HINTS - - Use COMx: (x is the number of the COM device) instead of the UNIX - device name. If this doesn't work use "\\.\COMx:". - - - The files under Release are without debugging code. If you see - errors please use the Debug versions and execute - - set GSMLIB_DEBUG=2 - - for executing the programs. Please send me the debugging - output: - - gsmsmsstore ..... 2> \temp\debug.log diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/getopt.c b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/getopt.c deleted file mode 100644 index 45fcedc063..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/getopt.c +++ /dev/null @@ -1,185 +0,0 @@ -/***************************************************************************** - * - * MODULE NAME : GETOPT.C - * - * COPYRIGHTS: - * This module contains code made available by IBM - * Corporation on an AS IS basis. Any one receiving the - * module is considered to be licensed under IBM copyrights - * to use the IBM-provided source code in any way he or she - * deems fit, including copying it, compiling it, modifying - * it, and redistributing it, with or without - * modifications. No license under any IBM patents or - * patent applications is to be implied from this copyright - * license. - * - * A user of the module should understand that IBM cannot - * provide technical support for the module and will not be - * responsible for any consequences of use of the program. - * - * Any notices, including this one, are not to be removed - * from the module without the prior written consent of - * IBM. - * - * AUTHOR: Original author: - * G. R. Blair (BOBBLAIR at AUSVM1) - * Internet: bobblair@bobblair.austin.ibm.com - * - * Extensively revised by: - * John Q. Walker II, Ph.D. (JOHHQ at RALVM6) - * Internet: johnq@ralvm6.vnet.ibm.com - * - *****************************************************************************/ - -/****************************************************************************** - * getopt() - * - * The getopt() function is a command line parser. It returns the next - * option character in argv that matches an option character in opstring. - * - * The argv argument points to an array of argc+1 elements containing argc - * pointers to character strings followed by a null pointer. - * - * The opstring argument points to a string of option characters; if an - * option character is followed by a colon, the option is expected to have - * an argument that may or may not be separated from it by white space. - * The external variable optarg is set to point to the start of the option - * argument on return from getopt(). - * - * The getopt() function places in optind the argv index of the next argument - * to be processed. The system initializes the external variable optind to - * 1 before the first call to getopt(). - * - * When all options have been processed (that is, up to the first nonoption - * argument), getopt() returns EOF. The special option "--" may be used to - * delimit the end of the options; EOF will be returned, and "--" will be - * skipped. - * - * The getopt() function returns a question mark (?) when it encounters an - * option character not included in opstring. This error message can be - * disabled by setting opterr to zero. Otherwise, it returns the option - * character that was detected. - * - * If the special option "--" is detected, or all options have been - * processed, EOF is returned. - * - * Options are marked by either a minus sign (-) or a slash (/). - * - * No errors are defined. - *****************************************************************************/ - -#include /* for EOF */ -#include /* for strchr() */ - - -#ifdef __cplusplus -extern "C" { -#endif - -/* static (global) variables that are specified as exported by getopt() */ -char *optarg = NULL; /* pointer to the start of the option argument */ -int optind = 1; /* number of the next argv[] to be evaluated */ -int opterr = 1; /* non-zero if a question mark should be returned - when a non-valid option character is detected */ - -/* handle possible future character set concerns by putting this in a macro */ -#define _next_char(string) (char)(*(string+1)) - -int getopt(int argc, char *argv[], char *opstring) -{ - static char *pIndexPosition = NULL; /* place inside current argv string */ - char *pArgString = NULL; /* where to start from next */ - char *pOptString; /* the string in our program */ - - - if (pIndexPosition != NULL) { - /* we last left off inside an argv string */ - if (*(++pIndexPosition)) { - /* there is more to come in the most recent argv */ - pArgString = pIndexPosition; - } - } - - if (pArgString == NULL) { - /* we didn't leave off in the middle of an argv string */ - if (optind >= argc) { - /* more command-line arguments than the argument count */ - pIndexPosition = NULL; /* not in the middle of anything */ - return EOF; /* used up all command-line arguments */ - } - - /*--------------------------------------------------------------------- - * If the next argv[] is not an option, there can be no more options. - *-------------------------------------------------------------------*/ - pArgString = argv[optind++]; /* set this to the next argument ptr */ - - if (('/' != *pArgString) && /* doesn't start with a slash or a dash? */ - ('-' != *pArgString)) { - --optind; /* point to current arg once we're done */ - optarg = NULL; /* no argument follows the option */ - pIndexPosition = NULL; /* not in the middle of anything */ - return EOF; /* used up all the command-line flags */ - } - - /* check for special end-of-flags markers */ - if ((strcmp(pArgString, "-") == 0) || - (strcmp(pArgString, "--") == 0)) { - optarg = NULL; /* no argument follows the option */ - pIndexPosition = NULL; /* not in the middle of anything */ - return EOF; /* encountered the special flag */ - } - - pArgString++; /* look past the / or - */ - } - - if (':' == *pArgString) { /* is it a colon? */ - /*--------------------------------------------------------------------- - * Rare case: if opterr is non-zero, return a question mark; - * otherwise, just return the colon we're on. - *-------------------------------------------------------------------*/ - return (opterr ? (int)'?' : (int)':'); - } - else if ((pOptString = strchr(opstring, *pArgString)) == 0) { - /*--------------------------------------------------------------------- - * The letter on the command-line wasn't any good. - *-------------------------------------------------------------------*/ - optarg = NULL; /* no argument follows the option */ - pIndexPosition = NULL; /* not in the middle of anything */ - return (opterr ? (int)'?' : (int)*pArgString); - } - else { - /*--------------------------------------------------------------------- - * The letter on the command-line matches one we expect to see - *-------------------------------------------------------------------*/ - if (':' == _next_char(pOptString)) { /* is the next letter a colon? */ - /* It is a colon. Look for an argument string. */ - if ('\0' != _next_char(pArgString)) { /* argument in this argv? */ - optarg = &pArgString[1]; /* Yes, it is */ - } - else { - /*------------------------------------------------------------- - * The argument string must be in the next argv. - * But, what if there is none (bad input from the user)? - * In that case, return the letter, and optarg as NULL. - *-----------------------------------------------------------*/ - if (optind < argc) - optarg = argv[optind++]; - else { - optarg = NULL; - return (opterr ? (int)'?' : (int)*pArgString); - } - } - pIndexPosition = NULL; /* not in the middle of anything */ - } - else { - /* it's not a colon, so just return the letter */ - optarg = NULL; /* no argument follows the option */ - pIndexPosition = pArgString; /* point to the letter we're on */ - } - return (int)*pArgString; /* return the letter that matched */ - } -} - -#ifdef __cplusplus -} -#endif diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/getopt.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/getopt.h deleted file mode 100644 index f7446f1c50..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/getopt.h +++ /dev/null @@ -1,49 +0,0 @@ -/***************************************************************************** - * - * MODULE NAME : GETOPT.H - * - * COPYRIGHTS: - * This module contains code made available by IBM - * Corporation on an AS IS basis. Any one receiving the - * module is considered to be licensed under IBM copyrights - * to use the IBM-provided source code in any way he or she - * deems fit, including copying it, compiling it, modifying - * it, and redistributing it, with or without - * modifications. No license under any IBM patents or - * patent applications is to be implied from this copyright - * license. - * - * A user of the module should understand that IBM cannot - * provide technical support for the module and will not be - * responsible for any consequences of use of the program. - * - * Any notices, including this one, are not to be removed - * from the module without the prior written consent of - * IBM. - * - * AUTHOR: Original author: - * G. R. Blair (BOBBLAIR at AUSVM1) - * Internet: bobblair@bobblair.austin.ibm.com - * - * Extensively revised by: - * John Q. Walker II, Ph.D. (JOHHQ at RALVM6) - * Internet: johnq@ralvm6.vnet.ibm.com - * - *****************************************************************************/ -#ifndef WIN32_GETOPT_H -#define WIN32_GETOPT_H - -#ifdef __cplusplus -extern "C" { -#endif - -extern char * optarg; -extern int optind; - -int getopt ( int argc, char **argv, char *optstring); - -#ifdef __cplusplus -} -#endif - -#endif // WIN32_GETOPT_H diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsm_config.h b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsm_config.h deleted file mode 100755 index 258d4fed52..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsm_config.h +++ /dev/null @@ -1,171 +0,0 @@ -/* gsm_config.h.in. Generated automatically from configure.in by autoheader. */ - -/* Define if using alloca.c. */ -#undef C_ALLOCA - -/* Define to empty if the keyword does not work. */ -#undef const - -/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. - This function is required for alloca.c support on those systems. */ -#undef CRAY_STACKSEG_END - -/* Define if you have alloca, as a function or macro. */ -#define HAVE_ALLOCA 1 -#define alloca _alloca // Microsoft - -/* Define if you have and it should be used (not on Ultrix). */ -#undef HAVE_ALLOCA_H - -/* Define if you have a working `mmap' system call. */ -#undef HAVE_MMAP - -/* Define as __inline if that's what the C compiler calls it. */ -#undef inline - -/* Define to `long' if doesn't define. */ -#undef off_t - -/* Define if you need to in order for stat and other things to work. */ -#undef _POSIX_SOURCE - -/* Define to `unsigned' if doesn't define. */ -#undef size_t - -/* 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 - */ -#undef STACK_DIRECTION - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* used by libtool*/ -#define PACKAGE 0 - -/* used by libtool*/ -#define VERSION 0 - -/* Define if getopt_long() available */ -#undef HAVE_GETOPT_LONG - -/* Define if alarm() available */ -#undef HAVE_ALARM - -/* Define for NLS */ -#undef ENABLE_NLS -#undef HAVE_CATGETS -#undef HAVE_GETTEXT -#undef HAVE_LC_MESSAGES -#undef HAVE_STPCPY - -/* Define LOCALEDIR */ -#define LOCALEDIR "/usr/share/locale" - -/* 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 - -/* The number of bytes in a unsigned long int. */ -#define SIZEOF_UNSIGNED_LONG_INT 4 - -/* The number of bytes in a unsigned short int. */ -#define SIZEOF_UNSIGNED_SHORT_INT 2 - -/* Define if you have the __argz_count function. */ -#undef HAVE___ARGZ_COUNT - -/* Define if you have the __argz_next function. */ -#undef HAVE___ARGZ_NEXT - -/* Define if you have the __argz_stringify function. */ -#undef HAVE___ARGZ_STRINGIFY - -/* Define if you have the dcgettext function. */ -#undef HAVE_DCGETTEXT - -/* Define if you have the getcwd function. */ -#undef HAVE_GETCWD - -/* Define if you have the getpagesize function. */ -#undef HAVE_GETPAGESIZE - -/* Define if you have the munmap function. */ -#undef HAVE_MUNMAP - -/* Define if you have the putenv function. */ -#undef HAVE_PUTENV - -/* Define if you have the setenv function. */ -#undef HAVE_SETENV - -/* Define if you have the setlocale function. */ -#define HAVE_SETLOCALE 1 - -/* Define if you have the stpcpy function. */ -#undef HAVE_STPCPY - -/* Define if you have the strcasecmp function. */ -#undef HAVE_STRCASECMP -#define strcasecmp _strcmpi - -/* Define if you have the strchr function. */ -#define HAVE_STRCHR 1 - -/* Define if you have the strdup function. */ -#define HAVE_STRDUP 1 - -/* Define if you have the header file. */ -#undef HAVE_ARGZ_H - -/* Define if you have the header file. */ -#undef HAVE_LIBINTL_H - -/* Define if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define if you have the header file. */ -#define HAVE_LOCALE_H 1 - -/* Define if you have the header file. */ -#define HAVE_MALLOC_H 1 - -/* Define if you have the header file. */ -#undef HAVE_NETINET_IN_H - -/* Define if you have the header file. */ -#undef HAVE_NL_TYPES_H - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define if you have the i library (-li). */ -#undef HAVE_LIBI - -/* Define if you have the intl library (-lintl). */ -#undef HAVE_LIBINTL - -// WIN32 specific defines -#pragma warning( disable : 4786 ) // Disable warning messages - // 4786 (id too long) - -// Win32 strftime() does not return length of output when passing -// NULL pointer -#define BROKEN_STRFTIME -// Win32 STL erase() for maps makes iterators invalid -#define BUGGY_MAP_ERASE 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 deleted file mode 100644 index b48a1c54db..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmctl.dsp +++ /dev/null @@ -1,118 +0,0 @@ -# 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.2017.vcxproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.2017.vcxproj deleted file mode 100644 index 83fa970270..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.2017.vcxproj +++ /dev/null @@ -1,250 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - gsmlib - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} - - - - StaticLibrary - false - MultiByte - $(DefaultPlatformToolset) - - - StaticLibrary - false - MultiByte - $(DefaultPlatformToolset) - - - StaticLibrary - false - MultiByte - $(DefaultPlatformToolset) - - - StaticLibrary - false - MultiByte - $(DefaultPlatformToolset) - - - - - - - - - - - - - - - - - - - - - - - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - - - - MaxSpeed - OnlyExplicitInline - ../vcproject;..;.;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - true - .\Release/gsmlib.pch - .\Release/ - .\Release/ - .\Release/ - true - Level3 - true - /wd4290 /wd4996 %(AdditionalOptions) - 4838;4267;4101;4244;4554;%(DisableSpecificWarnings) - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - /ignore:4221 %(AdditionalOptions) - - - true - - - - - Disabled - ..;.;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - true - Level3 - true - ProgramDatabase - /wd4290 /wd4996 %(AdditionalOptions) - 4838;4267;4101;4244;4554;%(DisableSpecificWarnings) - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - false - %(IgnoreSpecificDefaultLibraries) - /ignore:4221 %(AdditionalOptions) - - - true - - - - - X64 - - - MaxSpeed - OnlyExplicitInline - ../vcproject;..;.;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - true - true - Level3 - true - /wd4290 /wd4996 %(AdditionalOptions) - 4838;4267;4101;4244;4554;%(DisableSpecificWarnings) - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - - - true - - - - - X64 - - - Disabled - ..;.;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - true - Level3 - true - ProgramDatabase - /wd4290 /wd4996 %(AdditionalOptions) - 4838;4267;4101;4244;4554;%(DisableSpecificWarnings) - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - false - %(IgnoreSpecificDefaultLibraries) - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file 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 deleted file mode 100644 index ace489a252..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.dsp +++ /dev/null @@ -1,232 +0,0 @@ -# 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 deleted file mode 100644 index 21ab8168ac..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.dsw +++ /dev/null @@ -1,149 +0,0 @@ -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/gsmlib.sln b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.sln deleted file mode 100755 index 928215c23d..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/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", "{A822BA57-6F96-4C69-9E28-C0FB2667B1B0}" - ProjectSection(ProjectDependencies) = postProject - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmlib", "gsmlib.vcproj", "{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmpb", "gsmpb.vcproj", "{311D5A85-4DC1-4714-9B61-AE3C57B67B5B}" - ProjectSection(ProjectDependencies) = postProject - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmsendsms", "gsmsendsms.vcproj", "{CF99664C-05D1-41A3-9B12-B79D55718377}" - ProjectSection(ProjectDependencies) = postProject - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmsmsd", "gsmsmsd.vcproj", "{3C5D7948-5E49-4C78-9AAB-3AC53A15BEF4}" - ProjectSection(ProjectDependencies) = postProject - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmsmsstore", "gsmsmsstore.vcproj", "{5A834BCC-8B96-4D1C-9811-ADC816797E3A}" - ProjectSection(ProjectDependencies) = postProject - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgsmlib", "testgsmlib.vcproj", "{248E3E22-2203-4352-964E-32946A1A0AEC}" - ProjectSection(ProjectDependencies) = postProject - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsms", "testsms.vcproj", "{BEE3EFDE-4C00-4CE5-9DFC-61DF6F0E5481}" - ProjectSection(ProjectDependencies) = postProject - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsms2", "testsms2.vcproj", "{3E08AF8F-6DD3-40EC-AA97-C8D4237CA127}" - ProjectSection(ProjectDependencies) = postProject - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A822BA57-6F96-4C69-9E28-C0FB2667B1B0}.Debug|Win32.ActiveCfg = Debug|Win32 - {A822BA57-6F96-4C69-9E28-C0FB2667B1B0}.Debug|Win32.Build.0 = Debug|Win32 - {A822BA57-6F96-4C69-9E28-C0FB2667B1B0}.Release|Win32.ActiveCfg = Release|Win32 - {A822BA57-6F96-4C69-9E28-C0FB2667B1B0}.Release|Win32.Build.0 = Release|Win32 - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|Win32.ActiveCfg = Debug|Win32 - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|Win32.Build.0 = Debug|Win32 - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|Win32.ActiveCfg = Release|Win32 - {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|Win32.Build.0 = Release|Win32 - {311D5A85-4DC1-4714-9B61-AE3C57B67B5B}.Debug|Win32.ActiveCfg = Debug|Win32 - {311D5A85-4DC1-4714-9B61-AE3C57B67B5B}.Debug|Win32.Build.0 = Debug|Win32 - {311D5A85-4DC1-4714-9B61-AE3C57B67B5B}.Release|Win32.ActiveCfg = Release|Win32 - {311D5A85-4DC1-4714-9B61-AE3C57B67B5B}.Release|Win32.Build.0 = Release|Win32 - {CF99664C-05D1-41A3-9B12-B79D55718377}.Debug|Win32.ActiveCfg = Debug|Win32 - {CF99664C-05D1-41A3-9B12-B79D55718377}.Debug|Win32.Build.0 = Debug|Win32 - {CF99664C-05D1-41A3-9B12-B79D55718377}.Release|Win32.ActiveCfg = Release|Win32 - {CF99664C-05D1-41A3-9B12-B79D55718377}.Release|Win32.Build.0 = Release|Win32 - {3C5D7948-5E49-4C78-9AAB-3AC53A15BEF4}.Debug|Win32.ActiveCfg = Debug|Win32 - {3C5D7948-5E49-4C78-9AAB-3AC53A15BEF4}.Debug|Win32.Build.0 = Debug|Win32 - {3C5D7948-5E49-4C78-9AAB-3AC53A15BEF4}.Release|Win32.ActiveCfg = Release|Win32 - {3C5D7948-5E49-4C78-9AAB-3AC53A15BEF4}.Release|Win32.Build.0 = Release|Win32 - {5A834BCC-8B96-4D1C-9811-ADC816797E3A}.Debug|Win32.ActiveCfg = Debug|Win32 - {5A834BCC-8B96-4D1C-9811-ADC816797E3A}.Debug|Win32.Build.0 = Debug|Win32 - {5A834BCC-8B96-4D1C-9811-ADC816797E3A}.Release|Win32.ActiveCfg = Release|Win32 - {5A834BCC-8B96-4D1C-9811-ADC816797E3A}.Release|Win32.Build.0 = Release|Win32 - {248E3E22-2203-4352-964E-32946A1A0AEC}.Debug|Win32.ActiveCfg = Debug|Win32 - {248E3E22-2203-4352-964E-32946A1A0AEC}.Debug|Win32.Build.0 = Debug|Win32 - {248E3E22-2203-4352-964E-32946A1A0AEC}.Release|Win32.ActiveCfg = Release|Win32 - {248E3E22-2203-4352-964E-32946A1A0AEC}.Release|Win32.Build.0 = Release|Win32 - {BEE3EFDE-4C00-4CE5-9DFC-61DF6F0E5481}.Debug|Win32.ActiveCfg = Debug|Win32 - {BEE3EFDE-4C00-4CE5-9DFC-61DF6F0E5481}.Debug|Win32.Build.0 = Debug|Win32 - {BEE3EFDE-4C00-4CE5-9DFC-61DF6F0E5481}.Release|Win32.ActiveCfg = Release|Win32 - {BEE3EFDE-4C00-4CE5-9DFC-61DF6F0E5481}.Release|Win32.Build.0 = Release|Win32 - {3E08AF8F-6DD3-40EC-AA97-C8D4237CA127}.Debug|Win32.ActiveCfg = Debug|Win32 - {3E08AF8F-6DD3-40EC-AA97-C8D4237CA127}.Debug|Win32.Build.0 = Debug|Win32 - {3E08AF8F-6DD3-40EC-AA97-C8D4237CA127}.Release|Win32.ActiveCfg = Release|Win32 - {3E08AF8F-6DD3-40EC-AA97-C8D4237CA127}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmpb.dsp b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmpb.dsp deleted file mode 100644 index befc0f6d51..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmpb.dsp +++ /dev/null @@ -1,118 +0,0 @@ -# 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 deleted file mode 100644 index 7e660fbdbb..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsendsms.dsp +++ /dev/null @@ -1,118 +0,0 @@ -# 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 deleted file mode 100644 index 2facfaa47c..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsmsd.dsp +++ /dev/null @@ -1,118 +0,0 @@ -# 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 deleted file mode 100644 index 5e7a9c150a..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmsmsstore.dsp +++ /dev/null @@ -1,119 +0,0 @@ -# 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 deleted file mode 100644 index 26de21002d..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testgsmlib.dsp +++ /dev/null @@ -1,101 +0,0 @@ -# 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 deleted file mode 100644 index 09bf409bd2..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testsms.dsp +++ /dev/null @@ -1,100 +0,0 @@ -# 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 deleted file mode 100644 index 0ab2880c41..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/testsms2.dsp +++ /dev/null @@ -1,100 +0,0 @@ -# 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/gsmopen.h b/src/mod/endpoints/mod_gsmopen/gsmopen.h deleted file mode 100644 index 75f62148e3..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmopen.h +++ /dev/null @@ -1,584 +0,0 @@ -/* - * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II - * - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * - * The Initial Developer of the Original Code is - * Anthony Minessale II - * Portions created by the Initial Developer are Copyright (C) - * the Initial Developer. All Rights Reserved. - * - * This module (mod_gsmopen) has been contributed by: - * - * Giovanni Maruzzelli - * - * Maintainer: Giovanni Maruzzelli - * - * mod_gsmopen.cpp -- GSM Modem compatible Endpoint Module - * - */ - - -#define __STDC_LIMIT_MACROS - -#ifdef WIN32 -#define HAVE_VSNPRINTF -#pragma warning(disable: 4290) -#endif //WIN32 - -#define MY_EVENT_INCOMING_SMS "gsmopen::incoming_sms" -#define MY_EVENT_DUMP "gsmopen::dump_event" -#define MY_EVENT_ALARM "gsmopen::alarm" - -#define ALARM_FAILED_INTERFACE 0 -#define ALARM_NO_NETWORK_REGISTRATION 1 -#define ALARM_ROAMING_NETWORK_REGISTRATION 2 -#define ALARM_NETWORK_NO_SERVICE 3 -#define ALARM_NETWORK_NO_SIGNAL 4 -#define ALARM_NETWORK_LOW_SIGNAL 5 - -#undef GIOVA48 - -#ifndef GIOVA48 -#define SAMPLES_PER_FRAME 160 -#else // GIOVA48 -#define SAMPLES_PER_FRAME 960 -#endif // GIOVA48 - -#ifndef GIOVA48 -#define GSMOPEN_FRAME_SIZE 160 -#else //GIOVA48 -#define GSMOPEN_FRAME_SIZE 960 -#endif //GIOVA48 -#define SAMPLERATE_GSMOPEN 8000 - -#include -#ifndef WIN32 -#include -#include -#include -#include -#endif //WIN32 - -#ifndef WIN32 -#include -#endif //WIN32 - -#define SPANDSP_EXPOSE_INTERNAL_STRUCTURES -#include -#include - -#ifdef _MSC_VER -//Windows macro for FD_SET includes a warning C4127: conditional expression is constant -#pragma warning(push) -#pragma warning(disable:4127) -#endif - -#define PROTOCOL_ALSA_VOICEMODEM 4 -#define PROTOCOL_AT 2 -#define PROTOCOL_FBUS2 1 -#define PROTOCOL_NO_SERIAL 3 - -#define AT_MESG_MAX_LENGTH 2048 /* much more than 10 SMSs */ -#define AT_BUFSIZ AT_MESG_MAX_LENGTH -#define AT_MESG_MAX_LINES 20 /* 256 lines, so it can contains the results of AT+CLAC, that gives all the AT commands the phone supports */ - -#ifndef GSMOPEN_SVN_VERSION -#define GSMOPEN_SVN_VERSION switch_version_full() -#endif /* GSMOPEN_SVN_VERSION */ - -#include "ctb-0.16/ctb.h" - -typedef enum { - TFLAG_IO = (1 << 0), - TFLAG_INBOUND = (1 << 1), - TFLAG_OUTBOUND = (1 << 2), - TFLAG_DTMF = (1 << 3), - TFLAG_VOICE = (1 << 4), - TFLAG_HANGUP = (1 << 5), - TFLAG_LINEAR = (1 << 6), - TFLAG_CODEC = (1 << 7), - TFLAG_BREAK = (1 << 8) -} TFLAGS; - -typedef enum { - GFLAG_MY_CODEC_PREFS = (1 << 0) -} GFLAGS; - -#define DEBUGA_GSMOPEN(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev %s [%p|%-7lx][DEBUG_GSMOPEN %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define DEBUGA_CALL(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev %s [%p|%-7lx][DEBUG_CALL %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define DEBUGA_PBX(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev %s [%p|%-7lx][DEBUG_PBX %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define ERRORA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "rev %s [%p|%-7lx][ERRORA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define WARNINGA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "rev %s [%p|%-7lx][WARNINGA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define NOTICA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "rev %s [%p|%-7lx][NOTICA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); - -#define GSMOPEN_P_LOG GSMOPEN_SVN_VERSION, (void *)NULL, (unsigned long)55, __LINE__, tech_pvt ? tech_pvt->name ? tech_pvt->name : "none" : "none", -1, tech_pvt ? tech_pvt->interface_state : -1, tech_pvt ? tech_pvt->phone_callflow : -1 - -/*********************************/ -#define GSMOPEN_CAUSE_NORMAL 1 -#define GSMOPEN_CAUSE_FAILURE 2 -#define GSMOPEN_CAUSE_NO_ANSWER 3 -/*********************************/ -#define GSMOPEN_FRAME_DTMF 1 -/*********************************/ -#define GSMOPEN_CONTROL_RINGING 1 -#define GSMOPEN_CONTROL_ANSWER 2 -#define GSMOPEN_CONTROL_HANGUP 3 -#define GSMOPEN_CONTROL_BUSY 4 - -/*********************************/ -#define GSMOPEN_STATE_IDLE 0 -#define GSMOPEN_STATE_DOWN 1 -#define GSMOPEN_STATE_RING 2 -#define GSMOPEN_STATE_DIALING 3 -#define GSMOPEN_STATE_BUSY 4 -#define GSMOPEN_STATE_UP 5 -#define GSMOPEN_STATE_RINGING 6 -#define GSMOPEN_STATE_PRERING 7 -#define GSMOPEN_STATE_ERROR_DOUBLE_CALL 8 -#define GSMOPEN_STATE_SELECTED 9 -#define GSMOPEN_STATE_HANGUP_REQUESTED 10 -#define GSMOPEN_STATE_PREANSWER 11 -/*********************************/ -/* call flow from the device */ -#define CALLFLOW_CALL_IDLE 0 -#define CALLFLOW_CALL_DOWN 1 -#define CALLFLOW_INCOMING_RING 2 -#define CALLFLOW_CALL_DIALING 3 -#define CALLFLOW_CALL_LINEBUSY 4 -#define CALLFLOW_CALL_ACTIVE 5 -#define CALLFLOW_INCOMING_HANGUP 6 -#define CALLFLOW_CALL_RELEASED 7 -#define CALLFLOW_CALL_NOCARRIER 8 -#define CALLFLOW_CALL_INFLUX 9 -#define CALLFLOW_CALL_INCOMING 10 -#define CALLFLOW_CALL_FAILED 11 -#define CALLFLOW_CALL_NOSERVICE 12 -#define CALLFLOW_CALL_OUTGOINGRESTRICTED 13 -#define CALLFLOW_CALL_SECURITYFAIL 14 -#define CALLFLOW_CALL_NOANSWER 15 -#define CALLFLOW_STATUS_FINISHED 16 -#define CALLFLOW_STATUS_CANCELLED 17 -#define CALLFLOW_STATUS_FAILED 18 -#define CALLFLOW_STATUS_REFUSED 19 -#define CALLFLOW_STATUS_RINGING 20 -#define CALLFLOW_STATUS_INPROGRESS 21 -#define CALLFLOW_STATUS_UNPLACED 22 -#define CALLFLOW_STATUS_ROUTING 23 -#define CALLFLOW_STATUS_EARLYMEDIA 24 -#define CALLFLOW_INCOMING_CALLID 25 -#define CALLFLOW_STATUS_REMOTEHOLD 26 -#define CALLFLOW_CALL_REMOTEANSWER 27 -#define CALLFLOW_CALL_HANGUP_REQUESTED 28 - -/*********************************/ - -#define AT_OK 0 -#define AT_ERROR 1 - -#define GSMOPEN_MAX_INTERFACES 64 - -#define USSD_ENCODING_AUTO 0 -#define USSD_ENCODING_PLAIN 1 -#define USSD_ENCODING_HEX_7BIT 2 -#define USSD_ENCODING_HEX_8BIT 3 -#define USSD_ENCODING_UCS2 4 - -#ifndef WIN32 -struct GSMopenHandles { - int currentuserhandle; - int api_connected; - int fdesc[2]; -}; -#else //WIN32 - -struct GSMopenHandles { - HWND win32_hInit_MainWindowHandle; - HWND win32_hGlobal_GSMAPIWindowHandle; - HINSTANCE win32_hInit_ProcessHandle; - char win32_acInit_WindowClassName[128]; - UINT win32_uiGlobal_MsgID_GSMControlAPIAttach; - UINT win32_uiGlobal_MsgID_GSMControlAPIDiscover; - int currentuserhandle; - int api_connected; - switch_file_t *fdesc[2]; -}; - -#endif //WIN32 - -/*! - * \brief structure for storing the results of AT commands, in an array of AT_MESG_MAX_LINES * AT_MESG_MAX_LENGTH chars - */ -struct s_result { - int elemcount; - char result[AT_MESG_MAX_LINES][AT_MESG_MAX_LENGTH]; -}; - -struct ciapa_struct { - int state; - int hangupcause; -}; -typedef struct ciapa_struct ciapa_t; - -struct private_object { - unsigned int flags; - switch_codec_t read_codec; - switch_codec_t write_codec; - switch_frame_t read_frame; - unsigned char databuf[SWITCH_RECOMMENDED_BUFFER_SIZE]; - char session_uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; - switch_caller_profile_t *caller_profile; - switch_mutex_t *mutex; - switch_mutex_t *flag_mutex; - - char id[80]; - char name[80]; - char dialplan[80]; - char context[80]; - char dial_regex[256]; - char fail_dial_regex[256]; - char hold_music[256]; - char type[256]; - char X11_display[256]; -#ifdef WIN32 - unsigned short tcp_cli_port; - unsigned short tcp_srv_port; -#else - int tcp_cli_port; - int tcp_srv_port; -#endif - struct GSMopenHandles GSMopenHandles; - - int interface_state; /*!< \brief 'state' of the interface (channel) */ - char language[80]; /*!< \brief default Asterisk dialplan language for this interface */ - char exten[80]; /*!< \brief default Asterisk dialplan extension for this interface */ - int gsmopen_sound_rate; /*!< \brief rate of the sound device, in Hz, eg: 8000 */ - char callid_name[50]; - char callid_number[50]; - double playback_boost; - double capture_boost; - int stripmsd; - char gsmopen_call_id[512]; - int gsmopen_call_ongoing; - char gsmopen_friends[4096]; - char gsmopen_fullname[512]; - char gsmopen_displayname[512]; - int phone_callflow; /*!< \brief 'callflow' of the gsmopen interface (as opposed to phone interface) */ - int gsmopen; /*!< \brief config flag, bool, GSM support on this interface (0 if false, -1 if true) */ - int control_to_send; -#ifdef WIN32 - switch_file_t *audiopipe[2]; - switch_file_t *audiogsmopenpipe[2]; - switch_file_t *gsmopen_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */ -#else /* WIN32 */ - int audiopipe[2]; - int audiogsmopenpipe[2]; - int gsmopen_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */ -#endif /* WIN32 */ - switch_thread_t *tcp_srv_thread; - switch_thread_t *tcp_cli_thread; - switch_thread_t *gsmopen_signaling_thread; - switch_thread_t *gsmopen_api_thread; - int gsmopen_dir_entry_extension_prefix; - char gsmopen_user[256]; - char gsmopen_password[256]; - char destination[256]; - struct timeval answer_time; - - struct timeval transfer_time; - char transfer_callid_number[50]; - char gsmopen_transfer_call_id[512]; - int running; - unsigned long ib_calls; - unsigned long ob_calls; - unsigned long ib_failed_calls; - unsigned long ob_failed_calls; - - char controldevice_name[512]; /*!< \brief name of the serial device controlling the interface, possibly none */ - int controldevprotocol; /*!< \brief which protocol is used for serial control of this interface */ - char controldevprotocolname[50]; /*!< \brief name of the serial device controlling protocol, one of "at" "fbus2" "no_serial" "alsa_voicemodem" */ - int controldevfd; /*!< \brief serial controlling file descriptor for this interface */ -#ifdef WIN32 - int controldevice_speed; -#else - speed_t controldevice_speed; -#endif // WIN32 - int controldev_dead; - - char at_dial_pre_number[64]; - char at_dial_post_number[64]; - char at_dial_expect[64]; - unsigned int at_early_audio; - char at_hangup[64]; - char at_hangup_expect[64]; - char at_answer[64]; - char at_answer_expect[64]; - unsigned int at_initial_pause; - char at_preinit_1[64]; - char at_preinit_1_expect[64]; - char at_preinit_2[64]; - char at_preinit_2_expect[64]; - char at_preinit_3[64]; - char at_preinit_3_expect[64]; - char at_preinit_4[64]; - char at_preinit_4_expect[64]; - char at_preinit_5[64]; - char at_preinit_5_expect[64]; - unsigned int at_after_preinit_pause; - - char at_postinit_1[64]; - char at_postinit_1_expect[64]; - char at_postinit_2[64]; - char at_postinit_2_expect[64]; - char at_postinit_3[64]; - char at_postinit_3_expect[64]; - char at_postinit_4[64]; - char at_postinit_4_expect[64]; - char at_postinit_5[64]; - char at_postinit_5_expect[64]; - - char at_send_dtmf[64]; - - char at_query_battchg[64]; - char at_query_battchg_expect[64]; - char at_query_signal[64]; - char at_query_signal_expect[64]; - char at_call_idle[64]; - char at_call_incoming[64]; - char at_call_active[64]; - char at_call_failed[64]; - char at_call_calling[64]; - -#define CIEV_STRING_SIZE 64 - char at_indicator_noservice_string[64]; - char at_indicator_nosignal_string[64]; - char at_indicator_lowsignal_string[64]; - char at_indicator_lowbattchg_string[64]; - char at_indicator_nobattchg_string[64]; - char at_indicator_callactive_string[64]; - char at_indicator_nocallactive_string[64]; - char at_indicator_nocallsetup_string[64]; - char at_indicator_callsetupincoming_string[64]; - char at_indicator_callsetupoutgoing_string[64]; - char at_indicator_callsetupremoteringing_string[64]; - - int at_indicator_callp; - int at_indicator_callsetupp; - int at_indicator_roamp; - int at_indicator_battchgp; - int at_indicator_servicep; - int at_indicator_signalp; - - int at_has_clcc; - int at_has_ecam; - - char at_cmgw[16]; - int no_ucs2; - time_t gsmopen_serial_sync_period; - - time_t gsmopen_serial_synced_timestamp; - struct s_result line_array; - - int unread_sms_msg_id; - int reading_sms_msg; - char sms_message[4800]; - char sms_sender[256]; - char sms_date[256]; - char sms_userdataheader[256]; - char sms_body[4800]; - char sms_datacodingscheme[256]; - char sms_servicecentreaddress[256]; - int sms_messagetype; - int sms_cnmi_not_supported; - int sms_pdu_not_supported; - - int ussd_request_encoding; - int ussd_response_encoding; - int ussd_request_hex; - int ussd_received; - int ussd_status; - char ussd_message[1024]; - char ussd_dcs[256]; - - struct timeval call_incoming_time; - switch_mutex_t *controldev_lock; - - int phonebook_listing; - int phonebook_querying; - int phonebook_listing_received_calls; - - int phonebook_first_entry; - int phonebook_last_entry; - int phonebook_number_lenght; - int phonebook_text_lenght; - FILE *phonebook_writing_fp; - - struct timeval ringtime; - ciapa_t *owner; - - time_t audio_play_reset_timestamp; - int audio_play_reset_period; - - switch_timer_t timer_read; - switch_timer_t timer_write; - teletone_dtmf_detect_state_t dtmf_detect; - switch_time_t old_dtmf_timestamp; - - int no_sound; - - dtmf_rx_state_t dtmf_state; - int active; - int home_network_registered; - int roaming_registered; - int not_registered; - int got_signal; - int signal_strength; - char imei[128]; - int requesting_imei; - char imsi[128]; - int requesting_imsi; - char operator_name[128]; - int requesting_operator_name; - char subscriber_number[128]; - int requesting_subscriber_number; - char device_mfg[128]; - int requesting_device_mfg; - char device_model[128]; - int requesting_device_model; - char device_firmware[128]; - int requesting_device_firmware; - int network_creg_not_supported; - char creg[128]; - - char controldevice_audio_name[512]; - int controldev_audio_fd; - int controldevice_audio_speed; - int controldev_audio_dead; - switch_mutex_t *controldev_audio_lock; - ctb::SerialPort * serialPort_serial_audio; - - ctb::SerialPort * serialPort_serial_control; - - char buffer2[320]; - int buffer2_full; - int serialPort_serial_audio_opened; - -}; - -typedef struct private_object private_t; - -void *SWITCH_THREAD_FUNC gsmopen_api_thread_func(switch_thread_t *thread, void *obj); -int gsmopen_audio_read(private_t *tech_pvt); -int gsmopen_audio_init(private_t *tech_pvt); -int gsmopen_signaling_read(private_t *tech_pvt); - -int gsmopen_call(private_t *tech_pvt, char *idest, int timeout); -int gsmopen_senddigit(private_t *tech_pvt, char digit); - -void *gsmopen_do_tcp_srv_thread_func(void *obj); -void *SWITCH_THREAD_FUNC gsmopen_do_tcp_srv_thread(switch_thread_t *thread, void *obj); - -void *gsmopen_do_tcp_cli_thread_func(void *obj); -void *SWITCH_THREAD_FUNC gsmopen_do_tcp_cli_thread(switch_thread_t *thread, void *obj); - -void *gsmopen_do_gsmopenapi_thread_func(void *obj); -void *SWITCH_THREAD_FUNC gsmopen_do_gsmopenapi_thread(switch_thread_t *thread, void *obj); -int dtmf_received(private_t *tech_pvt, char *value); -int start_audio_threads(private_t *tech_pvt); -int new_inbound_channel(private_t *tech_pvt); -int outbound_channel_answered(private_t *tech_pvt); -#if defined(WIN32) && !defined(__CYGWIN__) -int gsmopen_pipe_read(switch_file_t *pipe, short *buf, int howmany); -int gsmopen_pipe_write(switch_file_t *pipe, short *buf, int howmany); -/* Visual C do not have strsep ? */ -char *strsep(char **stringp, const char *delim); -#else -int gsmopen_pipe_read(int pipe, short *buf, int howmany); -int gsmopen_pipe_write(int pipe, short *buf, int howmany); -#endif /* WIN32 */ -int gsmopen_close_socket(unsigned int fd); -private_t *find_available_gsmopen_interface_rr(private_t *tech_pvt_calling); -int remote_party_is_ringing(private_t *tech_pvt); -int remote_party_is_early_media(private_t *tech_pvt); -int gsmopen_socket_create_and_bind(private_t *tech_pvt, int *which_port); - -void *gsmopen_do_controldev_thread(void *data); -int gsmopen_serial_init(private_t *tech_pvt, int controldevice_speed); -int gsmopen_serial_monitor(private_t *tech_pvt); -int gsmopen_serial_sync(private_t *tech_pvt); -int gsmopen_serial_sync_AT(private_t *tech_pvt); -int gsmopen_serial_config(private_t *tech_pvt); -int gsmopen_serial_config_AT(private_t *tech_pvt); - -#define gsmopen_serial_write_AT_expect(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 0) -#define gsmopen_serial_write_AT_expect_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 0) -#define gsmopen_serial_write_AT_expect_noexpcr_tout(P, D, S, T) gsmopen_serial_write_AT_expect1(P, D, S, 0, T) -#define gsmopen_serial_write_AT_expect_longtime(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 5) -#define gsmopen_serial_write_AT_expect_longtime_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 5) -int gsmopen_serial_write_AT(private_t *tech_pvt, const char *data); -int gsmopen_serial_write_AT_nocr(private_t *tech_pvt, const char *data); -int gsmopen_serial_write_AT_ack(private_t *tech_pvt, const char *data); -int gsmopen_serial_write_AT_ack_nocr_longtime(private_t *tech_pvt, const char *data); -int gsmopen_serial_write_AT_noack(private_t *tech_pvt, const char *data); -int gsmopen_serial_write_AT_expect1(private_t *tech_pvt, const char *data, const char *expected_string, int expect_crlf, int seconds); -int gsmopen_serial_AT_expect(private_t *tech_pvt, const char *expected_string, int expect_crlf, int seconds); -int gsmopen_serial_read_AT(private_t *tech_pvt, int look_for_ack, int timeout_usec, int timeout_sec, const char *expected_string, int expect_crlf); -int gsmopen_serial_read(private_t *tech_pvt); -#define RESULT_FAILURE 0 -#define RESULT_SUCCESS 1 -int utf8_to_ucs2(private_t *tech_pvt, char *utf8_in, size_t inbytesleft, char *ucs2_out, size_t outbytesleft); -int ucs2_to_utf8(private_t *tech_pvt, char *ucs2_in, char *utf8_out, size_t outbytesleft); -int utf8_to_iso_8859_1(private_t *tech_pvt, char *utf8_in, size_t inbytesleft, char *iso_8859_1_out, size_t outbytesleft); -#define PUSHA_UNLOCKA(x) if(option_debug > 100) ERRORA("PUSHA_UNLOCKA: %p\n", GSMOPEN_P_LOG, (void *)x); -#define POPPA_UNLOCKA(x) if(option_debug > 100) ERRORA("POPPA_UNLOCKA: %p\n", GSMOPEN_P_LOG, (void *)x); -#define LOKKA(x) switch_mutex_lock(x); -#define UNLOCKA(x) switch_mutex_unlock(x); - -#define gsmopen_queue_control(x, y) ERRORA("gsmopen_queue_control: %p, %d\n", GSMOPEN_P_LOG, (void *)x, y); - -#define ast_setstate(x, y) ERRORA("ast_setstate: %p, %d\n", GSMOPEN_P_LOG, (void *)x, y); - -int gsmopen_serial_read(private_t *tech_pvt); -int gsmopen_answer(private_t *tech_pvt); -int gsmopen_serial_answer(private_t *tech_pvt); -int gsmopen_serial_answer_AT(private_t *tech_pvt); -int gsmopen_serial_hangup(private_t *tech_pvt); -int gsmopen_serial_hangup_AT(private_t *tech_pvt); -int gsmopen_hangup(private_t *tech_pvt); -int gsmopen_serial_call(private_t *tech_pvt, char *dstr); -int gsmopen_serial_call_AT(private_t *tech_pvt, char *dstr); -int gsmopen_sendsms(private_t *tech_pvt, char *dest, char *text); - -void gsmopen_store_boost(char *s, double *boost); -int gsmopen_sound_boost(void *data, int samples_num, double boost); -int sms_incoming(private_t *tech_pvt); -int gsmopen_ring(private_t *tech_pvt); - -int iso_8859_1_to_utf8(private_t *tech_pvt, char *iso_8859_1_in, char *utf8_out, size_t outbytesleft); -int gsmopen_serial_getstatus_AT(private_t *tech_pvt); - -int dump_event(private_t *tech_pvt); -int alarm_event(private_t *tech_pvt, int alarm_code, const char *alarm_message); -int dump_event_full(private_t *tech_pvt, int is_alarm, int alarm_code, const char *alarm_message); - -int gsmopen_serial_init_audio_port(private_t *tech_pvt, int controldevice_audio_speed); -int serial_audio_init(private_t *tech_pvt); -int serial_audio_shutdown(private_t *tech_pvt); -#ifndef WIN32 -void find_ttyusb_devices(private_t *tech_pvt, const char *dirname); -#endif// WIN32 -int gsmopen_ussd(private_t *tech_pvt, char *ussd, int waittime); -int ussd_incoming(private_t *tech_pvt); diff --git a/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp b/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp deleted file mode 100644 index bfd465501a..0000000000 --- a/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp +++ /dev/null @@ -1,3306 +0,0 @@ -/* - * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II - * - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * - * The Initial Developer of the Original Code is - * Anthony Minessale II - * Portions created by the Initial Developer are Copyright (C) - * the Initial Developer. All Rights Reserved. - * - * This module (mod_gsmopen) has been contributed by: - * - * Giovanni Maruzzelli - * - * Maintainer: Giovanni Maruzzelli - * - * gsmopen_protocol.cpp -- Low Level Interface for mod_gamopen - * - */ - - - - -#include "gsmopen.h" -#ifdef WIN32 -#include "win_iconv.c" -#endif // WIN32 -#define WANT_GSMLIB - -#ifdef WANT_GSMLIB -#include - - -using namespace std; -using namespace gsmlib; -#endif // WANT_GSMLIB - - -extern int running; //FIXME -int gsmopen_dir_entry_extension = 1; //FIXME -int option_debug = 100; //FIXME - -#define gsmopen_sleep switch_sleep -#define gsmopen_strncpy switch_copy_string -extern switch_memory_pool_t *gsmopen_module_pool; -extern switch_endpoint_interface_t *gsmopen_endpoint_interface; - -#ifdef WIN32 -/***************/ -// from http://www.openasthra.com/c-tidbits/gettimeofday-function-for-windows/ - -#include - -#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) -#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 -#else /* */ -#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL -#endif /* */ -struct sk_timezone { - int tz_minuteswest; /* minutes W of Greenwich */ - int tz_dsttime; /* type of dst correction */ -}; -int gettimeofday(struct timeval *tv, struct sk_timezone *tz) -{ - FILETIME ft; - unsigned __int64 tmpres = 0; - static int tzflag; - if (NULL != tv) { - GetSystemTimeAsFileTime(&ft); - tmpres |= ft.dwHighDateTime; - tmpres <<= 32; - tmpres |= ft.dwLowDateTime; - - /*converting file time to unix epoch */ - tmpres /= 10; /*convert into microseconds */ - tmpres -= DELTA_EPOCH_IN_MICROSECS; - tv->tv_sec = (long) (tmpres / 1000000UL); - tv->tv_usec = (long) (tmpres % 1000000UL); - } - if (NULL != tz) { - if (!tzflag) { - _tzset(); - tzflag++; - } - tz->tz_minuteswest = _timezone / 60; - tz->tz_dsttime = _daylight; - } - return 0; -} - -/***************/ -#endif /* WIN32 */ - -int gsmopen_serial_init(private_t *tech_pvt, int controldevice_speed) -{ - if (!tech_pvt) - return -1; - - tech_pvt->serialPort_serial_control = new ctb::SerialPort(); - - /* windows: com ports above com9 need a special trick, which also works for com ports below com10 ... */ - char devname[512] = ""; - strcpy(devname, tech_pvt->controldevice_name); -#ifdef WIN32 - strcpy(devname,"\\\\.\\"); - strcat(devname, tech_pvt->controldevice_name); -#endif - - if (tech_pvt->serialPort_serial_control->Open(devname, 115200, "8N1", ctb::SerialPort::NoFlowControl) >= 0) { - DEBUGA_GSMOPEN("port %s, SUCCESS open\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); - } else { -#ifdef WIN32 - LPVOID msg; - FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &msg, - 0, - NULL); - ERRORA("port open failed for %s - %s", GSMOPEN_P_LOG, devname, (LPCTSTR) msg); - LocalFree(msg); -#else - ERRORA("port %s, NOT open\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); -#endif - return -1; - } - - return 0; -} - -int gsmopen_serial_read(private_t *tech_pvt) -{ - if (tech_pvt && tech_pvt->controldevprotocol == PROTOCOL_AT) - return gsmopen_serial_read_AT(tech_pvt, 0, 100000, 0, NULL, 1); // a 10th of a second timeout -#ifdef GSMOPEN_FBUS2 - if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2) - return gsmopen_serial_read_FBUS2(tech_pvt); -#endif /* GSMOPEN_FBUS2 */ -#ifdef GSMOPEN_CVM - if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return gsmopen_serial_read_CVM_BUSMAIL(tech_pvt); -#endif /* GSMOPEN_CVM */ - return -1; -} - -int gsmopen_serial_sync(private_t *tech_pvt) -{ - if (tech_pvt->controldevprotocol == PROTOCOL_AT) - return gsmopen_serial_sync_AT(tech_pvt); -#ifdef GSMOPEN_FBUS2 - if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2) - return gsmopen_serial_sync_FBUS2(tech_pvt); -#endif /* GSMOPEN_FBUS2 */ -#ifdef GSMOPEN_CVM - if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return gsmopen_serial_sync_CVM_BUSMAIL(tech_pvt); -#endif /* GSMOPEN_CVM */ - - return -1; -} - -int gsmopen_serial_config(private_t *tech_pvt) -{ - if (tech_pvt->controldevprotocol == PROTOCOL_AT) - return gsmopen_serial_config_AT(tech_pvt); -#ifdef GSMOPEN_FBUS2 - if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2) - return gsmopen_serial_config_FBUS2(tech_pvt); -#endif /* GSMOPEN_FBUS2 */ -#ifdef GSMOPEN_CVM - if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return gsmopen_serial_config_CVM_BUSMAIL(tech_pvt); -#endif /* GSMOPEN_CVM */ - - return -1; -} - -int gsmopen_serial_config_AT(private_t *tech_pvt) -{ - int res; - char at_command[5]; - int i; - - if (!tech_pvt) - return 0; - -/* initial_pause? */ - if (tech_pvt->at_initial_pause) { - DEBUGA_GSMOPEN("sleeping for %u usec\n", GSMOPEN_P_LOG, tech_pvt->at_initial_pause); - gsmopen_sleep(tech_pvt->at_initial_pause); - } - -/* go until first empty preinit string, or last preinit string */ - while (1) { - - char trash[4096]; - res = tech_pvt->serialPort_serial_control->Read(trash, 4096); - if (res) { - DEBUGA_GSMOPEN("READ %d on serialport init\n", GSMOPEN_P_LOG, res); - } - - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CFUN=1"); - if (res) { - DEBUGA_GSMOPEN("no response to AT+CFUN=1. Continuing\n", GSMOPEN_P_LOG); - } - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT^CURC=0"); - if (res) { - DEBUGA_GSMOPEN("no response to AT^CURC=0. Continuing\n", GSMOPEN_P_LOG); - } - - if (strlen(tech_pvt->at_preinit_1)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_1, tech_pvt->at_preinit_1_expect); - if (res) { - DEBUGA_GSMOPEN("%s didn't get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_preinit_1, tech_pvt->at_preinit_1_expect); - } - } else { - break; - } - - if (strlen(tech_pvt->at_preinit_2)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_2, tech_pvt->at_preinit_2_expect); - if (res) { - DEBUGA_GSMOPEN("%s didn't get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_preinit_2, tech_pvt->at_preinit_2_expect); - } - } else { - break; - } - - if (strlen(tech_pvt->at_preinit_3)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_3, tech_pvt->at_preinit_3_expect); - if (res) { - DEBUGA_GSMOPEN("%s didn't get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_preinit_3, tech_pvt->at_preinit_3_expect); - } - } else { - break; - } - - if (strlen(tech_pvt->at_preinit_4)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_4, tech_pvt->at_preinit_4_expect); - if (res) { - DEBUGA_GSMOPEN("%s didn't get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_preinit_4, tech_pvt->at_preinit_4_expect); - } - } else { - break; - } - - if (strlen(tech_pvt->at_preinit_5)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_5, tech_pvt->at_preinit_5_expect); - if (res) { - DEBUGA_GSMOPEN("%s didn't get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_preinit_5, tech_pvt->at_preinit_5_expect); - } - } else { - break; - } - - break; - } - -/* after_preinit_pause? */ - if (tech_pvt->at_after_preinit_pause) { - DEBUGA_GSMOPEN("sleeping for %u usec\n", GSMOPEN_P_LOG, tech_pvt->at_after_preinit_pause); - gsmopen_sleep(tech_pvt->at_after_preinit_pause); - } - - /* phone, brother, art you alive? */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT"); - if (res) { - ERRORA("no response to AT\n", GSMOPEN_P_LOG); - return -1; - } - - /* for motorola, bring it back to "normal" mode if it happens to be in another mode */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+mode=0"); - if (res) { - DEBUGA_GSMOPEN("AT+mode=0 didn't get OK from the phone. If it is NOT Motorola," " no problem.\n", GSMOPEN_P_LOG); - } - gsmopen_sleep(50000); - /* for motorola end */ - - /* reset AT configuration to phone default */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "ATZ"); - if (res) { - DEBUGA_GSMOPEN("ATZ failed\n", GSMOPEN_P_LOG); - } - - /* disable AT command echo */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "ATE0"); - if (res) { - DEBUGA_GSMOPEN("ATE0 failed\n", GSMOPEN_P_LOG); - } - - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CFUN=1"); - if (res) { - DEBUGA_GSMOPEN("no response to AT+CFUN=1. Continuing\n", GSMOPEN_P_LOG); - } - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT^CURC=0"); - if (res) { - DEBUGA_GSMOPEN("no response to AT^CURC=0. Continuing\n", GSMOPEN_P_LOG); - } - - - /* disable extended error reporting */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMEE=0"); - if (res) { - DEBUGA_GSMOPEN("AT+CMEE failed\n", GSMOPEN_P_LOG); - } - - /* various phone manufacturer identifier */ - for (i = 0; i < 10; i++) { - memset(at_command, 0, sizeof(at_command)); - sprintf(at_command, "ATI%d", i); - res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); - if (res) { - DEBUGA_GSMOPEN("ATI%d command failed, continue\n", GSMOPEN_P_LOG, i); - } - } - - /* phone manufacturer */ - tech_pvt->requesting_device_mfg = 1; - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CGMI"); - tech_pvt->requesting_device_mfg = 0; - if (res) { - DEBUGA_GSMOPEN("AT+CGMI failed\n", GSMOPEN_P_LOG); - } - - /* phone model */ - tech_pvt->requesting_device_model = 1; - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CGMM"); - tech_pvt->requesting_device_model = 0; - if (res) { - DEBUGA_GSMOPEN("AT+CGMM failed\n", GSMOPEN_P_LOG); - } - - /* phone firmware */ - tech_pvt->requesting_device_firmware = 1; - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CGMR"); - tech_pvt->requesting_device_firmware = 0; - if (res) { - DEBUGA_GSMOPEN("AT+CGMR failed\n", GSMOPEN_P_LOG); - } - - /* signal network registration with a +CREG unsolicited msg */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CREG=1"); - if (res) { - DEBUGA_GSMOPEN("AT+CREG=1 failed\n", GSMOPEN_P_LOG); - tech_pvt->network_creg_not_supported = 1; - } - if (!tech_pvt->network_creg_not_supported) { - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CREG?"); - if (res) { - DEBUGA_GSMOPEN("AT+CREG? failed\n", GSMOPEN_P_LOG); - } - } - /* query signal strength */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSQ"); - if (res) { - DEBUGA_GSMOPEN("AT+CSQ failed\n", GSMOPEN_P_LOG); - } - - /* operator name */ - tech_pvt->requesting_operator_name = 1; - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+COPS?"); - tech_pvt->requesting_operator_name = 0; - if (res) { - DEBUGA_GSMOPEN("AT+COPS? failed\n", GSMOPEN_P_LOG); - } - - /* subscriber number */ - tech_pvt->requesting_subscriber_number = 1; - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CNUM"); - tech_pvt->requesting_subscriber_number = 0; - if (res) { - DEBUGA_GSMOPEN("AT+CNUM failed, continue\n", GSMOPEN_P_LOG); - } - - /* IMEI */ - tech_pvt->requesting_imei = 1; - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+GSN"); - tech_pvt->requesting_imei = 0; - if (res) { - DEBUGA_GSMOPEN("AT+GSN failed\n", GSMOPEN_P_LOG); - tech_pvt->requesting_imei = 1; - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CGSN"); - tech_pvt->requesting_imei = 0; - if (res) { - DEBUGA_GSMOPEN("AT+CGSN failed\n", GSMOPEN_P_LOG); - } - } - /* IMSI */ - tech_pvt->requesting_imsi = 1; - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CIMI"); - tech_pvt->requesting_imsi = 0; - if (res) { - DEBUGA_GSMOPEN("AT+CIMI failed\n", GSMOPEN_P_LOG); - } - - /* signal incoming SMS with a +CMTI unsolicited msg */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CNMI=2,1,0,0,0"); - if (res) { - DEBUGA_GSMOPEN("AT+CNMI=2,1,0,0,0 failed, continue\n", GSMOPEN_P_LOG); - tech_pvt->sms_cnmi_not_supported = 1; - tech_pvt->gsmopen_serial_sync_period = 30; //FIXME in config - } - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CPMS=\"ME\",\"ME\",\"ME\""); - if (res) { - DEBUGA_GSMOPEN("no response to AT+CPMS=\"ME\",\"ME\",\"ME\". Continuing\n", GSMOPEN_P_LOG); - } - /* signal incoming SMS with a +CMTI unsolicited msg */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CNMI=2,1,0,0,0"); - if (res) { - DEBUGA_GSMOPEN("AT+CNMI=2,1,0,0,0 failed, continue\n", GSMOPEN_P_LOG); - tech_pvt->sms_cnmi_not_supported = 1; - tech_pvt->gsmopen_serial_sync_period = 30; //FIXME in config - } - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CPMS=\"ME\",\"ME\",\"ME\""); - if (res) { - DEBUGA_GSMOPEN("no response to AT+CPMS=\"ME\",\"ME\",\"ME\". Continuing\n", GSMOPEN_P_LOG); - } - /* signal incoming SMS with a +CMTI unsolicited msg */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CNMI=2,1,0,0,0"); - if (res) { - DEBUGA_GSMOPEN("AT+CNMI=2,1,0,0,0 failed, continue\n", GSMOPEN_P_LOG); - tech_pvt->sms_cnmi_not_supported = 1; - tech_pvt->gsmopen_serial_sync_period = 30; //FIXME in config - } - - /* what is the Message Center address (number) to which the SMS has to be sent? */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCA?"); - if (res) { - DEBUGA_GSMOPEN("AT+CSCA? failed, continue\n", GSMOPEN_P_LOG); - } - /* what is the Message Format of SMSs? */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF?"); - if (res) { - DEBUGA_GSMOPEN("AT+CMGF? failed, continue\n", GSMOPEN_P_LOG); - } - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=1"); - if (res) { - ERRORA("Error setting SMS sending mode to TEXT on the cellphone, let's hope is TEXT by default. Continuing\n", GSMOPEN_P_LOG); - } - tech_pvt->sms_pdu_not_supported = 1; - - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,8"); //unicode, 16 bit message - if (res) { - WARNINGA("AT+CSMP didn't get OK from the phone, continuing\n", GSMOPEN_P_LOG); - } - - /* what is the Charset of SMSs? */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS?"); - if (res) { - DEBUGA_GSMOPEN("AT+CSCS? failed, continue\n", GSMOPEN_P_LOG); - } - - tech_pvt->no_ucs2 = 0; - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"UCS2\""); - if (res) { - WARNINGA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) didn't get OK from the phone, let's try with 'GSM'\n", GSMOPEN_P_LOG); - tech_pvt->no_ucs2 = 1; - } - if (tech_pvt->no_ucs2) { - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"GSM\""); - if (res) { - WARNINGA("AT+CSCS=\"GSM\" (set TE messages to GSM) didn't get OK from the phone\n", GSMOPEN_P_LOG); - } - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,0"); //normal, 7 bit message - if (res) { - WARNINGA("AT+CSMP didn't get OK from the phone, continuing\n", GSMOPEN_P_LOG); - } - } - - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=0"); - if (res) { - ERRORA("Error setting SMS sending mode to TEXT on the cellphone, let's hope is TEXT by default. Continuing\n", GSMOPEN_P_LOG); - } - tech_pvt->sms_pdu_not_supported = 0; - tech_pvt->no_ucs2 = 1; - - /* is the unsolicited reporting of mobile equipment event supported? */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMER=?"); - if (res) { - DEBUGA_GSMOPEN("AT+CMER=? failed, continue\n", GSMOPEN_P_LOG); - } - /* request unsolicited reporting of mobile equipment indicators' events, to be screened by categories reported by +CIND=? */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMER=3,0,0,1"); - if (res) { - DEBUGA_GSMOPEN("AT+CMER=? failed, continue\n", GSMOPEN_P_LOG); - } - - /* is the solicited reporting of mobile equipment indications supported? */ - - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CIND=?"); - if (res) { - DEBUGA_GSMOPEN("AT+CIND=? failed, continue\n", GSMOPEN_P_LOG); - } - - /* is the unsolicited reporting of call monitoring supported? sony-ericsson specific */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT*ECAM=?"); - if (res) { - DEBUGA_GSMOPEN("AT*ECAM=? failed, continue\n", GSMOPEN_P_LOG); - } - /* enable the unsolicited reporting of call monitoring. sony-ericsson specific */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT*ECAM=1"); - if (res) { - DEBUGA_GSMOPEN("AT*ECAM=1 failed, continue\n", GSMOPEN_P_LOG); - tech_pvt->at_has_ecam = 0; - } else { - tech_pvt->at_has_ecam = 1; - } - - /* disable unsolicited signaling of call list */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CLCC=0"); - if (res) { - DEBUGA_GSMOPEN("AT+CLCC=0 failed, continue\n", GSMOPEN_P_LOG); - tech_pvt->at_has_clcc = 0; - } else { - tech_pvt->at_has_clcc = 1; - } - - /* give unsolicited caller id when incoming call */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CLIP=1"); - if (res) { - DEBUGA_GSMOPEN("AT+CLIP failed, continue\n", GSMOPEN_P_LOG); - } - /* for motorola */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+MCST=1"); /* motorola call control codes - (to know when call is disconnected (they - don't give you "no carrier") */ - if (res) { - DEBUGA_GSMOPEN("AT+MCST=1 didn't get OK from the phone. If it is NOT Motorola," " no problem.\n", GSMOPEN_P_LOG); - } - /* for motorola end */ - -/* go until first empty postinit string, or last postinit string */ - while (1) { - - if (strlen(tech_pvt->at_postinit_1)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_1, tech_pvt->at_postinit_1_expect); - if (res) { - DEBUGA_GSMOPEN("%s didn't get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_postinit_1, tech_pvt->at_postinit_1_expect); - } - } else { - break; - } - - if (strlen(tech_pvt->at_postinit_2)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_2, tech_pvt->at_postinit_2_expect); - if (res) { - DEBUGA_GSMOPEN("%s didn't get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_postinit_2, tech_pvt->at_postinit_2_expect); - } - } else { - break; - } - - if (strlen(tech_pvt->at_postinit_3)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_3, tech_pvt->at_postinit_3_expect); - if (res) { - DEBUGA_GSMOPEN("%s didn't get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_postinit_3, tech_pvt->at_postinit_3_expect); - } - } else { - break; - } - - if (strlen(tech_pvt->at_postinit_4)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_4, tech_pvt->at_postinit_4_expect); - if (res) { - DEBUGA_GSMOPEN("%s didn't get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_postinit_4, tech_pvt->at_postinit_4_expect); - } - } else { - break; - } - - if (strlen(tech_pvt->at_postinit_5)) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_5, tech_pvt->at_postinit_5_expect); - if (res) { - DEBUGA_GSMOPEN("%s didn't get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, tech_pvt->at_postinit_5, tech_pvt->at_postinit_5_expect); - } - } else { - break; - } - - break; - } - - return 0; -} - -int gsmopen_serial_sync_AT(private_t *tech_pvt) -{ - gsmopen_sleep(10000); /* 10msec */ - time(&tech_pvt->gsmopen_serial_synced_timestamp); - return 0; -} - -int gsmopen_serial_read_AT(private_t *tech_pvt, int look_for_ack, int timeout_usec, int timeout_sec, const char *expected_string, int expect_crlf) -{ - int select_err = 1; - struct timeval timeout; - char tmp_answer[AT_BUFSIZ]; - char tmp_answer2[AT_BUFSIZ]; - char tmp_answer3[AT_BUFSIZ]; - char *tmp_answer_ptr; - char *last_line_ptr; - int i = 0; - int read_count = 0; - int la_counter = 0; - int at_ack = -1; - int la_read = 0; - int timeout_in_msec; - int msecs_passed = 0; - - timeout_in_msec = (timeout_sec * 1000) + (timeout_usec ? (timeout_usec / 1000) : 0); - - if (timeout_in_msec != 100) - DEBUGA_GSMOPEN("TIMEOUT=%d\n", GSMOPEN_P_LOG, timeout_in_msec); - - if (!running || !tech_pvt || !tech_pvt->running) { - return -1; - } - - tmp_answer_ptr = tmp_answer; - memset(tmp_answer, 0, sizeof(char) * AT_BUFSIZ); - memset(tmp_answer2, 0, sizeof(char) * AT_BUFSIZ); - memset(tmp_answer3, 0, sizeof(char) * AT_BUFSIZ); - - timeout.tv_sec = timeout_sec; - timeout.tv_usec = timeout_usec; - PUSHA_UNLOCKA(tech_pvt->controldev_lock); - LOKKA(tech_pvt->controldev_lock); - - while ((!tech_pvt->controldev_dead) && msecs_passed <= timeout_in_msec) { - char *token_ptr; - timeout.tv_sec = timeout_sec; //reset the timeout, linux modify it - timeout.tv_usec = timeout_usec; //reset the timeout, linux modify it - - read: - switch_sleep(20000); - msecs_passed += 20; - - if (timeout_in_msec != 100) { - //ERRORA("TIMEOUT=%d, PASSED=%d\n", GSMOPEN_P_LOG, timeout_in_msec, msecs_passed); - } - read_count = tech_pvt->serialPort_serial_control->Read(tmp_answer_ptr, AT_BUFSIZ - (tmp_answer_ptr - tmp_answer)); - memset(tmp_answer3, 0, sizeof(char) * AT_BUFSIZ); - strcpy(tmp_answer3, tmp_answer_ptr); - - if (read_count == 0) { - if (msecs_passed <= timeout_in_msec) { - goto read; - } - } - if (read_count == -1) { - ERRORA - ("read -1 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n", - GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->controldev_dead = 1; - ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->running = 0; - alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); - tech_pvt->active = 0; - tech_pvt->name[0] = '\0'; - - UNLOCKA(tech_pvt->controldev_lock); - if (tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - switch_sleep(1000000); - return -1; - } - - tmp_answer_ptr = tmp_answer_ptr + read_count; - - la_counter = 0; - memset(tmp_answer2, 0, sizeof(char) * AT_BUFSIZ); - strcpy(tmp_answer2, tmp_answer); - if ((token_ptr = strtok(tmp_answer2, "\n\r"))) { - last_line_ptr = token_ptr; - strncpy(tech_pvt->line_array.result[la_counter], token_ptr, AT_MESG_MAX_LENGTH); - if (strlen(token_ptr) > AT_MESG_MAX_LENGTH) { - WARNINGA - ("AT mesg longer than buffer, original message was: |%s|, in buffer only: |%s|\n", - GSMOPEN_P_LOG, token_ptr, tech_pvt->line_array.result[la_counter]); - } - la_counter++; - - while ((token_ptr = strtok(NULL, "\n\r"))) { - last_line_ptr = token_ptr; - strncpy(tech_pvt->line_array.result[la_counter], token_ptr, AT_MESG_MAX_LENGTH); - if (strlen(token_ptr) > AT_MESG_MAX_LENGTH) { - WARNINGA - ("AT mesg longer than buffer, original message was: |%s|, in buffer only: |%s|\n", - GSMOPEN_P_LOG, token_ptr, tech_pvt->line_array.result[la_counter]); - } - la_counter++; - - if (la_counter == AT_MESG_MAX_LINES) { - ERRORA("Too many lines in result (>%d). la_counter=%d. tech_pvt->reading_sms_msg=%d. Stop accumulating lines.\n", GSMOPEN_P_LOG, - AT_MESG_MAX_LINES, la_counter, tech_pvt->reading_sms_msg); - WARNINGA("read was %d bytes, tmp_answer3= --|%s|--\n", GSMOPEN_P_LOG, read_count, tmp_answer3); - at_ack = AT_ERROR; - break; - } - - } - } else { - last_line_ptr = tmp_answer; - } - - if (expected_string && !expect_crlf) { - DEBUGA_GSMOPEN - ("last_line_ptr=|%s|, expected_string=|%s|, expect_crlf=%d, memcmp(last_line_ptr, expected_string, strlen(expected_string)) = %d\n", - GSMOPEN_P_LOG, last_line_ptr, expected_string, expect_crlf, memcmp(last_line_ptr, expected_string, strlen(expected_string))); - } - - if (expected_string && !expect_crlf && !memcmp(last_line_ptr, expected_string, strlen(expected_string)) - ) { - strncpy(tech_pvt->line_array.result[la_counter], last_line_ptr, AT_MESG_MAX_LENGTH); - // match expected string -> accept it withtout CRLF - la_counter++; - if (la_counter == AT_MESG_MAX_LINES) { - ERRORA("Too many lines in result (>%d). la_counter=%d. tech_pvt->reading_sms_msg=%d. Stop accumulating lines.\n", GSMOPEN_P_LOG, - AT_MESG_MAX_LINES, la_counter, tech_pvt->reading_sms_msg); - WARNINGA("read was %d bytes, tmp_answer3= --|%s|--\n", GSMOPEN_P_LOG, read_count, tmp_answer3); - at_ack = AT_ERROR; - break; - } - } - /* if the last line read was not a complete line, we'll read the rest in the future */ - else if (tmp_answer[strlen(tmp_answer) - 1] != '\r' && tmp_answer[strlen(tmp_answer) - 1] != '\n') - la_counter--; - - /* let's list the complete lines read so far, without re-listing the lines that have already been listed */ - for (i = la_read; i < la_counter; i++) { - DEBUGA_GSMOPEN("Read line %d: |%s| la_counter=%d\n", GSMOPEN_P_LOG, i, tech_pvt->line_array.result[i], la_counter); - } - - if (la_counter == AT_MESG_MAX_LINES) { - ERRORA("Too many lines in result (>%d). la_counter=%d. tech_pvt->reading_sms_msg=%d. Stop accumulating lines.\n", GSMOPEN_P_LOG, - AT_MESG_MAX_LINES, la_counter, tech_pvt->reading_sms_msg); - WARNINGA("read was %d bytes, tmp_answer3= --|%s|--\n", GSMOPEN_P_LOG, read_count, tmp_answer3); - at_ack = AT_ERROR; - break; - } - - - /* let's interpret the complete lines read so far (WITHOUT looking for OK, ERROR, and EXPECTED_STRING), without re-interpreting the lines that has been yet interpreted, so we're sure we don't miss anything */ - for (i = la_read; i < la_counter; i++) { - - if ((strcmp(tech_pvt->line_array.result[i], "RING") == 0)) { - /* with first RING we wait for callid */ - gettimeofday(&(tech_pvt->ringtime), NULL); - /* give CALLID (+CLIP) a chance, wait for the next RING before answering */ - if (tech_pvt->phone_callflow == CALLFLOW_INCOMING_RING) { - /* we're at the second ring, set the interface state, will be answered by gsmopen_do_monitor */ - DEBUGA_GSMOPEN("|%s| got second RING\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - tech_pvt->interface_state = GSMOPEN_STATE_RING; - } else { - /* we're at the first ring, so there is no CALLID yet thus clean the previous one - just in case we don't receive the caller identification in this new call */ - memset(tech_pvt->callid_name, 0, sizeof(tech_pvt->callid_name)); - memset(tech_pvt->callid_number, 0, sizeof(tech_pvt->callid_number)); - /* only send AT+CLCC? if the device previously reported its support */ - if (tech_pvt->at_has_clcc != 0) { - /* we're at the first ring, try to get CALLID (with +CLCC) */ - DEBUGA_GSMOPEN("|%s| got first RING, sending AT+CLCC?\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - int res = gsmopen_serial_write_AT_noack(tech_pvt, "AT+CLCC?"); - if (res) { - ERRORA("AT+CLCC? (call list) was not correctly sent to the phone\n", GSMOPEN_P_LOG); - } - } else { - DEBUGA_GSMOPEN("|%s| got first RING, but not sending AT+CLCC? as this device " - "seems not to support\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - } - tech_pvt->phone_callflow = CALLFLOW_INCOMING_RING; - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CLCC", 5) == 0)) { - int commacount = 0; - int a = 0; - int b = 0; - int c = 0; - /* with clcc we wait for clip */ - memset(tech_pvt->callid_name, 0, sizeof(tech_pvt->callid_name)); - memset(tech_pvt->callid_number, 0, sizeof(tech_pvt->callid_number)); - - for (a = 0; a < (int) strlen(tech_pvt->line_array.result[i]); a++) { - - if (tech_pvt->line_array.result[i][a] == ',') { - commacount++; - } - if (commacount == 5) { - if (tech_pvt->line_array.result[i][a] != ',' && tech_pvt->line_array.result[i][a] != '"') { - tech_pvt->callid_number[b] = tech_pvt->line_array.result[i][a]; - b++; - } - } - if (commacount == 7) { - if (tech_pvt->line_array.result[i][a] != ',' && tech_pvt->line_array.result[i][a] != '"') { - tech_pvt->callid_name[c] = tech_pvt->line_array.result[i][a]; - c++; - } - } - } - - tech_pvt->phone_callflow = CALLFLOW_INCOMING_RING; - DEBUGA_GSMOPEN("|%s| CLCC CALLID: name is %s, number is %s\n", GSMOPEN_P_LOG, - tech_pvt->line_array.result[i], - tech_pvt->callid_name[0] ? tech_pvt->callid_name : "not available", - tech_pvt->callid_number[0] ? tech_pvt->callid_number : "not available"); - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CLIP", 5) == 0)) { - int commacount = 0; - int a = 0; - int b = 0; - int c = 0; - /* with CLIP, we want to answer right away */ - memset(tech_pvt->callid_name, 0, sizeof(tech_pvt->callid_name)); - memset(tech_pvt->callid_number, 0, sizeof(tech_pvt->callid_number)); - - for (a = 7; a < (int) strlen(tech_pvt->line_array.result[i]); a++) { - if (tech_pvt->line_array.result[i][a] == ',') { - commacount++; - } - if (commacount == 0) { - if (tech_pvt->line_array.result[i][a] != ',' && tech_pvt->line_array.result[i][a] != '"') { - tech_pvt->callid_number[b] = tech_pvt->line_array.result[i][a]; - b++; - } - } - if (commacount == 4) { - if (tech_pvt->line_array.result[i][a] != ',' && tech_pvt->line_array.result[i][a] != '"') { - tech_pvt->callid_name[c] = tech_pvt->line_array.result[i][a]; - c++; - } - } - } - - if (tech_pvt->interface_state != GSMOPEN_STATE_RING) { - gettimeofday(&(tech_pvt->call_incoming_time), NULL); - DEBUGA_GSMOPEN("GSMOPEN_STATE_RING call_incoming_time.tv_sec=%ld\n", GSMOPEN_P_LOG, tech_pvt->call_incoming_time.tv_sec); - - } - - tech_pvt->interface_state = GSMOPEN_STATE_RING; - tech_pvt->phone_callflow = CALLFLOW_INCOMING_RING; - DEBUGA_GSMOPEN("|%s| CLIP INCOMING CALLID: name is %s, number is %s\n", GSMOPEN_P_LOG, - tech_pvt->line_array.result[i], - (strlen(tech_pvt->callid_name) && tech_pvt->callid_name[0] != 1) ? tech_pvt->callid_name : "not available", - strlen(tech_pvt->callid_number) ? tech_pvt->callid_number : "not available"); - - if (!strlen(tech_pvt->callid_number)) { - strcpy(tech_pvt->callid_number, "not available"); - } - - if (!strlen(tech_pvt->callid_name) && tech_pvt->callid_name[0] != 1) { - strncpy(tech_pvt->callid_name, tech_pvt->callid_number, sizeof(tech_pvt->callid_name)); - snprintf(tech_pvt->callid_name, sizeof(tech_pvt->callid_name), "GSMopen: %s", tech_pvt->callid_number); - } - - DEBUGA_GSMOPEN("|%s| CLIP INCOMING CALLID: NOW name is %s, number is %s\n", GSMOPEN_P_LOG, - tech_pvt->line_array.result[i], tech_pvt->callid_name, tech_pvt->callid_number); - } - - if ((strcmp(tech_pvt->line_array.result[i], "+CMS ERROR: 500") == 0)) { - ERRORA("Received: \"%s\", generic error, maybe this account ran OUT OF CREDIT?\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } else if ((strncmp(tech_pvt->line_array.result[i], "+CMS ERROR:", 11) == 0)) { - ERRORA("Received: \"%s\", what was this error about?\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - if ((strcmp(tech_pvt->line_array.result[i], "BUSY") == 0)) { - tech_pvt->phone_callflow = CALLFLOW_CALL_LINEBUSY; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_LINEBUSY\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->phone_callflow != CALLFLOW_CALL_DOWN) { - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - tech_pvt->interface_state = GSMOPEN_STATE_DOWN; - - session = switch_core_session_locate(tech_pvt->session_uuid_str); - if (session) { - channel = switch_core_session_get_channel(session); - switch_core_session_rwunlock(session); - switch_channel_hangup(channel, SWITCH_CAUSE_NONE); - } - - } else { - ERRORA("Why BUSY now?\n", GSMOPEN_P_LOG); - } - } - if ((strcmp(tech_pvt->line_array.result[i], "NO ANSWER") == 0)) { - tech_pvt->phone_callflow = CALLFLOW_CALL_NOANSWER; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_NOANSWER\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_NO_ANSWER; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } else { - ERRORA("Why NO ANSWER now?\n", GSMOPEN_P_LOG); - } - } - if ((strcmp(tech_pvt->line_array.result[i], "NO CARRIER") == 0)) { - tech_pvt->phone_callflow = CALLFLOW_CALL_NOCARRIER; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_NOCARRIER\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - tech_pvt->interface_state = GSMOPEN_STATE_DOWN; - - session = switch_core_session_locate(tech_pvt->session_uuid_str); - if (session) { - channel = switch_core_session_get_channel(session); - switch_core_session_rwunlock(session); - switch_channel_hangup(channel, SWITCH_CAUSE_NONE); - } - } else { - ERRORA("Why NO CARRIER now?\n", GSMOPEN_P_LOG); - } - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CBC:", 5) == 0)) { - int power_supply, battery_strenght, err; - - power_supply = battery_strenght = 0; - - err = sscanf(&tech_pvt->line_array.result[i][6], "%d,%d", &power_supply, &battery_strenght); - if (err < 2) { - DEBUGA_GSMOPEN("|%s| is not formatted as: |+CBC: xx,yy| now trying |+CBC:xx,yy|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - err = sscanf(&tech_pvt->line_array.result[i][5], "%d,%d", &power_supply, &battery_strenght); - DEBUGA_GSMOPEN("|%s| +CBC: Powered by %s, battery strenght=%d\n", GSMOPEN_P_LOG, - tech_pvt->line_array.result[i], power_supply ? "power supply" : "battery", battery_strenght); - - } - - if (err < 2) { - DEBUGA_GSMOPEN("|%s| is not formatted as: |+CBC:xx,yy| giving up\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - else { - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| +CBC: Powered by %s, battery strenght=%d\n", GSMOPEN_P_LOG, - tech_pvt->line_array.result[i], power_supply ? "power supply" : "battery", battery_strenght); - if (!power_supply) { - if (battery_strenght < 10) { - ERRORA("|%s| BATTERY ALMOST EXHAUSTED\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } else if (battery_strenght < 20) { - WARNINGA("|%s| BATTERY LOW\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - } - - } - } - - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CSQ:", 5) == 0)) { - int signal_quality, ber, err; - - signal_quality = ber = 0; - - err = sscanf(&tech_pvt->line_array.result[i][6], "%d,%d", &signal_quality, &ber); - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| +CSQ: Signal Quality: %d, Error Rate=%d\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i], signal_quality, ber); - if (err < 2) { - ERRORA("|%s| is not formatted as: |+CSQ: xx,yy|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } else { - if (signal_quality < 9 || signal_quality == 99) { - ERRORA - ("|%s| CELLPHONE GETS ALMOST NO SIGNAL, consider to move it or use additional antenna\n", - GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - tech_pvt->got_signal = 0; - alarm_event(tech_pvt, ALARM_NETWORK_NO_SIGNAL, "CELLPHONE GETS ALMOST NO SIGNAL, consider to move it or use additional antenna"); - } else if (signal_quality < 11) { - WARNINGA("|%s| CELLPHONE GETS SIGNAL LOW\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - tech_pvt->got_signal = 1; - alarm_event(tech_pvt, ALARM_NETWORK_LOW_SIGNAL, "CELLPHONE GETS SIGNAL LOW"); - } else { - tech_pvt->got_signal = 2; - } - - if (signal_quality == 99) { - tech_pvt->signal_strength = 0; - } else { - tech_pvt->signal_strength = (signal_quality * 2) - 113; /* RSSI [dBm] = reported_value * 2 - 113dB */ - } - - } - - } - if ((strncmp(tech_pvt->line_array.result[i], "+CREG:", 6) == 0)) { - int n, stat, err; - - n = stat = 0; - - err = sscanf(&tech_pvt->line_array.result[i][6], "%d,%d", &n, &stat); - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| +CREG: Display: %d, Registration=%d\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i], n, stat); - if (err < 2) { - DEBUGA_GSMOPEN("|%s| is not formatted as: |+CREG: xx,yy|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } else { - if (stat == 0) { - ERRORA - ("|%s| CELLPHONE is not registered to network, consider to move it or use 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 use additional antenna"); - } else if (stat == 1) { - DEBUGA_GSMOPEN("|%s| CELLPHONE is registered to the HOME network\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - tech_pvt->not_registered = 0; - tech_pvt->home_network_registered = 1; - tech_pvt->roaming_registered = 0; - } else { - ERRORA("|%s| CELLPHONE is registered to a ROAMING network\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - tech_pvt->not_registered = 0; - tech_pvt->home_network_registered = 0; - tech_pvt->roaming_registered = 1; - alarm_event(tech_pvt, ALARM_ROAMING_NETWORK_REGISTRATION, "CELLPHONE is registered to a ROAMING network"); - } - } - - } - - if ((strncmp(tech_pvt->line_array.result[i], "+COPS:", 6) == 0)) { - int mode, format, rat, err; - char oper[128] = ""; - mode = format = rat = err = 0; - - err = sscanf(&tech_pvt->line_array.result[i][6], "%d,%d,%*[\"]%[^\"]%*[\"],%d", &mode, &format, &oper, &rat); - if (err < 3) { - DEBUGA_GSMOPEN("|%s| is not formatted as: |+COPS: xx,yy,ssss,nn|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } else if (option_debug > 1) { - DEBUGA_GSMOPEN("|%s| +COPS: : Mode %d, Format %d, Operator %s, Rat %d\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i], mode, format, oper, rat); - } - - /* if we are requesting the operator name, copy it over */ - if (tech_pvt->requesting_operator_name) - strncpy(tech_pvt->operator_name, oper, sizeof(tech_pvt->operator_name)); - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CNUM:", 6) == 0) || (strncmp(tech_pvt->line_array.result[i], "ERROR+CNUM:", 11) == 0)) { - int skip_chars, err, type; - char number[128] = ""; - char *in_ptr, *out_ptr; - - skip_chars = err = type = 0; - in_ptr = out_ptr = number; - - /* +CNUM or ERROR+CNUM ? */ - if ((strncmp(tech_pvt->line_array.result[i], "+CNUM:", 6) == 0)) - skip_chars = 7; - else - skip_chars = 12; - - err = sscanf(&tech_pvt->line_array.result[i][skip_chars], "%*[^,],%[^,],%d", &number, &type); - - /* Remove any double quotes */ - while (*in_ptr) { - if (*in_ptr != '\"') *out_ptr++ = *in_ptr; - in_ptr++; - } - *out_ptr = '\0'; - - if (err < 2) { - DEBUGA_GSMOPEN("|%s| is not formatted as: |+CNUM: \"Name\", \"+39025458068\", 145|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } else if (option_debug) { - DEBUGA_GSMOPEN("|%s| +CNUM: Subscriber number = %s, Type = %d\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i], number, type); - } - - /* Copy only the first number listed if there are more then one */ - if (tech_pvt->requesting_subscriber_number && !strlen(tech_pvt->subscriber_number)) - strncpy(tech_pvt->subscriber_number, number, sizeof(tech_pvt->subscriber_number)); - - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CMGW:", 6) == 0)) { - int err; - - err = sscanf(&tech_pvt->line_array.result[i][7], "%s", tech_pvt->at_cmgw); - DEBUGA_GSMOPEN("|%s| +CMGW: %s\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i], tech_pvt->at_cmgw); - if (err < 1) { - ERRORA("|%s| is not formatted as: |+CMGW: xxxx|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - } - - if ((strncmp(tech_pvt->line_array.result[i], "^CEND:1", 7) == 0)) { - tech_pvt->phone_callflow = CALLFLOW_CALL_NOCARRIER; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_NOCARRIER\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - tech_pvt->interface_state = GSMOPEN_STATE_DOWN; - - session = switch_core_session_locate(tech_pvt->session_uuid_str); - if (session) { - channel = switch_core_session_get_channel(session); - switch_core_session_rwunlock(session); - switch_channel_hangup(channel, SWITCH_CAUSE_NONE); - } - tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_IDLE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { - DEBUGA_GSMOPEN("just received a remote HANGUP\n", GSMOPEN_P_LOG); - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_NORMAL; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - DEBUGA_GSMOPEN("just sent GSMOPEN_CONTROL_HANGUP\n", GSMOPEN_P_LOG); - } - } else { - ERRORA("Why NO CARRIER now?\n", GSMOPEN_P_LOG); - } - } - - /* at_call_* are unsolicited messages sent by the modem to signal us about call processing activity and events */ - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_idle) == 0)) { - tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_IDLE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { - DEBUGA_GSMOPEN("just received a remote HANGUP\n", GSMOPEN_P_LOG); - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_NORMAL; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - DEBUGA_GSMOPEN("just sent GSMOPEN_CONTROL_HANGUP\n", GSMOPEN_P_LOG); - } - - tech_pvt->phone_callflow = CALLFLOW_CALL_NOCARRIER; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_NOCARRIER\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - tech_pvt->interface_state = GSMOPEN_STATE_DOWN; - - session = switch_core_session_locate(tech_pvt->session_uuid_str); - if (session) { - channel = switch_core_session_get_channel(session); - switch_core_session_rwunlock(session); - switch_channel_hangup(channel, SWITCH_CAUSE_NONE); - } - } else { - ERRORA("Why NO CARRIER now?\n", GSMOPEN_P_LOG); - } - - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_incoming) == 0)) { - - - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_INCOMING\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - if (tech_pvt->phone_callflow != CALLFLOW_CALL_INCOMING && tech_pvt->phone_callflow != CALLFLOW_INCOMING_RING) { - //mark the time of CALLFLOW_CALL_INCOMING - gettimeofday(&(tech_pvt->call_incoming_time), NULL); - tech_pvt->phone_callflow = CALLFLOW_CALL_INCOMING; - DEBUGA_GSMOPEN("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld\n", GSMOPEN_P_LOG, tech_pvt->call_incoming_time.tv_sec); - - } - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_active) == 0)) { - tech_pvt->phone_callflow = CALLFLOW_CALL_ACTIVE; - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_ACTIVE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - if (tech_pvt->interface_state == CALLFLOW_CALL_DIALING || tech_pvt->interface_state == CALLFLOW_STATUS_EARLYMEDIA) { - DEBUGA_PBX("just received a remote ANSWER\n", GSMOPEN_P_LOG); - if (tech_pvt->phone_callflow == GSMOPEN_STATE_UP) { - DEBUGA_PBX("just sent GSMOPEN_CONTROL_RINGING\n", GSMOPEN_P_LOG); - DEBUGA_PBX("going to send GSMOPEN_CONTROL_ANSWER\n", GSMOPEN_P_LOG); - tech_pvt->interface_state = CALLFLOW_CALL_REMOTEANSWER; - DEBUGA_PBX("just sent GSMOPEN_CONTROL_ANSWER\n", GSMOPEN_P_LOG); - } - } else { - tech_pvt->interface_state = GSMOPEN_STATE_UP; - DEBUGA_PBX("just interface_state UP\n", GSMOPEN_P_LOG); - } - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_calling) == 0)) { - tech_pvt->phone_callflow = CALLFLOW_CALL_DIALING; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_DIALING\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_failed) == 0)) { - tech_pvt->phone_callflow = CALLFLOW_CALL_FAILED; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_FAILED\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CSCA:", 6) == 0)) { //TODO SMS FIXME in config! - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| +CSCA: Message Center Address!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CMGF:", 6) == 0)) { //TODO SMS FIXME in config! - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| +CMGF: Message Format!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CMTI:", 6) == 0)) { //TODO SMS FIXME in config! - int err; - int pos; - - //FIXME all the following commands in config! - if (option_debug) - DEBUGA_GSMOPEN("|%s| +CMTI: Incoming SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - err = sscanf(&tech_pvt->line_array.result[i][12], "%d", &pos); - if (err < 1) { - ERRORA("|%s| is not formatted as: |+CMTI: \"MT\",xx|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } else { - DEBUGA_GSMOPEN("|%s| +CMTI: Incoming SMS in position: %d!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i], pos); - tech_pvt->unread_sms_msg_id = pos; - gsmopen_sleep(1000); - - char at_command[256]; - - if (tech_pvt->no_ucs2 == 0) { - int res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"UCS2\""); - if (res) { - ERRORA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) didn't get OK from the phone, continuing\n", GSMOPEN_P_LOG); - //memset(tech_pvt->sms_message, 0, sizeof(tech_pvt->sms_message)); - } - } - - memset(at_command, 0, sizeof(at_command)); - sprintf(at_command, "AT+CMGR=%d", tech_pvt->unread_sms_msg_id); - memset(tech_pvt->sms_message, 0, sizeof(tech_pvt->sms_message)); - - tech_pvt->reading_sms_msg = 1; - int res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); - tech_pvt->reading_sms_msg = 0; - if (res) { - ERRORA("AT+CMGR (read SMS) didn't get OK from the phone, message sent was:|||%s|||\n", GSMOPEN_P_LOG, at_command); - } - memset(at_command, 0, sizeof(at_command)); - sprintf(at_command, "AT+CMGD=%d", tech_pvt->unread_sms_msg_id); /* delete the message */ - tech_pvt->unread_sms_msg_id = 0; - res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); - if (res) { - ERRORA("AT+CMGD (Delete SMS) didn't get OK from the phone, message sent was:|||%s|||\n", GSMOPEN_P_LOG, at_command); - } - - res = sms_incoming(tech_pvt); - - if (tech_pvt->phone_callflow == CALLFLOW_CALL_IDLE && tech_pvt->interface_state == GSMOPEN_STATE_DOWN && tech_pvt->owner == NULL) { - /* we're not in a call, neither calling */ - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CKPD=\"EEE\""); - if (res) { - DEBUGA_GSMOPEN("AT+CKPD=\"EEE\" (cellphone screen back to user) didn't get OK from the phone\n", GSMOPEN_P_LOG); - } - } - - } //CMTI well formatted - - } //CMTI - - if ((strncmp(tech_pvt->line_array.result[i], "+MMGL:", 6) == 0)) { //TODO MOTOROLA SMS FIXME in config! - int err = 0; - - if (option_debug) - DEBUGA_GSMOPEN("|%s| +MMGL: Listing Motorola SMSs!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - err = sscanf(&tech_pvt->line_array.result[i][7], "%d", &tech_pvt->unread_sms_msg_id); - if (err < 1) { - ERRORA("|%s| is not formatted as: |+MMGL: xx|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - } - if ((strncmp(tech_pvt->line_array.result[i], "+CMGL:", 6) == 0)) { //TODO SMS FIXME in config! - if (option_debug) - DEBUGA_GSMOPEN("|%s| +CMGL: Listing SMSs!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - if ((strncmp(tech_pvt->line_array.result[i], "+MMGR:", 6) == 0)) { //TODO MOTOROLA SMS FIXME in config! - if (option_debug) - DEBUGA_GSMOPEN("|%s| +MMGR: Reading Motorola SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->reading_sms_msg) - tech_pvt->reading_sms_msg++; - } - if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: \"STO U", 13) == 0)) { //TODO SMS FIXME in config! - if (option_debug) - DEBUGA_GSMOPEN("|%s| +CMGR: Reading stored UNSENT SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } else if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: \"STO S", 13) == 0)) { //TODO SMS FIXME in config! - if (option_debug) - DEBUGA_GSMOPEN("|%s| +CMGR: Reading stored SENT SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } else if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: \"REC R", 13) == 0)) { //TODO SMS FIXME in config! - if (option_debug) - DEBUGA_GSMOPEN("|%s| +CMGR: Reading received READ SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } else if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: \"REC U", 13) == 0)) { //TODO SMS FIXME in config! - if (option_debug) - DEBUGA_GSMOPEN("|%s| +CMGR: Reading received UNREAD SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->reading_sms_msg) - tech_pvt->reading_sms_msg++; - } else if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: ", 6) == 0)) { //TODO SMS FIXME in config! - if (option_debug) - DEBUGA_GSMOPEN("|%s| +CMGR: Reading SMS!\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->reading_sms_msg) - tech_pvt->reading_sms_msg++; - } - - if ((strcmp(tech_pvt->line_array.result[i], "+MCST: 17") == 0)) { /* motorola call processing unsolicited messages */ - tech_pvt->phone_callflow = CALLFLOW_CALL_INFLUX; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_INFLUX\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strcmp(tech_pvt->line_array.result[i], "+MCST: 68") == 0)) { /* motorola call processing unsolicited messages */ - tech_pvt->phone_callflow = CALLFLOW_CALL_NOSERVICE; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_NOSERVICE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - } - if ((strcmp(tech_pvt->line_array.result[i], "+MCST: 70") == 0)) { /* motorola call processing unsolicited messages */ - tech_pvt->phone_callflow = CALLFLOW_CALL_OUTGOINGRESTRICTED; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_OUTGOINGRESTRICTED\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - } - if ((strcmp(tech_pvt->line_array.result[i], "+MCST: 72") == 0)) { /* motorola call processing unsolicited messages */ - tech_pvt->phone_callflow = CALLFLOW_CALL_SECURITYFAIL; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_SECURITYFAIL\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - } - - if ((strncmp(tech_pvt->line_array.result[i], "+CPBR", 5) == 0)) { /* phonebook stuff begins */ - - if (tech_pvt->phonebook_querying) { /* probably phonebook struct begins */ - int err, first_entry, last_entry, number_lenght, text_lenght; - - if (option_debug) - DEBUGA_GSMOPEN("phonebook struct: |%s|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - err = sscanf(&tech_pvt->line_array.result[i][8], "%d-%d),%d,%d", &first_entry, &last_entry, &number_lenght, &text_lenght); - if (err < 4) { - - err = sscanf(&tech_pvt->line_array.result[i][7], "%d-%d,%d,%d", &first_entry, &last_entry, &number_lenght, &text_lenght); - } - - if (err < 4) { - ERRORA - ("phonebook struct: |%s| is nor formatted as: |+CPBR: (1-750),40,14| neither as: |+CPBR: 1-750,40,14|\n", - GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } else { - - if (option_debug) - DEBUGA_GSMOPEN - ("First entry: %d, last entry: %d, phone number max lenght: %d, text max lenght: %d\n", - GSMOPEN_P_LOG, first_entry, last_entry, number_lenght, text_lenght); - tech_pvt->phonebook_first_entry = first_entry; - tech_pvt->phonebook_last_entry = last_entry; - tech_pvt->phonebook_number_lenght = number_lenght; - tech_pvt->phonebook_text_lenght = text_lenght; - } - - } else { /* probably phonebook entry begins */ - - if (tech_pvt->phonebook_listing) { - int err, entry_id, entry_type; - - char entry_number[256]; - char entry_text[256]; - - if (option_debug) - DEBUGA_GSMOPEN("phonebook entry: |%s|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - err = - sscanf(&tech_pvt->line_array.result[i][7], "%d,\"%255[0-9+]\",%d,\"%255[^\"]\"", &entry_id, entry_number, &entry_type, - entry_text); - if (err < 4) { - ERRORA - ("err=%d, phonebook entry: |%s| is not formatted as: |+CPBR: 504,\"+39025458068\",145,\"ciao a tutti\"|\n", - GSMOPEN_P_LOG, err, tech_pvt->line_array.result[i]); - } else { - //TODO: sanitize entry_text - if (option_debug) - DEBUGA_GSMOPEN("Number: %s, Text: %s, Type: %d\n", GSMOPEN_P_LOG, entry_number, entry_text, entry_type); - /* write entry in phonebook file */ - if (tech_pvt->phonebook_writing_fp) { - gsmopen_dir_entry_extension++; - - fprintf(tech_pvt->phonebook_writing_fp, - "%s => ,%sSKO,,,hidefromdir=%s|phonebook_direct_calling_ext=%d%s%.4d|phonebook_entry_fromcell=%s|phonebook_entry_owner=%s\n", - entry_number, entry_text, "no", - tech_pvt->gsmopen_dir_entry_extension_prefix, "2", gsmopen_dir_entry_extension, "yes", "not_specified"); - fprintf(tech_pvt->phonebook_writing_fp, - "%s => ,%sDO,,,hidefromdir=%s|phonebook_direct_calling_ext=%d%s%.4d|phonebook_entry_fromcell=%s|phonebook_entry_owner=%s\n", - entry_number, entry_text, "no", - tech_pvt->gsmopen_dir_entry_extension_prefix, "3", gsmopen_dir_entry_extension, "yes", "not_specified"); - } - } - - } - - if (tech_pvt->phonebook_listing_received_calls) { - int err, entry_id, entry_type; - - char entry_number[256] = ""; - char entry_text[256] = ""; - - if (option_debug) - DEBUGA_GSMOPEN("phonebook entry: |%s|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - err = - sscanf(&tech_pvt->line_array.result[i][7], "%d,\"%255[0-9+]\",%d,\"%255[^\"]\"", &entry_id, entry_number, &entry_type, - entry_text); - if (err < 1) { //we match only on the progressive id, maybe the remote party has not sent its number, and/or there is no corresponding text entry in the phone directory - ERRORA - ("err=%d, phonebook entry: |%s| is not formatted as: |+CPBR: 504,\"+39025458068\",145,\"ciao a tutti\"|\n", - GSMOPEN_P_LOG, err, tech_pvt->line_array.result[i]); - } else { - //TODO: sanitize entry_text - - if (option_debug) - DEBUGA_GSMOPEN("Number: %s, Text: %s, Type: %d\n", GSMOPEN_P_LOG, entry_number, entry_text, entry_type); - memset(tech_pvt->callid_name, 0, sizeof(tech_pvt->callid_name)); - memset(tech_pvt->callid_number, 0, sizeof(tech_pvt->callid_number)); - strncpy(tech_pvt->callid_name, entry_text, sizeof(tech_pvt->callid_name)); - strncpy(tech_pvt->callid_number, entry_number, sizeof(tech_pvt->callid_number)); - if (option_debug) - DEBUGA_GSMOPEN("incoming callid: Text: %s, Number: %s\n", GSMOPEN_P_LOG, tech_pvt->callid_name, tech_pvt->callid_number); - - DEBUGA_GSMOPEN("|%s| CPBR INCOMING CALLID: name is %s, number is %s\n", - GSMOPEN_P_LOG, tech_pvt->line_array.result[i], - tech_pvt->callid_name[0] != 1 ? tech_pvt->callid_name : "not available", - tech_pvt->callid_number[0] ? tech_pvt->callid_number : "not available"); - - /* mark the time of RING */ - gettimeofday(&(tech_pvt->ringtime), NULL); - tech_pvt->interface_state = GSMOPEN_STATE_RING; - tech_pvt->phone_callflow = CALLFLOW_INCOMING_RING; - - } - - } - - else { - DEBUGA_GSMOPEN("phonebook entry: |%s|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - - } - } - - } - if ((strncmp(tech_pvt->line_array.result[i], "+CUSD:", 6) == 0)) { - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| USSD received\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - int res = 0, status = 0; - unsigned int dcs = 0; - char ussd_msg[1024]; - memset(tech_pvt->ussd_message, '\0', sizeof(tech_pvt->ussd_message)); - memset(tech_pvt->ussd_dcs, '\0', sizeof(tech_pvt->ussd_dcs)); - res = sscanf(&tech_pvt->line_array.result[i][6], "%d,\"%1023[0-9A-F]\",%d", &status, ussd_msg, &dcs); - if (res == 1) { - NOTICA("received +CUSD with status %d\n", GSMOPEN_P_LOG, status); - tech_pvt->ussd_received = 1; - tech_pvt->ussd_status = status; - } else if (res == 3) { - tech_pvt->ussd_received = 1; - tech_pvt->ussd_status = status; - - //identifying dcs alphabet according to GSM 03.38 Cell Broadcast Data Coding Scheme - //CBDataCodingScheme should be used here, but it appears to be buggy (ucs2 messages are not recognized) - int alphabet = DCS_RESERVED_ALPHABET; - if (dcs == 0x11) { - alphabet = DCS_SIXTEEN_BIT_ALPHABET; - } else if ((dcs & 0xF0) <= 0x30){ - alphabet = DCS_DEFAULT_ALPHABET; - } else if ((dcs & 0xC0) == 0x40 || (dcs & 0xF0) == 0x90) { - alphabet = dcs & (3 << 2); - }; - - if ( (tech_pvt->ussd_response_encoding == USSD_ENCODING_AUTO && alphabet == DCS_DEFAULT_ALPHABET) - || tech_pvt->ussd_response_encoding == USSD_ENCODING_HEX_7BIT ) { - SMSDecoder d(ussd_msg); - d.markSeptet(); - string ussd_dec = gsmToLatin1(d.getString(strlen(ussd_msg) / 2 * 8 / 7)); - iso_8859_1_to_utf8(tech_pvt, (char *) ussd_dec.c_str(), tech_pvt->ussd_message, sizeof(tech_pvt->ussd_message)); - strcpy(tech_pvt->ussd_dcs, "default alphabet"); - } else if ( (tech_pvt->ussd_response_encoding == USSD_ENCODING_AUTO && alphabet == DCS_SIXTEEN_BIT_ALPHABET) - || tech_pvt->ussd_response_encoding == USSD_ENCODING_UCS2 ) { - ucs2_to_utf8(tech_pvt, ussd_msg, tech_pvt->ussd_message, sizeof(tech_pvt->ussd_message)); - strcpy(tech_pvt->ussd_dcs, "16-bit alphabet"); - } else if ( (tech_pvt->ussd_response_encoding == USSD_ENCODING_AUTO && alphabet == DCS_EIGHT_BIT_ALPHABET) - || tech_pvt->ussd_response_encoding == USSD_ENCODING_HEX_8BIT ) { - char ussd_dec[1024]; - memset(ussd_dec, '\0', sizeof(ussd_dec)); - hexToBuf(ussd_msg, (unsigned char*)ussd_dec); - iso_8859_1_to_utf8(tech_pvt, (char *) ussd_dec, tech_pvt->ussd_message, sizeof(tech_pvt->ussd_message)); - strcpy(tech_pvt->ussd_dcs, "8-bit alphabet"); - } else if ( tech_pvt->ussd_response_encoding == USSD_ENCODING_PLAIN ) { - string ussd_dec = gsmToLatin1(ussd_msg); - iso_8859_1_to_utf8(tech_pvt, (char *) ussd_dec.c_str(), tech_pvt->ussd_message, sizeof(tech_pvt->ussd_message)); - strcpy(tech_pvt->ussd_dcs, "default alphabet"); - } else { - ERRORA("USSD data coding scheme not supported=%d\n", GSMOPEN_P_LOG, dcs); - } - - NOTICA("USSD received: status=%d, message='%s', dcs='%d'\n", - GSMOPEN_P_LOG, tech_pvt->ussd_status, tech_pvt->ussd_message, dcs); - - ussd_incoming(tech_pvt); - } else { - ERRORA ("res=%d, +CUSD command has wrong format: %s\n", - GSMOPEN_P_LOG, res, tech_pvt->line_array.result[i]); - } - } - - if ((strncmp(tech_pvt->line_array.result[i], "*ECAV", 5) == 0) || (strncmp(tech_pvt->line_array.result[i], "*ECAM", 5) == 0)) { /* sony-ericsson call processing unsolicited messages */ - int res, ccid, ccstatus, calltype, processid, exitcause, number, type; - res = ccid = ccstatus = calltype = processid = exitcause = number = type = 0; - res = - sscanf(&tech_pvt->line_array.result[i][6], "%d,%d,%d,%d,%d,%d,%d", &ccid, &ccstatus, &calltype, &processid, &exitcause, &number, - &type); - /* only changes the phone_callflow if enought parameters were parsed */ - if (res >= 3) { - switch (ccstatus) { - case 0: - if (tech_pvt->owner) { - ast_setstate(tech_pvt->owner, GSMOPEN_STATE_DOWN); - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_NORMAL; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; - tech_pvt->interface_state = GSMOPEN_STATE_DOWN; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| Sony-Ericsson *ECAM/*ECAV: IDLE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - break; - case 1: - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| Sony-Ericsson *ECAM/*ECAV: CALLING\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - break; - case 2: - if (tech_pvt->owner) { - ast_setstate(tech_pvt->owner, GSMOPEN_STATE_DIALING); - } - tech_pvt->interface_state = CALLFLOW_CALL_DIALING; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| Sony-Ericsson *ECAM/*ECAV: CONNECTING\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - break; - case 3: - if (tech_pvt->owner) { - ast_setstate(tech_pvt->owner, GSMOPEN_STATE_UP); - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_ANSWER); - } - tech_pvt->phone_callflow = CALLFLOW_CALL_ACTIVE; - tech_pvt->interface_state = GSMOPEN_STATE_UP; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| Sony-Ericsson *ECAM/*ECAV: ACTIVE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - break; - case 4: - if (option_debug > 1) - DEBUGA_GSMOPEN - ("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle HOLD event\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - break; - case 5: - if (option_debug > 1) - DEBUGA_GSMOPEN - ("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle WAITING event\n", GSMOPEN_P_LOG, - tech_pvt->line_array.result[i]); - break; - case 6: - if (option_debug > 1) - DEBUGA_GSMOPEN - ("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle ALERTING event\n", GSMOPEN_P_LOG, - tech_pvt->line_array.result[i]); - break; - case 7: - if (tech_pvt->owner) { - ast_setstate(tech_pvt->owner, GSMOPEN_STATE_BUSY); - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_BUSY); - } - tech_pvt->phone_callflow = CALLFLOW_CALL_LINEBUSY; - tech_pvt->interface_state = GSMOPEN_STATE_BUSY; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| Sony-Ericsson *ECAM/*ECAV: BUSY\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - break; - } - } else { - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| Sony-Ericsson *ECAM/*ECAV: could not parse parameters\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - } - - /* at_indicator_* are unsolicited messages sent by the phone to signal us that some of its visual indicators on its screen has changed, based on CIND CMER ETSI docs */ - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_noservice_string) == 0)) { - ERRORA("|%s| at_indicator_noservice_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - alarm_event(tech_pvt, ALARM_NETWORK_NO_SERVICE, "at_indicator_noservice_string"); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nosignal_string) == 0)) { - ERRORA("|%s| at_indicator_nosignal_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - alarm_event(tech_pvt, ALARM_NETWORK_NO_SIGNAL, "at_indicator_nosignal_string"); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_lowsignal_string) == 0)) { - WARNINGA("|%s| at_indicator_lowsignal_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - alarm_event(tech_pvt, ALARM_NETWORK_LOW_SIGNAL, "at_indicator_lowsignal_string"); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_lowbattchg_string) == 0)) { - WARNINGA("|%s| at_indicator_lowbattchg_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nobattchg_string) == 0)) { - ERRORA("|%s| at_indicator_nobattchg_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callactive_string) == 0)) { - DEBUGA_GSMOPEN("|%s| at_indicator_callactive_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nocallactive_string) == 0)) { - DEBUGA_GSMOPEN("|%s| at_indicator_nocallactive_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nocallsetup_string) == 0)) { - DEBUGA_GSMOPEN("|%s| at_indicator_nocallsetup_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callsetupincoming_string) == 0)) { - DEBUGA_GSMOPEN("|%s| at_indicator_callsetupincoming_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callsetupoutgoing_string) == 0)) { - DEBUGA_GSMOPEN("|%s| at_indicator_callsetupoutgoing_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callsetupremoteringing_string) - == 0)) { - DEBUGA_GSMOPEN("|%s| at_indicator_callsetupremoteringing_string\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - } - - } - - /* let's look for OK, ERROR and EXPECTED_STRING in the complete lines read so far, without re-looking at the lines that has been yet looked at */ - for (i = la_read; i < la_counter; i++) { - if (expected_string) { - if ((strncmp(tech_pvt->line_array.result[i], expected_string, strlen(expected_string)) - == 0)) { - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| got what EXPECTED\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - at_ack = AT_OK; - } - } else { - if ((strcmp(tech_pvt->line_array.result[i], "OK") == 0)) { - if (option_debug > 1) - DEBUGA_GSMOPEN("got OK\n", GSMOPEN_P_LOG); - at_ack = AT_OK; - } - } - if ((strcmp(tech_pvt->line_array.result[i], "ERROR") == 0)) { - if (option_debug > 1) - DEBUGA_GSMOPEN("got ERROR\n", GSMOPEN_P_LOG); - at_ack = AT_ERROR; - } - - /* if we are requesting IMEI, put the line into the imei buffer if the line is not "OK" or "ERROR" */ - if (tech_pvt->requesting_imei && at_ack == -1) { - if (strlen(tech_pvt->line_array.result[i])) { /* we are reading the IMEI */ - strncpy(tech_pvt->imei, tech_pvt->line_array.result[i], sizeof(tech_pvt->imei)); - } - } - - /* if we are requesting IMSI, put the line into the imsi buffer if the line is not "OK" or "ERROR" */ - if (tech_pvt->requesting_imsi && at_ack == -1) { - if (strlen(tech_pvt->line_array.result[i])) { /* we are reading the IMSI */ - strncpy(tech_pvt->imsi, tech_pvt->line_array.result[i], sizeof(tech_pvt->imsi)); - } - } - - /* if we are requesting device manufacturer, model or firmware version, - * put the line into the buffer if the line is not "OK" or "ERROR" */ - if (tech_pvt->requesting_device_mfg && at_ack == -1) { - if (strlen(tech_pvt->line_array.result[i])) { - strncpy(tech_pvt->device_mfg, tech_pvt->line_array.result[i], sizeof(tech_pvt->device_mfg)); - } - } - - if (tech_pvt->requesting_device_model && at_ack == -1) { - if (strlen(tech_pvt->line_array.result[i])) { - strncpy(tech_pvt->device_model, tech_pvt->line_array.result[i], sizeof(tech_pvt->device_model)); - } - } - - if (tech_pvt->requesting_device_firmware && at_ack == -1) { - if (strlen(tech_pvt->line_array.result[i])) { - strncpy(tech_pvt->device_firmware, tech_pvt->line_array.result[i], sizeof(tech_pvt->device_firmware)); - } - } - - - /* if we are reading an sms message from memory, put the line into the sms buffer if the line is not "OK" or "ERROR" */ - if (tech_pvt->reading_sms_msg > 1 && at_ack == -1) { - int c; - char sms_body[16000]; - int err = 0; - memset(sms_body, '\0', sizeof(sms_body)); - - if (strncmp(tech_pvt->line_array.result[i], "+CMGR", 5) == 0) { /* we are reading the "header" of an SMS */ - char content[512]; - char content2[512]; - int inside_comma = 0; - int inside_quote = 0; - int which_field = 0; - int d = 0; - - DEBUGA_GSMOPEN("HERE\n", GSMOPEN_P_LOG); - - memset(content, '\0', sizeof(content)); - - for (c = 0; c < (int) strlen(tech_pvt->line_array.result[i]); c++) { - if (tech_pvt->line_array.result[i][c] == ',' && tech_pvt->line_array.result[i][c - 1] != '\\' && inside_quote == 0) { - if (inside_comma) { - inside_comma = 0; - DEBUGA_GSMOPEN("inside_comma=%d, inside_quote=%d, we're at=%s\n", GSMOPEN_P_LOG, inside_comma, inside_quote, - &tech_pvt->line_array.result[i][c]); - } else { - inside_comma = 1; - DEBUGA_GSMOPEN("inside_comma=%d, inside_quote=%d, we're at=%s\n", GSMOPEN_P_LOG, inside_comma, inside_quote, - &tech_pvt->line_array.result[i][c]); - } - } - if (tech_pvt->line_array.result[i][c] == '"' && tech_pvt->line_array.result[i][c - 1] != '\\') { - if (inside_quote) { - inside_quote = 0; - DEBUGA_GSMOPEN("END_CONTENT inside_comma=%d, inside_quote=%d, we're at=%s\n", GSMOPEN_P_LOG, inside_comma, inside_quote, - &tech_pvt->line_array.result[i][c]); - DEBUGA_GSMOPEN("%d content=%s\n", GSMOPEN_P_LOG, which_field, content); - - memset(content2, '\0', sizeof(content2)); - if (which_field == 1) { - err = ucs2_to_utf8(tech_pvt, content, content2, sizeof(content2)); - } else { - err = 0; - strncpy(content2, content, sizeof(content2)); - } - DEBUGA_GSMOPEN("%d content2=%s\n", GSMOPEN_P_LOG, which_field, content2); - DEBUGA_GSMOPEN("%d content=%s\n", GSMOPEN_P_LOG, which_field, content2); - - memset(content, '\0', sizeof(content)); - d = 0; - if (which_field == 1) { - strncpy(tech_pvt->sms_sender, content2, sizeof(tech_pvt->sms_sender)); - DEBUGA_GSMOPEN("%d content=%s\n", GSMOPEN_P_LOG, which_field, content2); - - } else if (which_field == 2) { - strncpy(tech_pvt->sms_date, content2, sizeof(tech_pvt->sms_date)); - DEBUGA_GSMOPEN("%d content=%s\n", GSMOPEN_P_LOG, which_field, content2); - } else if (which_field > 2) { - WARNINGA("WHY which_field is > 2 ? (which_field is %d)\n", GSMOPEN_P_LOG, which_field); - } - which_field++; - } else { - inside_quote = 1; - DEBUGA_GSMOPEN("START_CONTENT inside_comma=%d, inside_quote=%d, we're at=%s\n", GSMOPEN_P_LOG, inside_comma, inside_quote, - &tech_pvt->line_array.result[i][c]); - } - } - if (inside_quote && tech_pvt->line_array.result[i][c] != '"') { - - content[d] = tech_pvt->line_array.result[i][c]; - d++; - - } - - } - } //it was the +CMGR answer from the cellphone - else { - DEBUGA_GSMOPEN("body=%s\n", GSMOPEN_P_LOG, sms_body); - DEBUGA_GSMOPEN("tech_pvt->line_array.result[i]=%s\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->sms_pdu_not_supported) { - char content3[1000]; - strncpy(tech_pvt->sms_message, tech_pvt->line_array.result[i], sizeof(tech_pvt->sms_message)); - - - memset(content3, '\0', sizeof(content3)); - DEBUGA_GSMOPEN("sms_message=%s\n", GSMOPEN_P_LOG, tech_pvt->sms_message); - ucs2_to_utf8(tech_pvt, tech_pvt->sms_message, content3, sizeof(content3)); - DEBUGA_GSMOPEN("content3=%s\n", GSMOPEN_P_LOG, content3); - strncpy(tech_pvt->sms_body, content3, sizeof(tech_pvt->sms_body)); - if (tech_pvt->sms_cnmi_not_supported) { - sms_incoming(tech_pvt); - DEBUGA_GSMOPEN("2 content3=%s\n", GSMOPEN_P_LOG, content3); - } - } else { - - - try { - char content2[1000]; - SMSMessageRef sms; - - DEBUGA_GSMOPEN("about to decode\n", GSMOPEN_P_LOG); - try { - sms = SMSMessage::decode(tech_pvt->line_array.result[i]); // dataCodingScheme = 8 , text=ciao 123 belè новости לק ראת ﺎﻠﺠﻤﻋﺓ 人大 - } - catch(...) { - ERRORA("GsmException\n", GSMOPEN_P_LOG); - gsmopen_sleep(5000); - return -1; - } - - DEBUGA_GSMOPEN("after decode\n", GSMOPEN_P_LOG); - -#if 0 - char letsee[1024]; - memset(letsee, '\0', sizeof(letsee)); - - DEBUGA_GSMOPEN("about to letsee\n", GSMOPEN_P_LOG); - try { - sprintf(letsee, "|%s|\n", sms->toString().c_str()); - } - catch(...) { - ERRORA("GsmException\n", GSMOPEN_P_LOG); - sleep(5); - return -1; - } - DEBUGA_GSMOPEN("after letsee\n", GSMOPEN_P_LOG); - - DEBUGA_GSMOPEN("SMS=\n%s\n", GSMOPEN_P_LOG, letsee); -#endif //0 - memset(content2, '\0', sizeof(content2)); - if (sms->dataCodingScheme().getAlphabet() == DCS_DEFAULT_ALPHABET) { - iso_8859_1_to_utf8(tech_pvt, (char *) sms->userData().c_str(), content2, sizeof(content2)); - } else if (sms->dataCodingScheme().getAlphabet() == DCS_SIXTEEN_BIT_ALPHABET) { - ucs2_to_utf8(tech_pvt, (char *) bufToHex((unsigned char *) sms->userData().data(), sms->userData().length()).c_str(), - content2, sizeof(content2)); - } else { - ERRORA("dataCodingScheme not supported=%u\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); - - } - DEBUGA_GSMOPEN("dataCodingScheme=%u\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet()); - DEBUGA_GSMOPEN("dataCodingScheme=%s\n", GSMOPEN_P_LOG, sms->dataCodingScheme().toString().c_str()); - DEBUGA_GSMOPEN("address=%s\n", GSMOPEN_P_LOG, sms->address().toString().c_str()); - DEBUGA_GSMOPEN("serviceCentreAddress=%s\n", GSMOPEN_P_LOG, sms->serviceCentreAddress().toString().c_str()); - DEBUGA_GSMOPEN("serviceCentreTimestamp=%s\n", GSMOPEN_P_LOG, sms->serviceCentreTimestamp().toString().c_str()); - DEBUGA_GSMOPEN("UserDataHeader=%s\n", GSMOPEN_P_LOG, (char *)bufToHex((unsigned char *) - ((string) sms->userDataHeader()).data(), sms->userDataHeader().length()).c_str()); - DEBUGA_GSMOPEN("messageType=%d\n", GSMOPEN_P_LOG, sms->messageType()); - DEBUGA_GSMOPEN("userData= |||%s|||\n", GSMOPEN_P_LOG, content2); - - - memset(sms_body, '\0', sizeof(sms_body)); - strncpy(sms_body, content2, sizeof(sms_body)); - DEBUGA_GSMOPEN("body=%s\n", GSMOPEN_P_LOG, sms_body); - strncpy(tech_pvt->sms_body, sms_body, sizeof(tech_pvt->sms_body)); - strncpy(tech_pvt->sms_sender, sms->address().toString().c_str(), sizeof(tech_pvt->sms_sender)); - strncpy(tech_pvt->sms_date, sms->serviceCentreTimestamp().toString().c_str(), sizeof(tech_pvt->sms_date)); - strncpy(tech_pvt->sms_userdataheader, (char *) - bufToHex((unsigned char *)((string) sms->userDataHeader()).data(), sms->userDataHeader().length()).c_str(), - sizeof(tech_pvt->sms_userdataheader)); - strncpy(tech_pvt->sms_datacodingscheme, sms->dataCodingScheme().toString().c_str(), sizeof(tech_pvt->sms_datacodingscheme)); - strncpy(tech_pvt->sms_servicecentreaddress, sms->serviceCentreAddress().toString().c_str(), - sizeof(tech_pvt->sms_servicecentreaddress)); - tech_pvt->sms_messagetype = sms->messageType(); - - } - catch(...) { - ERRORA("GsmException\n", GSMOPEN_P_LOG); - gsmopen_sleep(5000); - return -1; - } - - - - - - } - - } //it was the UCS2 from cellphone - - } //we were reading the SMS - - } - - la_read = la_counter; - - if (look_for_ack && at_ack > -1) - break; - - if (la_counter == AT_MESG_MAX_LINES) { - ERRORA("Too many lines in result (>%d). la_counter=%d. tech_pvt->reading_sms_msg=%d. Stop accumulating lines.\n", GSMOPEN_P_LOG, - AT_MESG_MAX_LINES, la_counter, tech_pvt->reading_sms_msg); - WARNINGA("read was %d bytes, tmp_answer3= --|%s|--\n", GSMOPEN_P_LOG, read_count, tmp_answer3); - at_ack = AT_ERROR; - break; - } - - } - - UNLOCKA(tech_pvt->controldev_lock); - POPPA_UNLOCKA(tech_pvt->controldev_lock); - if (select_err == -1) { - ERRORA("select returned -1 on %s, setting controldev_dead, error was: %s\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name, strerror(errno)); - tech_pvt->controldev_dead = 1; - - tech_pvt->running = 0; - alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "select returned -1 on interface, setting controldev_dead"); - tech_pvt->active = 0; - tech_pvt->name[0] = '\0'; - if (tech_pvt->owner) - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - switch_sleep(1000000); - return -1; - } - - if (tech_pvt->phone_callflow == CALLFLOW_CALL_INCOMING && tech_pvt->call_incoming_time.tv_sec) { //after three sec of CALLFLOW_CALL_INCOMING, we assume the phone is incapable of notifying RING (eg: motorola c350), so we try to answer - char list_command[64]; - struct timeval call_incoming_timeout; - gettimeofday(&call_incoming_timeout, NULL); - call_incoming_timeout.tv_sec -= 3; - DEBUGA_GSMOPEN - ("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n", - GSMOPEN_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec); - if (call_incoming_timeout.tv_sec > tech_pvt->call_incoming_time.tv_sec) { - - tech_pvt->call_incoming_time.tv_sec = 0; - tech_pvt->call_incoming_time.tv_usec = 0; - DEBUGA_GSMOPEN - ("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n", - GSMOPEN_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec); - int res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CPBS=RC"); - if (res) { - ERRORA("AT+CPBS=RC (select memory of received calls) was not answered by the phone\n", GSMOPEN_P_LOG); - } - tech_pvt->phonebook_querying = 1; - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CPBR=?"); - if (res) { - ERRORA("AT+CPBS=RC (select memory of received calls) was not answered by the phone\n", GSMOPEN_P_LOG); - } - tech_pvt->phonebook_querying = 0; - sprintf(list_command, "AT+CPBR=%d,%d", tech_pvt->phonebook_first_entry, tech_pvt->phonebook_last_entry); - tech_pvt->phonebook_listing_received_calls = 1; - res = gsmopen_serial_write_AT_expect_longtime(tech_pvt, list_command, "OK"); - if (res) { - WARNINGA("AT+CPBR=%d,%d failed, continue\n", GSMOPEN_P_LOG, tech_pvt->phonebook_first_entry, tech_pvt->phonebook_last_entry); - } - tech_pvt->phonebook_listing_received_calls = 0; - } - } - - if (tech_pvt->phone_callflow == CALLFLOW_INCOMING_RING) { - struct timeval call_incoming_timeout; - gettimeofday(&call_incoming_timeout, NULL); - call_incoming_timeout.tv_sec -= 10; - // DEBUGA_GSMOPEN ("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n", GSMOPEN_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec); - if (call_incoming_timeout.tv_sec > tech_pvt->ringtime.tv_sec) { - ERRORA("Ringing stopped and I have not answered. Why?\n", GSMOPEN_P_LOG); - DEBUGA_GSMOPEN - ("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n", - GSMOPEN_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec); - if (tech_pvt->owner) { - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - } - } - } - tech_pvt->line_array.elemcount = la_counter; - //NOTICA (" OUTSIDE this gsmopen_serial_device %s \n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); - if (look_for_ack) - return at_ack; - else - return 0; -} - -int gsmopen_serial_write_AT(private_t *tech_pvt, const char *data) -{ - int howmany; - int i; - int res; - int count; - char *Data = (char *) data; - - if (!tech_pvt) - return -1; - - howmany = strlen(Data); - - for (i = 0; i < howmany; i++) { - res = tech_pvt->serialPort_serial_control->Write(&Data[i], 1); - - if (res != 1) { - DEBUGA_GSMOPEN("Error sending (%.1s): %d (%s)\n", GSMOPEN_P_LOG, &Data[i], res, strerror(errno)); - gsmopen_sleep(100000); - for (count = 0; count < 10; count++) { - res = tech_pvt->serialPort_serial_control->Write(&Data[i], 1); - if (res == 1) { - DEBUGA_GSMOPEN("Successfully RE-sent (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &Data[i], count, res, strerror(errno)); - break; - } else - DEBUGA_GSMOPEN("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &Data[i], count, res, strerror(errno)); - gsmopen_sleep(100000); - - } - if (res != 1) { - ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &Data[i], count, res, strerror(errno)); - - - - ERRORA - ("wrote -1 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n", - GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->controldev_dead = 1; - ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->running = 0; - alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); - tech_pvt->active = 0; - tech_pvt->name[0] = '\0'; - - UNLOCKA(tech_pvt->controldev_lock); - if (tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - switch_sleep(1000000); - - - - - return -1; - } - } - if (option_debug > 1) - DEBUGA_GSMOPEN("sent data... (%.1s)\n", GSMOPEN_P_LOG, &Data[i]); - gsmopen_sleep(1000); /* release the cpu */ - } - - res = tech_pvt->serialPort_serial_control->Write((char *) "\r", 1); - - if (res != 1) { - DEBUGA_GSMOPEN("Error sending (carriage return): %d (%s)\n", GSMOPEN_P_LOG, res, strerror(errno)); - gsmopen_sleep(100000); - for (count = 0; count < 10; count++) { - res = tech_pvt->serialPort_serial_control->Write((char *) "\r", 1); - - if (res == 1) { - DEBUGA_GSMOPEN("Successfully RE-sent carriage return: %d %d (%s)\n", GSMOPEN_P_LOG, count, res, strerror(errno)); - break; - } else - DEBUGA_GSMOPEN("Error RE-sending (carriage return): %d %d (%s)\n", GSMOPEN_P_LOG, count, res, strerror(errno)); - gsmopen_sleep(100000); - - } - if (res != 1) { - ERRORA("Error RE-sending (carriage return): %d %d (%s)\n", GSMOPEN_P_LOG, count, res, strerror(errno)); - - ERRORA - ("wrote -1 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n", - GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->controldev_dead = 1; - ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->running = 0; - alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); - tech_pvt->active = 0; - tech_pvt->name[0] = '\0'; - - UNLOCKA(tech_pvt->controldev_lock); - if (tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - switch_sleep(1000000); - - - return -1; - } - } - if (option_debug > 1) - DEBUGA_GSMOPEN("sent (carriage return)\n", GSMOPEN_P_LOG); - gsmopen_sleep(1000); /* release the cpu */ - - return howmany; -} - -int gsmopen_serial_write_AT_nocr(private_t *tech_pvt, const char *data) -{ - int howmany; - int i; - int res; - int count; - char *Data = (char *) data; - - if (!tech_pvt) - return -1; - - howmany = strlen(Data); - - for (i = 0; i < howmany; i++) { - res = tech_pvt->serialPort_serial_control->Write(&Data[i], 1); - - if (res != 1) { - DEBUGA_GSMOPEN("Error sending (%.1s): %d (%s)\n", GSMOPEN_P_LOG, &Data[i], res, strerror(errno)); - gsmopen_sleep(100000); - for (count = 0; count < 10; count++) { - res = tech_pvt->serialPort_serial_control->Write(&Data[i], 1); - if (res == 1) - break; - else - DEBUGA_GSMOPEN("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &Data[i], count, res, strerror(errno)); - gsmopen_sleep(100000); - - } - if (res != 1) { - ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", GSMOPEN_P_LOG, &Data[i], count, res, strerror(errno)); - - ERRORA - ("wrote -1 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n", - GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->controldev_dead = 1; - ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->running = 0; - alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); - tech_pvt->active = 0; - tech_pvt->name[0] = '\0'; - - UNLOCKA(tech_pvt->controldev_lock); - if (tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - switch_sleep(1000000); - - - return -1; - } - } - if (option_debug > 1) - DEBUGA_GSMOPEN("sent data... (%.1s)\n", GSMOPEN_P_LOG, &Data[i]); - gsmopen_sleep(1000); /* release the cpu */ - } - - gsmopen_sleep(1000); /* release the cpu */ - - return howmany; -} - -int gsmopen_serial_write_AT_noack(private_t *tech_pvt, const char *data) -{ - - if (option_debug > 1) - DEBUGA_GSMOPEN("gsmopen_serial_write_AT_noack: %s\n", GSMOPEN_P_LOG, data); - - PUSHA_UNLOCKA(tech_pvt->controldev_lock); - LOKKA(tech_pvt->controldev_lock); - if (gsmopen_serial_write_AT(tech_pvt, data) != (int) strlen(data)) { - - ERRORA("Error sending data... (%s)\n", GSMOPEN_P_LOG, strerror(errno)); - UNLOCKA(tech_pvt->controldev_lock); - - ERRORA - ("wrote -1 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n", - GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->controldev_dead = 1; - ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->running = 0; - alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); - tech_pvt->active = 0; - tech_pvt->name[0] = '\0'; - - UNLOCKA(tech_pvt->controldev_lock); - if (tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - switch_sleep(1000000); - - - return -1; - } - UNLOCKA(tech_pvt->controldev_lock); - POPPA_UNLOCKA(tech_pvt->controldev_lock); - - return 0; -} - -int gsmopen_serial_write_AT_ack(private_t *tech_pvt, const char *data) -{ - int at_result = AT_ERROR; - - if (!tech_pvt) - return -1; - - PUSHA_UNLOCKA(tech_pvt->controldev_lock); - LOKKA(tech_pvt->controldev_lock); - if (option_debug > 1) - DEBUGA_GSMOPEN("sending: %s\n", GSMOPEN_P_LOG, data); - if (gsmopen_serial_write_AT(tech_pvt, data) != (int) strlen(data)) { - ERRORA("Error sending data... (%s) \n", GSMOPEN_P_LOG, strerror(errno)); - UNLOCKA(tech_pvt->controldev_lock); - - ERRORA - ("wrote -1 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, and if it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, powered down or battery exhausted\n", - GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->controldev_dead = 1; - ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->running = 0; - alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); - tech_pvt->active = 0; - tech_pvt->name[0] = '\0'; - - UNLOCKA(tech_pvt->controldev_lock); - if (tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - switch_sleep(1000000); - - - return -1; - } - at_result = gsmopen_serial_read_AT(tech_pvt, 1, 100000, 0, NULL, 1); // 1/10th sec timeout - UNLOCKA(tech_pvt->controldev_lock); - POPPA_UNLOCKA(tech_pvt->controldev_lock); - - return at_result; - -} - -int gsmopen_serial_write_AT_ack_nocr_longtime(private_t *tech_pvt, const char *data) -{ - int at_result = AT_ERROR; - - if (!tech_pvt) - return -1; - - PUSHA_UNLOCKA(tech_pvt->controldev_lock); - LOKKA(tech_pvt->controldev_lock); - if (option_debug > 1) - DEBUGA_GSMOPEN("sending: %s\n", GSMOPEN_P_LOG, data); - if (gsmopen_serial_write_AT_nocr(tech_pvt, data) != (int) strlen(data)) { - ERRORA("Error sending data... (%s) \n", GSMOPEN_P_LOG, strerror(errno)); - UNLOCKA(tech_pvt->controldev_lock); - - ERRORA - ("wrote -1 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, and if it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, powered down or battery exhausted\n", - GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->controldev_dead = 1; - ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->running = 0; - alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); - tech_pvt->active = 0; - tech_pvt->name[0] = '\0'; - - UNLOCKA(tech_pvt->controldev_lock); - if (tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - switch_sleep(1000000); - - - return -1; - } - - at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, 20, NULL, 1); // 20.5 sec timeout - UNLOCKA(tech_pvt->controldev_lock); - POPPA_UNLOCKA(tech_pvt->controldev_lock); - - return at_result; - -} - -int gsmopen_serial_write_AT_expect1(private_t *tech_pvt, const char *data, const char *expected_string, int expect_crlf, int seconds) -{ - int at_result = AT_ERROR; - - if (!tech_pvt) - return -1; - - PUSHA_UNLOCKA(tech_pvt->controldev_lock); - LOKKA(tech_pvt->controldev_lock); - if (option_debug > 1) - DEBUGA_GSMOPEN("sending: %s, expecting: %s\n", GSMOPEN_P_LOG, data, expected_string); - if (gsmopen_serial_write_AT(tech_pvt, data) != (int) strlen(data)) { - ERRORA("Error sending data... (%s) \n", GSMOPEN_P_LOG, strerror(errno)); - UNLOCKA(tech_pvt->controldev_lock); - - ERRORA - ("wrote -1 bytes!!! Nenormalno! Marking this gsmopen_serial_device %s as dead, and if it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, powered down or battery exhausted\n", - GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->controldev_dead = 1; - ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->running = 0; - alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); - tech_pvt->active = 0; - tech_pvt->name[0] = '\0'; - - UNLOCKA(tech_pvt->controldev_lock); - if (tech_pvt->owner) { - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - } - switch_sleep(1000000); - - - return -1; - } - - at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, seconds, expected_string, expect_crlf); // minimum half a sec timeout - UNLOCKA(tech_pvt->controldev_lock); - POPPA_UNLOCKA(tech_pvt->controldev_lock); - - return at_result; - -} - -int gsmopen_serial_AT_expect(private_t *tech_pvt, const char *expected_string, int expect_crlf, int seconds) -{ - int at_result = AT_ERROR; - - if (!tech_pvt) - return -1; - - - PUSHA_UNLOCKA(tech_pvt->controldev_lock); - LOKKA(tech_pvt->controldev_lock); - if (option_debug > 1) - DEBUGA_GSMOPEN("expecting: %s\n", GSMOPEN_P_LOG, expected_string); - - at_result = gsmopen_serial_read_AT(tech_pvt, 1, 100000, seconds, expected_string, expect_crlf); // minimum 1/10th sec timeout - UNLOCKA(tech_pvt->controldev_lock); - POPPA_UNLOCKA(tech_pvt->controldev_lock); - - return at_result; - -} - -int gsmopen_serial_answer(private_t *tech_pvt) -{ - if (tech_pvt->controldevprotocol == PROTOCOL_AT) - return gsmopen_serial_answer_AT(tech_pvt); -#ifdef GSMOPEN_FBUS2 - if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2) - return gsmopen_serial_answer_FBUS2(tech_pvt); -#endif /* GSMOPEN_FBUS2 */ -#ifdef GSMOPEN_CVM - if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return gsmopen_serial_answer_CVM_BUSMAIL(tech_pvt); -#endif /* GSMOPEN_CVM */ - return -1; -} - -int gsmopen_serial_answer_AT(private_t *tech_pvt) -{ - int res; - - if (!tech_pvt) - return -1; - - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_answer, tech_pvt->at_answer_expect); - if (res) { - DEBUGA_GSMOPEN - ("at_answer command failed, command used: %s, expecting: %s, trying with AT+CKPD=\"S\"\n", - GSMOPEN_P_LOG, tech_pvt->at_answer, tech_pvt->at_answer_expect); - - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CKPD=\"S\""); - if (res) { - ERRORA("at_answer command failed, command used: 'AT+CKPD=\"S\"', giving up\n", GSMOPEN_P_LOG); - return -1; - } - } - //res = gsmopen_serial_write_AT_expect(tech_pvt, "AT^DDSETEX=2", tech_pvt->at_dial_expect); - DEBUGA_GSMOPEN("AT: call answered\n", GSMOPEN_P_LOG); - return 0; -} - -int gsmopen_serial_hangup(private_t *tech_pvt) -{ - if (tech_pvt->controldevprotocol == PROTOCOL_AT) - return gsmopen_serial_hangup_AT(tech_pvt); -#ifdef GSMOPEN_FBUS2 - if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2) - return gsmopen_serial_hangup_FBUS2(tech_pvt); -#endif /* GSMOPEN_FBUS2 */ -#ifdef GSMOPEN_CVM - if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return gsmopen_serial_hangup_CVM_BUSMAIL(tech_pvt); -#endif /* GSMOPEN_CVM */ - return -1; -} - -int gsmopen_serial_hangup_AT(private_t *tech_pvt) -{ - int res; - - if (!tech_pvt) - return -1; - - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { - res = gsmopen_serial_write_AT_expect(tech_pvt, tech_pvt->at_hangup, tech_pvt->at_hangup_expect); - if (res) { - DEBUGA_GSMOPEN("at_hangup command failed, command used: %s, trying to use AT+CKPD=\"EEE\"\n", GSMOPEN_P_LOG, tech_pvt->at_hangup); - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CKPD=\"EEE\""); - if (res) { - ERRORA("at_hangup command failed, command used: 'AT+CKPD=\"EEE\"'\n", GSMOPEN_P_LOG); - return -1; - } - - } - - res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CHUP"); - if (res) { - DEBUGA_GSMOPEN("at_hangup command timeout, command used: 'AT+CHUP'\n", GSMOPEN_P_LOG); - } - - } - tech_pvt->interface_state = GSMOPEN_STATE_DOWN; - tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; - return 0; -} - -int gsmopen_serial_call(private_t *tech_pvt, char *dstr) -{ - if (tech_pvt->controldevprotocol == PROTOCOL_AT) - return gsmopen_serial_call_AT(tech_pvt, dstr); -#ifdef GSMOPEN_FBUS2 - if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2) - return gsmopen_serial_call_FBUS2(tech_pvt, dstr); -#endif /* GSMOPEN_FBUS2 */ - if (tech_pvt->controldevprotocol == PROTOCOL_NO_SERIAL) - return 0; -#ifdef GSMOPEN_CVM - if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL) - return gsmopen_serial_call_CVM_BUSMAIL(tech_pvt, dstr); -#endif /* GSMOPEN_CVM */ - return -1; -} - -int gsmopen_serial_call_AT(private_t *tech_pvt, char *dstr) -{ - int res; - char at_command[256]; - - if (option_debug) - DEBUGA_PBX("Dialing %s\n", GSMOPEN_P_LOG, dstr); - memset(at_command, 0, sizeof(at_command)); - tech_pvt->phone_callflow = CALLFLOW_CALL_DIALING; - tech_pvt->interface_state = GSMOPEN_STATE_DIALING; - sprintf(at_command, "%s%s%s", tech_pvt->at_dial_pre_number, dstr, tech_pvt->at_dial_post_number); - DEBUGA_PBX("Dialstring %s\n", GSMOPEN_P_LOG, at_command); - res = gsmopen_serial_write_AT_expect(tech_pvt, at_command, tech_pvt->at_dial_expect); - if (res) { - ERRORA("dial command failed, dial string was: %s\n", GSMOPEN_P_LOG, at_command); - return -1; - } - //res = gsmopen_serial_write_AT_expect(tech_pvt, "AT^DDSETEX=2", tech_pvt->at_dial_expect); - - return 0; -} - -int ucs2_to_utf8(private_t *tech_pvt, char *ucs2_in, char *utf8_out, size_t outbytesleft) -{ - char converted[16000]; - iconv_t iconv_format; - int iconv_res; - char *outbuf; - char *inbuf; - size_t inbytesleft; - int c; - char stringa[5]; - double hexnum; - int i = 0; - - memset(converted, '\0', sizeof(converted)); - - DEBUGA_GSMOPEN("ucs2_in=|%s|, utf8_out=|%s|\n", GSMOPEN_P_LOG, ucs2_in, utf8_out); - for (c = 0; c < (int) strlen(ucs2_in); c++) { - sprintf(stringa, "0x%c%c", ucs2_in[c], ucs2_in[c + 1]); - c++; - hexnum = strtod(stringa, NULL); - converted[i] = (char) hexnum; - i++; - } - - outbuf = utf8_out; - inbuf = converted; - - iconv_format = iconv_open("UTF8", "UCS-2BE"); - if (iconv_format == (iconv_t) -1) { - ERRORA("error: %s\n", GSMOPEN_P_LOG, strerror(errno)); - return -1; - } - - inbytesleft = i; - DEBUGA_GSMOPEN("1 ciao in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n", - GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, converted, utf8_out); - -#ifdef WIN32 - iconv_res = iconv(iconv_format, (const char **) &inbuf, &inbytesleft, &outbuf, &outbytesleft); -#else // WIN32 - iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft); -#endif // WIN32 - if (iconv_res == (size_t) -1) { - DEBUGA_GSMOPEN("2 ciao in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n", - GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, converted, utf8_out); - DEBUGA_GSMOPEN("3 error: %s %d\n", GSMOPEN_P_LOG, strerror(errno), errno); - iconv_close(iconv_format); - return -1; - } - DEBUGA_GSMOPEN - ("iconv_res=%d, in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n", - GSMOPEN_P_LOG, iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, converted, utf8_out); - iconv_close(iconv_format); - - return 0; -} - -int utf8_to_iso_8859_1(private_t *tech_pvt, char *utf8_in, size_t inbytesleft, char *iso_8859_1_out, size_t outbytesleft) -{ - iconv_t iconv_format; - int iconv_res; - char *outbuf; - char *inbuf; - - outbuf = iso_8859_1_out; - inbuf = utf8_in; - - iconv_format = iconv_open("ISO_8859-1", "UTF8"); - if (iconv_format == (iconv_t) -1) { - ERRORA("error: %s\n", GSMOPEN_P_LOG, strerror(errno)); - return -1; - } - outbytesleft = strlen(utf8_in) * 2; - - DEBUGA_GSMOPEN("in=%s, inleft=%d, out=%s, outleft=%d, utf8_in=%s, iso_8859_1_out=%s\n", - GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_in, iso_8859_1_out); -#ifdef WIN32 - iconv_res = iconv(iconv_format, (const char **) &inbuf, &inbytesleft, &outbuf, &outbytesleft); -#else // WIN32 - iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft); -#endif // WIN32 - if (iconv_res == (size_t) -1) { - DEBUGA_GSMOPEN("cannot translate in iso_8859_1 error: %s (errno: %d)\n", GSMOPEN_P_LOG, strerror(errno), errno); - return -1; - } - DEBUGA_GSMOPEN - ("iconv_res=%d, in=%s, inleft=%d, out=%s, outleft=%d, utf8_in=%s, iso_8859_1_out=%s\n", - GSMOPEN_P_LOG, iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_in, iso_8859_1_out); - iconv_close(iconv_format); - return 0; -} - - -int iso_8859_1_to_utf8(private_t *tech_pvt, char *iso_8859_1_in, char *utf8_out, size_t outbytesleft) -{ - iconv_t iconv_format; - int iconv_res; - char *outbuf; - char *inbuf; - size_t inbytesleft; - - DEBUGA_GSMOPEN("iso_8859_1_in=%s\n", GSMOPEN_P_LOG, iso_8859_1_in); - - outbuf = utf8_out; - inbuf = iso_8859_1_in; - - iconv_format = iconv_open("UTF8", "ISO_8859-1"); - if (iconv_format == (iconv_t) -1) { - ERRORA("error: %s\n", GSMOPEN_P_LOG, strerror(errno)); - return -1; - } - - inbytesleft = strlen(iso_8859_1_in) * 2; -#ifdef WIN32 - iconv_res = iconv(iconv_format, (const char **) &inbuf, &inbytesleft, &outbuf, &outbytesleft); -#else // WIN32 - iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft); -#endif // WIN32 - if (iconv_res == (size_t) -1) { - DEBUGA_GSMOPEN("ciao in=%s, inleft=%d, out=%s, outleft=%d, utf8_out=%s\n", - GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_out); - DEBUGA_GSMOPEN("error: %s %d\n", GSMOPEN_P_LOG, strerror(errno), errno); - return -1; - } - DEBUGA_GSMOPEN - (" strlen(iso_8859_1_in)=%d, iconv_res=%d, inbuf=%s, inleft=%d, out=%s, outleft=%d, utf8_out=%s\n", - GSMOPEN_P_LOG, (int) strlen(iso_8859_1_in), iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_out); - - iconv_close(iconv_format); - - return 0; -} - -int utf8_to_ucs2(private_t *tech_pvt, char *utf8_in, size_t inbytesleft, char *ucs2_out, size_t outbytesleft) -{ - iconv_t iconv_format; - int iconv_res; - char *outbuf; - char *inbuf; - char converted[16000]; - int i; - char stringa[16]; - char stringa2[16]; - - memset(converted, '\0', sizeof(converted)); - - outbuf = converted; - inbuf = utf8_in; - - iconv_format = iconv_open("UCS-2BE", "UTF8"); - if (iconv_format == (iconv_t) -1) { - ERRORA("error: %s\n", GSMOPEN_P_LOG, strerror(errno)); - return -1; - } - outbytesleft = 16000; - - DEBUGA_GSMOPEN("in=%s, inleft=%d, out=%s, outleft=%d, utf8_in=%s, converted=%s\n", - GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_in, converted); -#ifdef WIN32 - iconv_res = iconv(iconv_format, (const char **) &inbuf, &inbytesleft, &outbuf, &outbytesleft); -#else // WIN32 - iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft); -#endif // WIN32 - if (iconv_res == (size_t) -1) { - ERRORA("error: %s %d\n", GSMOPEN_P_LOG, strerror(errno), errno); - return -1; - } - DEBUGA_GSMOPEN - ("iconv_res=%d, in=%s, inleft=%d, out=%s, outleft=%d, utf8_in=%s, converted=%s\n", - GSMOPEN_P_LOG, iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_in, converted); - iconv_close(iconv_format); - - for (i = 0; i < 16000 - (int) outbytesleft; i++) { - memset(stringa, '\0', sizeof(stringa)); - memset(stringa2, '\0', sizeof(stringa2)); - sprintf(stringa, "%02X", converted[i]); - DEBUGA_GSMOPEN("character is |%02X|\n", GSMOPEN_P_LOG, converted[i]); - stringa2[0] = stringa[strlen(stringa) - 2]; - stringa2[1] = stringa[strlen(stringa) - 1]; - strncat(ucs2_out, stringa2, ((outbytesleft - strlen(ucs2_out)) - 1)); //add the received line to the buffer - DEBUGA_GSMOPEN("stringa=%s, stringa2=%s, ucs2_out=%s\n", GSMOPEN_P_LOG, stringa, stringa2, ucs2_out); - } - return 0; -} - -/*! \brief Answer incoming call, - * Part of PBX interface */ -int gsmopen_answer(private_t *tech_pvt) -{ - int res; - - if (option_debug) { - DEBUGA_PBX("ENTERING FUNC\n", GSMOPEN_P_LOG); - } - /* do something to actually answer the call, if needed (eg. pick up the phone) */ - if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL) { - if (gsmopen_serial_answer(tech_pvt)) { - ERRORA("gsmopen_answer FAILED\n", GSMOPEN_P_LOG); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", GSMOPEN_P_LOG); - } - return -1; - } - } - tech_pvt->interface_state = GSMOPEN_STATE_UP; - tech_pvt->phone_callflow = CALLFLOW_CALL_ACTIVE; - - while (tech_pvt->interface_state == GSMOPEN_STATE_RING) { - gsmopen_sleep(10000); //10msec - } - if (tech_pvt->interface_state != GSMOPEN_STATE_UP) { - ERRORA("call answering failed\n", GSMOPEN_P_LOG); - res = -1; - } else { - if (option_debug) - DEBUGA_PBX("call answered\n", GSMOPEN_P_LOG); - res = 0; - - if (tech_pvt->owner) { - DEBUGA_PBX("going to send GSMOPEN_STATE_UP\n", GSMOPEN_P_LOG); - ast_setstate(tech_pvt->owner, GSMOPEN_STATE_UP); - DEBUGA_PBX("just sent GSMOPEN_STATE_UP\n", GSMOPEN_P_LOG); - } - } - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", GSMOPEN_P_LOG); - } - return res; -} - -int gsmopen_ring(private_t *tech_pvt) -{ - int res = 0; - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - session = switch_core_session_locate(tech_pvt->session_uuid_str); - if (session) { - switch_core_session_rwunlock(session); - return 0; - } - - new_inbound_channel(tech_pvt); - - gsmopen_sleep(10000); - - session = switch_core_session_locate(tech_pvt->session_uuid_str); - if (session) { - channel = switch_core_session_get_channel(session); - - switch_core_session_queue_indication(session, SWITCH_MESSAGE_INDICATE_RINGING); - if (channel) { - switch_channel_mark_ring_ready(channel); - DEBUGA_GSMOPEN("switch_channel_mark_ring_ready(channel);\n", GSMOPEN_P_LOG); - } else { - ERRORA("no channel\n", GSMOPEN_P_LOG); - } - switch_core_session_rwunlock(session); - } else { - ERRORA("no session\n", GSMOPEN_P_LOG); - - } - - return res; -} - -/*! \brief Hangup gsmopen call - * Part of PBX interface, called from ast_hangup */ - -int gsmopen_hangup(private_t *tech_pvt) -{ - - /* if there is not gsmopen pvt why we are here ? */ - if (!tech_pvt) { - ERRORA("Asked to hangup channel not connected\n", GSMOPEN_P_LOG); - return 0; - } - - DEBUGA_GSMOPEN("ENTERING FUNC\n", GSMOPEN_P_LOG); - - if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL) { - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { - /* actually hangup through the serial port */ - if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL) { - int res; - res = gsmopen_serial_hangup(tech_pvt); - if (res) { - ERRORA("gsmopen_serial_hangup error: %d\n", GSMOPEN_P_LOG, res); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", GSMOPEN_P_LOG); - } - return -1; - } - } - - while (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { - gsmopen_sleep(10000); //10msec - } - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN) { - ERRORA("call hangup failed\n", GSMOPEN_P_LOG); - return -1; - } else { - DEBUGA_GSMOPEN("call hungup\n", GSMOPEN_P_LOG); - } - } - } else { - tech_pvt->interface_state = GSMOPEN_STATE_DOWN; - tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; - } - - switch_set_flag(tech_pvt, TFLAG_HANGUP); - if (option_debug) { - DEBUGA_PBX("EXITING FUNC\n", GSMOPEN_P_LOG); - } - return 0; -} - -int gsmopen_call(private_t *tech_pvt, char *rdest, int timeout) -{ - - int result; - - DEBUGA_GSMOPEN("Calling GSM, rdest is: %s\n", GSMOPEN_P_LOG, rdest); - - result=gsmopen_serial_call(tech_pvt, rdest); - return result; -} - -int gsmopen_senddigit(private_t *tech_pvt, char digit) -{ - - DEBUGA_GSMOPEN("DIGIT received: %c\n", GSMOPEN_P_LOG, digit); - if (tech_pvt->controldevprotocol == PROTOCOL_AT && tech_pvt->at_send_dtmf[0]) { - int res = 0; - char at_command[256]; - - memset(at_command, '\0', 256); - sprintf(at_command, "%s=1,%c", tech_pvt->at_send_dtmf, digit); - res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); - if (res) { - DEBUGA_GSMOPEN("XXX answer (OK) takes long to come, goes into timeout. command used: '%s=1,%c'\n", GSMOPEN_P_LOG, tech_pvt->at_send_dtmf, - digit); - } - } - - return 0; -} - -int gsmopen_sendsms(private_t *tech_pvt, char *dest, char *text) -{ - int failed = 0; - int err = 0; - char mesg_test[1024]; - - DEBUGA_GSMOPEN("GSMopenSendsms: dest=%s text=%s\n", GSMOPEN_P_LOG, dest, text); - DEBUGA_GSMOPEN("START\n", GSMOPEN_P_LOG); - /* we can use gsmopen_request to get the channel, but gsmopen_request would look for onowned channels, and probably we can send SMSs while a call is ongoing - * - */ - - if (tech_pvt->controldevprotocol != PROTOCOL_AT) { - ERRORA(", GSMOPEN_P_LOGGSMopenSendsms supports only AT command cellphones at the moment :-( !\n", GSMOPEN_P_LOG); - return RESULT_FAILURE; - } - - if (tech_pvt->controldevprotocol == PROTOCOL_AT) { - char smscommand[16000]; - memset(smscommand, '\0', sizeof(smscommand)); - char pdu2[16000]; - memset(pdu2, '\0', sizeof(pdu2)); - int pdulenght = 0; - string pdu; - - PUSHA_UNLOCKA(&tech_pvt->controldev_lock); - LOKKA(tech_pvt->controldev_lock); - - if (tech_pvt->no_ucs2 || tech_pvt->sms_pdu_not_supported == 0) { - try { - int bad_8859 = 0; - - memset(mesg_test, '\0', sizeof(mesg_test)); - sprintf(mesg_test, ":) ciao belè новости לק ראת ﺎﻠﺠﻤﻋﺓ 人大aèéàòçù"); //let's test the beauty of utf8 - //sprintf(mesg_test,":) ciao belè èéàòìù"); - //text=mesg_test; - - bad_8859 = utf8_to_iso_8859_1(tech_pvt, text, strlen(text), smscommand, sizeof(smscommand)); - if (!bad_8859) { - err = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=0"); - if (err) { - ERRORA("AT+CMGF=0 (set message sending to PDU (as opposed to TEXT) didn't get OK from the phone\n", GSMOPEN_P_LOG); - } - SMSMessageRef smsMessage; - smsMessage = new SMSSubmitMessage(smscommand, dest); - pdu = smsMessage->encode(); - strncpy(pdu2, pdu.c_str(), sizeof(pdu2) - 1); - memset(smscommand, '\0', sizeof(smscommand)); - pdulenght = pdu.length() / 2 - 1; - sprintf(smscommand, "AT+CMGS=%d", pdulenght); - } else { - int ok; - - UNLOCKA(tech_pvt->controldev_lock); - POPPA_UNLOCKA(&tech_pvt->controldev_lock); - - tech_pvt->no_ucs2 = 0; - tech_pvt->sms_pdu_not_supported = 1; - - ok = gsmopen_sendsms(tech_pvt, dest, text); - - tech_pvt->no_ucs2 = 1; - tech_pvt->sms_pdu_not_supported = 0; - - err = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=0"); - if (err) { - ERRORA("AT+CMGF=0 (set message sending to PDU (as opposed to TEXT) didn't get OK from the phone\n", GSMOPEN_P_LOG); - } - return ok; - } - - } - catch(GsmException & ge) { - ERRORA("GsmException= |||%s|||\n", GSMOPEN_P_LOG, ge.what()); - } - - - - } else { - char dest2[1048]; - - err = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=1"); - if (err) { - ERRORA("AT+CMGF=1 (set message sending to TEXT (as opposed to PDU) didn't get OK from the phone\n", GSMOPEN_P_LOG); - } - - memset(dest2, '\0', sizeof(dest2)); - utf8_to_ucs2(tech_pvt, dest, strlen(dest), dest2, sizeof(dest2)); - sprintf(smscommand, "AT+CMGS=\"%s\"", dest2); - } - err = gsmopen_serial_write_AT_noack(tech_pvt, smscommand); - if (err) { - ERRORA("Error sending SMS\n", GSMOPEN_P_LOG); - failed = 1; - goto uscita; - } - err = gsmopen_serial_AT_expect(tech_pvt, "> ", 0, 1); // wait 1.1s for the prompt, no crlf - if (err) { - DEBUGA_GSMOPEN - ("Error or timeout getting prompt '> ' for sending sms directly to the remote party. BTW, seems that we cannot do that with Motorola c350, so we'll write to cellphone memory, then send from memory\n", - GSMOPEN_P_LOG); - - err = gsmopen_serial_write_AT_ack(tech_pvt, "ATE1"); //motorola (at least c350) do not echo the '>' prompt when in ATE0... go figure!!!! - if (err) { - ERRORA("Error activating echo from modem\n", GSMOPEN_P_LOG); - } - tech_pvt->at_cmgw[0] = '\0'; - sprintf(smscommand, "AT+CMGW=\"%s\"", dest); //TODO: support phones that only accept pdu mode - err = gsmopen_serial_write_AT_noack(tech_pvt, smscommand); - if (err) { - ERRORA("Error writing SMS destination to the cellphone memory\n", GSMOPEN_P_LOG); - failed = 1; - goto uscita; - } - err = gsmopen_serial_AT_expect(tech_pvt, "> ", 0, 1); // wait 1.5s for the prompt, no crlf - if (err) { - ERRORA("Error or timeout getting prompt '> ' for writing sms text in cellphone memory\n", GSMOPEN_P_LOG); - failed = 1; - goto uscita; - } - } - - if (tech_pvt->no_ucs2 || tech_pvt->sms_pdu_not_supported == 0) { - memset(smscommand, '\0', sizeof(smscommand)); - sprintf(smscommand, "%s", pdu2); - } else { - memset(mesg_test, '\0', sizeof(mesg_test)); - sprintf(mesg_test, ":) ciao belè новости לק ראת ﺎﻠﺠﻤﻋﺓ 人大aèéàòçù"); //let's test the beauty of utf8 - //text=mesg_test; - - memset(smscommand, '\0', sizeof(smscommand)); - if (tech_pvt->no_ucs2) { - sprintf(smscommand, "%s", text); - } else { - utf8_to_ucs2(tech_pvt, text, strlen(text), smscommand, sizeof(smscommand)); - } - - } - smscommand[strlen(smscommand)] = 0x1A; - DEBUGA_GSMOPEN("smscommand len is: %d, text is:|||%s|||\n", GSMOPEN_P_LOG, (int) strlen(smscommand), smscommand); - - err = gsmopen_serial_write_AT_ack_nocr_longtime(tech_pvt, smscommand); - //TODO would be better to unlock controldev here - if (err) { - ERRORA("Error writing SMS text to the cellphone memory\n", GSMOPEN_P_LOG); - failed = 1; - goto uscita; - } - if (tech_pvt->at_cmgw[0]) { - sprintf(smscommand, "AT+CMSS=%s", tech_pvt->at_cmgw); - err = gsmopen_serial_write_AT_expect_longtime(tech_pvt, smscommand, "OK"); - if (err) { - ERRORA("Error sending SMS from the cellphone memory\n", GSMOPEN_P_LOG); - failed = 1; - goto uscita; - } - - err = gsmopen_serial_write_AT_ack(tech_pvt, "ATE0"); //motorola (at least c350) do not echo the '>' prompt when in ATE0... go figure!!!! - if (err) { - ERRORA("Error de-activating echo from modem\n", GSMOPEN_P_LOG); - } - } - uscita: - gsmopen_sleep(1000); - - if (tech_pvt->at_cmgw[0]) { - - /* let's see what we've sent, just for check TODO: Motorola isn't reliable! Motorola c350 tells that all was sent, but is not true! It just sends how much it fits into one SMS FIXME: need an algorithm to calculate how many ucs2 chars fits into an SMS. It make difference based, probably, on the GSM alphabet translation, or so */ - sprintf(smscommand, "AT+CMGR=%s", tech_pvt->at_cmgw); - err = gsmopen_serial_write_AT_ack(tech_pvt, smscommand); - if (err) { - ERRORA("Error reading SMS back from the cellphone memory\n", GSMOPEN_P_LOG); - } - - /* let's delete from cellphone memory what we've sent */ - sprintf(smscommand, "AT+CMGD=%s", tech_pvt->at_cmgw); - err = gsmopen_serial_write_AT_ack(tech_pvt, smscommand); - if (err) { - ERRORA("Error deleting SMS from the cellphone memory\n", GSMOPEN_P_LOG); - } - - tech_pvt->at_cmgw[0] = '\0'; - } - UNLOCKA(tech_pvt->controldev_lock); - POPPA_UNLOCKA(&tech_pvt->controldev_lock); - } - - DEBUGA_GSMOPEN("FINISH\n", GSMOPEN_P_LOG); - if (failed) - return -1; - else - return RESULT_SUCCESS; -} - -int gsmopen_ussd(private_t *tech_pvt, char *ussd, int waittime) -{ - int res = 0; - DEBUGA_GSMOPEN("gsmopen_ussd: %s\n", GSMOPEN_P_LOG, ussd); - if (tech_pvt->controldevprotocol == PROTOCOL_AT) { - char at_command[1024]; - - string ussd_enc = latin1ToGsm(ussd); - SMSEncoder e; - e.markSeptet(); - e.setString(ussd_enc); - string ussd_hex = e.getHexString(); - - memset(at_command, '\0', sizeof(at_command)); - tech_pvt->ussd_received = 0; - if (tech_pvt->ussd_request_encoding == USSD_ENCODING_PLAIN - ||tech_pvt->ussd_request_encoding == USSD_ENCODING_AUTO) { - snprintf(at_command, sizeof(at_command), "AT+CUSD=1,\"%s\",15", ussd_enc.c_str()); - res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); - if (res && tech_pvt->ussd_request_encoding == USSD_ENCODING_AUTO) { - DEBUGA_GSMOPEN("Plain request failed, trying HEX7 encoding...\n", GSMOPEN_P_LOG); - snprintf(at_command, sizeof(at_command), "AT+CUSD=1,\"%s\",15", ussd_hex.c_str()); - res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); - if (res == 0) { - DEBUGA_GSMOPEN("HEX 7-bit request encoding will be used from now on\n", GSMOPEN_P_LOG); - tech_pvt->ussd_request_encoding = USSD_ENCODING_HEX_7BIT; - } - } - } else if (tech_pvt->ussd_request_encoding == USSD_ENCODING_HEX_7BIT) { - snprintf(at_command, sizeof(at_command), "AT+CUSD=1,\"%s\",15", ussd_hex.c_str()); - res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); - } else if (tech_pvt->ussd_request_encoding == USSD_ENCODING_HEX_8BIT) { - string ussd_h8 = bufToHex((const unsigned char*)ussd_enc.c_str(), ussd_enc.length()); - snprintf(at_command, sizeof(at_command), "AT+CUSD=1,\"%s\",15", ussd_h8.c_str()); - res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); - } else if (tech_pvt->ussd_request_encoding == USSD_ENCODING_UCS2) { - char ussd_ucs2[1000]; - memset(ussd_ucs2, '\0', sizeof(ussd_ucs2)); - utf8_to_ucs2(tech_pvt, ussd, strlen(ussd), ussd_ucs2, sizeof(ussd_ucs2)); - snprintf(at_command, sizeof(at_command), "AT+CUSD=1,\"%s\",15", ussd_ucs2); - res = gsmopen_serial_write_AT_ack(tech_pvt, at_command); - } - if (res) { - return res; - } - if (waittime > 0) - res = gsmopen_serial_read_AT(tech_pvt, 1, 0, waittime, "+CUSD", 1); - } - return res; -} - -/************************************************/ - -/* LUIGI RIZZO's magic */ -/* boost support. BOOST_SCALE * 10 ^(BOOST_MAX/20) must - * be representable in 16 bits to avoid overflows. - */ -#define BOOST_SCALE (1<<9) -#define BOOST_MAX 40 /* slightly less than 7 bits */ - -/* - * store the boost factor - */ -void gsmopen_store_boost(char *s, double *boost) -{ - private_t *tech_pvt = NULL; - - if (sscanf(s, "%lf", boost) != 1) { - ERRORA("invalid boost <%s>\n", GSMOPEN_P_LOG, s); - return; - } - if (*boost < -BOOST_MAX) { - WARNINGA("boost %s too small, using %d\n", GSMOPEN_P_LOG, s, -BOOST_MAX); - *boost = -BOOST_MAX; - } else if (*boost > BOOST_MAX) { - WARNINGA("boost %s too large, using %d\n", GSMOPEN_P_LOG, s, BOOST_MAX); - *boost = BOOST_MAX; - } -#ifdef WIN32 - *boost = exp(log((double) 10) * *boost / 20) * BOOST_SCALE; -#else - *boost = exp(log(10) * *boost / 20) * BOOST_SCALE; -#endif //WIN32 - if (option_debug > 1) - DEBUGA_GSMOPEN("setting boost %s to %f\n", GSMOPEN_P_LOG, s, *boost); -} - -int gsmopen_sound_boost(void *data, int samples_num, double boost) -{ -/* LUIGI RIZZO's magic */ - if (boost != 0 && (boost < 511 || boost > 513)) { /* scale and clip values */ - int i, x; - - int16_t *ptr = (int16_t *) data; - - for (i = 0; i < samples_num; i++) { - x = (int) (ptr[i] * boost) / BOOST_SCALE; - if (x > 32767) { - x = 32767; - } else if (x < -32768) { - x = -32768; - } - ptr[i] = (int16_t) x; - } - } else { - //printf("BOOST=%f\n", boost); - } - - return 0; -} - -int gsmopen_serial_getstatus_AT(private_t *tech_pvt) -{ - int res; - private_t *p = tech_pvt; - - if (!p) - return -1; - - PUSHA_UNLOCKA(p->controldev_lock); - LOKKA(p->controldev_lock); - res = gsmopen_serial_write_AT_ack(p, "AT"); - if (res) { - ERRORA("AT was not acknowledged, continuing but maybe there is a problem\n", GSMOPEN_P_LOG); - } - gsmopen_sleep(1000); - - if (strlen(p->at_query_battchg)) { - res = gsmopen_serial_write_AT_expect(p, p->at_query_battchg, p->at_query_battchg_expect); - if (res) { - WARNINGA("%s didn't get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, p->at_query_battchg, p->at_query_battchg_expect); - } - gsmopen_sleep(1000); - } - - if (strlen(p->at_query_signal)) { - res = gsmopen_serial_write_AT_expect(p, p->at_query_signal, p->at_query_signal_expect); - if (res) { - WARNINGA("%s didn't get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, p->at_query_signal, p->at_query_signal_expect); - } - gsmopen_sleep(1000); - } - - if (!p->network_creg_not_supported) { - res = gsmopen_serial_write_AT_ack(p, "AT+CREG?"); - if (res) { - WARNINGA("%s didn't get %s from the phone. Continuing.\n", GSMOPEN_P_LOG, "AT+CREG?", "OK"); - } - gsmopen_sleep(1000); - } - //FIXME all the following commands in config! - - if (p->sms_cnmi_not_supported) { - res = gsmopen_serial_write_AT_ack(p, "AT+MMGL=\"HEADER ONLY\""); - if (res) { - WARNINGA - ("%s didn't get %s from the phone. If your phone is not Motorola, please contact the gsmopen developers. Else, if your phone IS a Motorola, probably a long msg was incoming and ther first part was read and then deleted. The second part is now orphan. If you got this warning repeatedly, and you cannot correctly receive SMSs from this interface, please manually clean all messages (and the residual parts of them) from the cellphone/SIM. Continuing.\n", - GSMOPEN_P_LOG, "AT+MMGL=\"HEADER ONLY\"", "OK"); - } else { - gsmopen_sleep(1000); - if (p->unread_sms_msg_id) { - char at_command[256]; - - res = gsmopen_serial_write_AT_ack(p, "AT+CSCS=\"UCS2\""); - if (res) { - ERRORA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) didn't get OK from the phone\n", GSMOPEN_P_LOG); - memset(p->sms_message, 0, sizeof(p->sms_message)); - } - - memset(at_command, 0, sizeof(at_command)); - sprintf(at_command, "AT+CMGR=%d", p->unread_sms_msg_id); - memset(p->sms_message, 0, sizeof(p->sms_message)); - - p->reading_sms_msg = 1; - res = gsmopen_serial_write_AT_ack(p, at_command); - p->reading_sms_msg = 0; - if (res) { - ERRORA("AT+CMGR (read SMS) didn't get OK from the phone, message sent was:|||%s|||\n", GSMOPEN_P_LOG, at_command); - } - res = gsmopen_serial_write_AT_ack(p, "AT+CSCS=\"GSM\""); - if (res) { - ERRORA("AT+CSCS=\"GSM\" (set TE messages to GSM) didn't get OK from the phone\n", GSMOPEN_P_LOG); - } - memset(at_command, 0, sizeof(at_command)); - sprintf(at_command, "AT+CMGD=%d", p->unread_sms_msg_id); /* delete the message */ - p->unread_sms_msg_id = 0; - res = gsmopen_serial_write_AT_ack(p, at_command); - if (res) { - ERRORA("AT+CMGD (Delete SMS) didn't get OK from the phone, message sent was:|||%s|||\n", GSMOPEN_P_LOG, at_command); - } - - if (strlen(p->sms_message)) { - DEBUGA_GSMOPEN("got SMS incoming message. SMS received was:---%s---\n", GSMOPEN_P_LOG, p->sms_message); - } - } - } - } - - UNLOCKA(p->controldev_lock); - POPPA_UNLOCKA(p->controldev_lock); - return 0; -} - -int gsmopen_serial_init_audio_port(private_t *tech_pvt, int controldevice_audio_speed) -{ - /* - * TODO - * hmm, it doesn't look very different from gsmopen_serial_init_port, does it? - */ - - if (!tech_pvt) - return -1; - - tech_pvt->serialPort_serial_audio = new ctb::SerialPort(); - - /* windows: com ports above com9 need a special trick, which also works for com ports below com10 ... */ - char devname[512] = ""; - strcpy(devname, tech_pvt->controldevice_audio_name); -#ifdef WIN32 - strcpy(devname,"\\\\.\\"); - strcat(devname, tech_pvt->controldevice_audio_name); -#endif - - if (tech_pvt->serialPort_serial_audio->Open(devname, 115200, "8N1", ctb::SerialPort::NoFlowControl) >= 0) { - DEBUGA_GSMOPEN("port %s, SUCCESS open\n", GSMOPEN_P_LOG, tech_pvt->controldevice_audio_name); - tech_pvt->serialPort_serial_audio_opened =1; - gsmopen_serial_write_AT_expect(tech_pvt, "AT^DDSETEX=2", tech_pvt->at_dial_expect); - } else { -#ifdef WIN32 - LPVOID msg; - FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &msg, - 0, - NULL); - ERRORA("port open failed for %s - %s", GSMOPEN_P_LOG, devname, (LPCTSTR) msg); - LocalFree(msg); -#else - ERRORA("port %s, NOT open\n", GSMOPEN_P_LOG, tech_pvt->controldevice_audio_name); -#endif - return -1; - } - - return 0; -} - -int serial_audio_init(private_t *tech_pvt) -{ - int res; - int err; - - res = gsmopen_serial_init_audio_port(tech_pvt, tech_pvt->controldevice_audio_speed); - DEBUGA_GSMOPEN("serial_audio_init res=%d\n", GSMOPEN_P_LOG, res); - - if (res == 0) - err = 0; - else - err = 1; - - return err; -} - -int serial_audio_shutdown(private_t *tech_pvt) -{ - - int res; - - if (!tech_pvt || !tech_pvt->serialPort_serial_audio) - return -1; - - res = tech_pvt->serialPort_serial_audio->Close(); - DEBUGA_GSMOPEN("serial_audio_shutdown res=%d (controldev_audio_fd is %d)\n", GSMOPEN_P_LOG, res, tech_pvt->controldev_audio_fd); - tech_pvt->serialPort_serial_audio_opened =0; - - return res; -} diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/COPYRIGHT b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/COPYRIGHT deleted file mode 100644 index 9d0d9da185..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/COPYRIGHT +++ /dev/null @@ -1,18 +0,0 @@ -Copyright - -Copyright (C) 1999-2010 Joachim Buermann (jbuermann@iftools.com) - -ctb is free software; you can redistribute it and/or modify it under -the term of the GNU Library General Public Licence as published by the -Free Software Foundation. - -This library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public Licence for more details - - -EXCEPTION NOTICE -As a special exception, you may use, copy, link, modify and distribute -under the user's own terms, binary object code versions of works based -on the library. diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/GNUmakefile b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/GNUmakefile deleted file mode 100644 index e39a687d4c..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/GNUmakefile +++ /dev/null @@ -1,293 +0,0 @@ -# ========================================================================= -# This makefile was generated by -# Bakefile 0.2.5 (http://www.bakefile.org) -# Do not modify, all changes will be overwritten! -# ========================================================================= - - - -# ------------------------------------------------------------------------- -# These are configurable options: -# ------------------------------------------------------------------------- - -# 'install' program location -INSTALL ?= install - -# Location where the package is installed by 'make install' -prefix ?= /usr/local - -# Destination root (/ is used if empty) -DESTDIR ?= - -# -AR ?= ar - -# -RANLIB ?= ranlib - -# Compiler flags to link shared library -LINK_DLL_FLAGS ?= -shared - -# C++ compiler -CXX = g++ - -# Standard flags for C++ -CXXFLAGS ?= - -# Standard preprocessor flags (common for CC and CXX) -CPPFLAGS ?= - -# Standard linker flags -LDFLAGS ?= - -# Set to 1 to build debug version [0,1] -DEBUG ?= 0 - -# -GPIB ?= 0 - - - -# ------------------------------------------------------------------------- -# Do not modify the rest of this file! -# ------------------------------------------------------------------------- - -### Variables: ### - -CPPDEPS = -MT$@ -MF`echo $@ | sed -e 's,\.o$$,.d,'` -MD -MP -CTB_LIB_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -D_THREAD_SAFE -pthread \ - $(__OPTIMIZE_FLAG) -I../include $(CPPFLAGS) $(CXXFLAGS) -CTB_LIB_OBJECTS = \ - $(OUTPUT)/ctb_lib_fifo.o \ - $(OUTPUT)/ctb_lib_getopt.o \ - $(OUTPUT)/ctb_lib_iobase.o \ - $(OUTPUT)/ctb_lib_portscan.o \ - $(OUTPUT)/ctb_lib_serportx.o \ - $(OUTPUT)/ctb_lib_serport.o \ - $(OUTPUT)/ctb_lib_timer.o \ - $(__GPIBSRC_OBJECTS) -CTB_DLL_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -D_THREAD_SAFE -pthread \ - $(__OPTIMIZE_FLAG) -I../include -fPIC -DPIC $(CPPFLAGS) $(CXXFLAGS) -CTB_DLL_OBJECTS = \ - $(OUTPUT)/ctb_dll_fifo.o \ - $(OUTPUT)/ctb_dll_getopt.o \ - $(OUTPUT)/ctb_dll_iobase.o \ - $(OUTPUT)/ctb_dll_portscan.o \ - $(OUTPUT)/ctb_dll_serportx.o \ - $(OUTPUT)/ctb_dll_serport.o \ - $(OUTPUT)/ctb_dll_timer.o \ - $(__GPIBSRC_OBJECTS_1) -CTBTEST_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -DGPIB=$(GPIB) -D_THREAD_SAFE \ - -pthread $(__OPTIMIZE_FLAG) -I../include $(CPPFLAGS) $(CXXFLAGS) -CTBTEST_OBJECTS = \ - $(OUTPUT)/ctbtest_ctbtest.o - -### Conditionally set variables: ### - -ifeq ($(DEBUG),0) -OUTPUT = release -endif -ifeq ($(DEBUG),1) -OUTPUT = debug -endif -ifeq ($(DEBUG),1) -LIBFLAG = d -endif -ifeq ($(GPIB),1) -GPIBFLAG = _gpib -endif -ifeq ($(GPIB),1) -GPIBINC = gpib.h -endif -ifeq ($(GPIB),1) -__GPIBSRC_OBJECTS = \ - $(OUTPUT)/ctb_lib_gpib.o -endif -ifeq ($(GPIB),1) -__GPIBSRC_OBJECTS_1 = \ - $(OUTPUT)/ctb_dll_gpib.o -endif -ifeq ($(DEBUG),0) -____DEBUG = -DNDEBUG -endif -ifeq ($(DEBUG),1) -____DEBUG = -endif -ifeq ($(DEBUG),0) -__OPTIMIZE_FLAG = -O0 -endif -ifeq ($(DEBUG),1) -__OPTIMIZE_FLAG = -O2 -endif -ifeq ($(GPIB),1) -__SYSLIB2_p = -lgpib -endif -ifeq ($(DEBUG),0) -____DEBUG_1 = -endif -ifeq ($(DEBUG),1) -____DEBUG_1 = -g -endif - - -all: $(OUTPUT) -$(OUTPUT): - @mkdir -p $(OUTPUT) - -### Targets: ### - -all: ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so $(OUTPUT)/ctbtest tip-linux - -install: install_ctb_lib install_ctb_dll - $(INSTALL) -d $(DESTDIR)$(prefix)/include/ctb-0.16 - for f in ctb.h fifo.h getopt.h $(GPIBINC) iobase.h linux/serport.h linux/timer.h portscan.h serport.h serportx.h timer.h; do \ - if test ! -d $(DESTDIR)$(prefix)/include/ctb-0.16/`dirname $$f` ; then \ - $(INSTALL) -d $(DESTDIR)$(prefix)/include/ctb-0.16/`dirname $$f`; \ - fi; \ - $(INSTALL) -m 644 ../include/ctb-0.16/$$f $(DESTDIR)$(prefix)/include/ctb-0.16/$$f; \ - done - -uninstall: uninstall_ctb_lib uninstall_ctb_dll - for f in ctb.h fifo.h getopt.h $(GPIBINC) iobase.h linux/serport.h linux/timer.h portscan.h serport.h serportx.h timer.h; do \ - rm -f $(DESTDIR)$(prefix)/include/ctb-0.16/$$f; \ - done - -clean: - rm -f $(OUTPUT)/*.o - rm -f $(OUTPUT)/*.d - rm -f ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a - rm -f ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so - rm -f ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so - rm -f $(OUTPUT)/ctbtest - -htmldoc: - (cd ..; tar -cvzf manual/libctb-0.16-htmldoc.tar.gz docs/html/ ) - -tarball: - (cd ../..; tar -cvzf libctb-0.16.tar.gz \ - libctb-0.16/build/ \ - libctb-0.16/manual/refman.pdf \ - libctb-0.16/include \ - libctb-0.16/python \ - libctb-0.16/samples \ - libctb-0.16/src \ - libctb-0.16/lib/gpib32.lib \ - --exclude=release \ - --exclude=debug \ - --exclude=install \ - --exclude=output \ - --exclude=website \ - --exclude=*~ \ - --exclude=buildall.sh \ - --exclude=buildall.bat \ - --exclude=version-update.sh \ - --exclude=libctb-0.16.tar.gz \ - --exclude=*.ilk \ - --exclude=*.log \ - --exclude=*.o* \ - --exclude=*.pdb \ - --exclude=*.pyc \ - --exclude=.svn; mv libctb-0.16.tar.gz libctb-0.16/build ) - -../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a: $(CTB_LIB_OBJECTS) - rm -f $@ - $(AR) rcu $@ $(CTB_LIB_OBJECTS) - $(RANLIB) $@ - -install_ctb_lib: ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a - $(INSTALL) -d $(DESTDIR)$(prefix)/lib - $(INSTALL) -m 644 ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a $(DESTDIR)$(prefix)/lib - -uninstall_ctb_lib: - rm -f $(DESTDIR)$(prefix)/lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a - -../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so: $(CTB_DLL_OBJECTS) - $(CXX) $(LINK_DLL_FLAGS) -fPIC -o $@ $(CTB_DLL_OBJECTS) $(____DEBUG_1) -pthread -L../lib $(LDFLAGS) -lpthread $(__SYSLIB2_p) - -install_ctb_dll: ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so - $(INSTALL) -d $(DESTDIR)$(prefix)/lib - $(INSTALL) -m 644 ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so $(DESTDIR)$(prefix)/lib - install -c ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so $(DESTDIR)$(prefix)/lib - -uninstall_ctb_dll: - rm -f $(DESTDIR)$(prefix)/lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so - rm -f $(DESTDIR)$(prefix)/lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.so - -$(OUTPUT)/ctbtest: $(CTBTEST_OBJECTS) ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a - $(CXX) -o $@ $(CTBTEST_OBJECTS) $(____DEBUG_1) -pthread -L../lib $(LDFLAGS) ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a -lpthread $(__SYSLIB2_p) - -tip-linux: - @echo " " - @echo "================================================================" - @echo " The building of ctb is finished. On Linux you'll now" - @echo " have to run (as root):" - @echo " " - @echo " make DEBUG=$(DEBUG) GPIB=$(GPIB) install" - @echo " " - @echo " to install the libraries in $(prefix)/lib" - @echo " and the header files in $(prefix)/include/ctb-0.16" - @echo " " - @echo " Don't forget to run ldconfig (also as root)" - @echo " " - @echo " ctb comes with no guarantees and doesn't claim" - @echo " to be suitable for any purpose." - @echo "================================================================" - @echo " " - -$(OUTPUT)/ctb_lib_fifo.o: ./../src/fifo.cpp - $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)/ctb_lib_getopt.o: ./../src/getopt.cpp - $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)/ctb_lib_iobase.o: ./../src/iobase.cpp - $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)/ctb_lib_portscan.o: ./../src/portscan.cpp - $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)/ctb_lib_serportx.o: ./../src/serportx.cpp - $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)/ctb_lib_serport.o: ./../src/linux/serport.cpp - $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)/ctb_lib_timer.o: ./../src/linux/timer.cpp - $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)/ctb_lib_gpib.o: ./../src/gpib.cpp - $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)/ctb_dll_fifo.o: ./../src/fifo.cpp - $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)/ctb_dll_getopt.o: ./../src/getopt.cpp - $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)/ctb_dll_iobase.o: ./../src/iobase.cpp - $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)/ctb_dll_portscan.o: ./../src/portscan.cpp - $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)/ctb_dll_serportx.o: ./../src/serportx.cpp - $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)/ctb_dll_serport.o: ./../src/linux/serport.cpp - $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)/ctb_dll_timer.o: ./../src/linux/timer.cpp - $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)/ctb_dll_gpib.o: ./../src/gpib.cpp - $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)/ctbtest_ctbtest.o: ./../samples/ctbtest.cpp - $(CXX) -c -o $@ $(CTBTEST_CXXFLAGS) $(CPPDEPS) $< - -.PHONY: all install uninstall clean install_ctb_lib uninstall_ctb_lib \ - install_ctb_dll uninstall_ctb_dll - - -# Dependencies tracking: --include $(OUTPUT)/*.d diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/README b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/README deleted file mode 100644 index fdcdb1d37b..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/README +++ /dev/null @@ -1,169 +0,0 @@ - -CTB (Communication toolbox library) 08.02.2010 -====================================================================== - -Website: http://www.iftools.com/opensource/ctb.en.php -Version: 0.16 - - -Linux GCC compiliation ----------------------------------------------------------------- - -Type 'make DEBUG=x GPIB=x' or 'make -f GNUmakefile DEBUG=x GPIB=x' - -Type the same command with an additional install as root to copy the -headers and libs to there according system places -(i.e. /usr/local/include/ctb-0.16 and /usr/local/lib/libctb-0.16.a) -like: - -sudo make DEBUG=x GPIB=x install - - -Microsoft MingW32 compilation ----------------------------------------------------------------- - -Type mingw32-make -f makefile.gcc DEBUG=x GPIB=x - -Please note! Currently only a shared ctb library will be created. -You have to copy the ctb-VERSION.dll in the application path of -your application linked with ctb or in a global dll folder (but -not recommented!) - - -Microsoft Visual C++ compilation ----------------------------------------------------------------- - -Type 'nmake -f makefile.vc DEBUG=x GPIB=x' - -To create all libs (debug/release with and without gpib support) -just input: ./buildall.bat in the build folder. - - -Borland C++ 5.0/5.5 compilation ----------------------------------------------------------------- - -Type 'make -f makefile.bcc DEBUG=x GPIB=x' - - -Watcom C++ 10.6/11 and OpenWatcom compilation ----------------------------------------------------------------- - -Type 'wmake -f makefile.wat' - - -Python support --------------- - -Since version 0.9 ctb also includes a python module ctb.py. -To build the python module by yourself, your system has to satisfy -the following requirements: - -- the SWIG program, you get it at http://www.swig.org/ (for linux, - take a look in your favorite distribution package manager). - The current ctb module was build with SWIG version 1.3.29 (linux) - and version 1.3.40 (Windows) -- the develop files for python (means the header and the library - files). I tested it with Python 2.4. You will get it at: - http://www.python.org/ftp/python/2.4.4/python-2.4.4.msi -- if you want to communicate via GPIB, a GPIB installation (GPIB - controller and software, for instance a Nation Instruments or - Keithley card). On Linux the libgpib. - -Like the building of the wxctb C++ library, you also can choose -between GPIB and non GPIB (default) support. - -Compile the python module - -Linux -cd in the python/src/linux folder and type: -./makepy.sh USE_GPIB -or -./makepy.sh -if you don't need any GPIB support - -Windows -cd in the python/src/windows folder. Open the makepy.bat with your -favorite editor and set the commented enviroment variables. See the -makepy.bat file for more information, how you can do that. -After that, just type: - -./makepy.sh USE_GPIB -(for GPIB support) or -./makepy.sh -if you don't need any GPIB support - -At last set the python modul path to the ctb-0.15/python/module -path. -On linux: - -export PYTHONPATH=somepath/ctb-0.15/python/module/linux - -On Windows: - -set PYTHONPATH=drive:\somepath\ctb-0.15\python\module\win32 - - -ChangeLog ---------- - -0.16 - - added port scan function. - - bug fixes for MingW build. - -0.15 - - added ctb namespace and removed all wx prefix (also in the header - path). - - Linux: A serial port cannot opened twice or more any longer. - - 9 bit data transmission support using the parity bit as ninth bit. - - improved documentation - - Some more documentation - -0.14 - - Support for non-standard baudrates (depends on the used UART - or USB to RS232 converter. - -0.13 - - remove the expect and match mechanism. They didn't work very - well, and a future implementation should be done as a - independent library. If someone missed this functions, please - let me know. - -0.12 - - more documentation for doxygen - - replace the ugly GetSettingsAsString methods by a more intuitive - one. - - wxGPIB::Read now checks the MAV bit before reading. This resolves - some stderr stuff on linux. - -0.11 - - the gpib sources are no longer depending on the OS. They are - identical for linux and windows. - - add the current version to the ctb include path, so you can - handle a parallel installation of different versions. - For instance: The header path wx/ctb is replaced by wx/ctb-0.11 - -0.10 - - replace the former gpib async io access with the standard - NI-488 functions (ibrd,ibwrt). To avoid blocking, the internal - gpib timeout was set to the lowest value, whereas the wxIOBase - methods handles the timeout in a global and transparent manner. - - add a FindListener method in the wxGPIB class to look for all - connected gpib devices (listeners). - - The Read and Readv method of the python wxIOBase class returns - additional zero bytes, fixed. - -0.9 - - added python support for both, serial and gpib - -0.8 - - added bakefile support - -0.7 - - added GPIB (Nation Instruments GPIB cards) support - - -Authors' info -------------- - -Joachim Buermann jbuermann@iftools.com - diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/libctb.bkl b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/libctb.bkl deleted file mode 100644 index eb5670bd4a..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/libctb.bkl +++ /dev/null @@ -1,281 +0,0 @@ - - - - - - - - - - - - - - 0.16 - libctb - - - - % - - - - - - - - - - debug - release - - $(OUTPUT) - - - ..$(DIRSEP)lib - - - - - d - - - - pthread - winmm - - - - gpib - gpib32 - - - - linux - win32 - - - - _gpib - - - - - ../src/gpib.cpp - - - - - - gpib.h - - - - - off - speed - - - - ../src/fifo.cpp - ../src/getopt.cpp - ../src/iobase.cpp - ../src/portscan.cpp - ../src/serportx.cpp - ../src/$(OS)/serport.cpp - ../src/$(OS)/timer.cpp - - - - - (cd ..; tar -cvzf manual/$(value) docs/html/ ) - - - - - - $(NAME)-$(VERSION)-htmldoc.tar.gz - - - - - - (cd ../..; tar -cvzf $(value) \ - $(NAME)-$(VERSION)/build/ \ - $(NAME)-$(VERSION)/manual/refman.pdf \ - $(NAME)-$(VERSION)/include \ - $(NAME)-$(VERSION)/python \ - $(NAME)-$(VERSION)/samples \ - $(NAME)-$(VERSION)/src \ - $(NAME)-$(VERSION)/lib/gpib32.lib \ - --exclude=release \ - --exclude=debug \ - --exclude=install \ - --exclude=output \ - --exclude=website \ - --exclude=*~ \ - --exclude=buildall.sh \ - --exclude=buildall.bat \ - --exclude=g++.sh \ - --exclude=version-update.sh \ - --exclude=$(value) \ - --exclude=*.ilk \ - --exclude=*.log \ - --exclude=*.o* \ - --exclude=*.pdb \ - --exclude=*.pyc \ - --exclude=.svn; mv $(value) $(NAME)-$(VERSION)/build ) - - - - - - $(NAME)-$(VERSION).tar.gz - - - - - - ..$(DIRSEP)include$(DIRSEP)ctb-$(VERSION) - - ctb.h - fifo.h - getopt.h - $(GPIBINC) - iobase.h - linux/serport.h - linux/timer.h - portscan.h - serport.h - serportx.h - timer.h - - $(INCLUDEDIR)$(DIRSEP)ctb-$(VERSION) - - - - ../lib - ctb$(LIBFLAG)$(GPIBFLAG)-$(VERSION) - - multi - static - $(OPTIMIZE_FLAG) - - $(FILES) - $(GPIBSRC) - - ../lib - $(SYSLIB1) - $(SYSLIB2) - ../include - $(LIBDIR) - - - ../lib - multi - ctb$(LIBFLAG)$(GPIBFLAG)-$(VERSION) - static - $(OPTIMIZE_FLAG) - ctb$(LIBFLAG)$(GPIBFLAG)-$(VERSION) - - $(FILES) - $(GPIBSRC) - - ../lib - $(SYSLIB1) - $(SYSLIB2) - ../include - $(LIBDIR) - - - - - - GPIB=$(GPIB) - multi - static - $(OPTIMIZE_FLAG) - - ../samples/ctbtest.cpp - - ../include - ../lib - ctb_lib - $(SYSLIB1) - $(SYSLIB2) - - - - vc - $(FORMAT) - - - - - - @if not exist $(INSTALLDIR)\lib\$(LIBNAME)_lib mkdir $(INSTALLDIR)\lib\$(LIBNAME)_lib - - @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-$(VERSION).lib $(INSTALLDIR)\lib\$(LIBNAME)_lib - @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-$(VERSION).dll $(INSTALLDIR)\lib\$(LIBNAME)_lib - - @if not exist $(INSTALLDIR)\include\ctb-$(VERSION)\win32 mkdir $(INSTALLDIR)\include\ctb-$(VERSION)\win32 - @copy ..\include\ctb-$(VERSION)\*.h $(INSTALLDIR)\include\ctb-$(VERSION) - @copy ..\include\ctb-$(VERSION)\win32\*.h $(INSTALLDIR)\include\ctb-$(VERSION)\win32 - - - - - all - - @echo " " - @echo "================================================================" - @echo " The building of ctb is finished. On Linux you'll now" - @echo " have to run (as root):" - @echo " " - @echo " make DEBUG=$(DEBUG) GPIB=$(GPIB) install" - @echo " " - @echo " to install the libraries in $(LIBDIR)" - @echo " and the header files in $(INCLUDEDIR)/ctb-$(VERSION)" - @echo " " - @echo " Don't forget to run ldconfig (also as root)" - @echo " " - @echo " ctb comes with no guarantees and doesn't claim" - @echo " to be suitable for any purpose." - @echo "================================================================" - @echo " " - - - - - all - - @echo " " - @echo "================================================================" - @echo " The building of ctb is finished. If you have an installed " - @echo " wxWidget package (WXWIN must be defined in the enviroment), " - @echo " you'll now have to run: " - @echo " " - @echo " make DEBUG=$(DEBUG) GPIB=$(GPIB) wxinstall " - @echo " " - @echo " to install the libraries in: " - @echo " $(INSTALLDIR)$(DIRSEP)lib$(DIRSEP)$(LIBNAME)_lib " - @echo " and the header files in" - @echo " $(INSTALLDIR)$(DIRSEP)ctb-$(VERSION)" - @echo " " - @echo " If you are using another compiler (Borland, Watcom, mingw,...) " - @echo " take a look in the README in this directory! " - @echo " " - @echo " ctb comes with no guarantees and doesn't claim " - @echo " to be suitable for any purpose. " - @echo "================================================================" - @echo " " - - - - diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.bcc b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.bcc deleted file mode 100644 index 6afadafb3f..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.bcc +++ /dev/null @@ -1,269 +0,0 @@ -# ========================================================================= -# This makefile was generated by -# Bakefile 0.2.5 (http://www.bakefile.org) -# Do not modify, all changes will be overwritten! -# ========================================================================= - -.autodepend - -!ifndef BCCDIR -!ifndef MAKEDIR -!error Your Borland compiler does not define MAKEDIR. Please define the BCCDIR variable, e.g. BCCDIR=d:\bc4 -!endif -BCCDIR = $(MAKEDIR)\.. -!endif - - - -# ------------------------------------------------------------------------- -# These are configurable options: -# ------------------------------------------------------------------------- - -# C++ compiler -!ifndef CXX -CXX = bcc32 -!endif - -# Standard flags for C++ -!ifndef CXXFLAGS -CXXFLAGS = -!endif - -# Standard preprocessor flags (common for CC and CXX) -!ifndef CPPFLAGS -CPPFLAGS = -a8 -g0 -!endif - -# Standard linker flags -!ifndef LDFLAGS -LDFLAGS = -!endif - -# Set to 1 to build debug version [0,1] -!ifndef DEBUG -DEBUG = 0 -!endif - -# -!ifndef GPIB -GPIB = 0 -!endif - -# -!ifndef WXDIR -WXDIR = $(WXWIN) -!endif - -# -!ifndef INSTALLDIR -INSTALLDIR = $(WXWIN) -!endif - - - -# ------------------------------------------------------------------------- -# Do not modify the rest of this file! -# ------------------------------------------------------------------------- - -### Variables: ### - -CTB_LIB_CXXFLAGS = -I$(BCCDIR)\include $(____DEBUG) $(____DEBUG_2) -tWM \ - $(__OPTIMIZE_FLAG) -I..\include $(CPPFLAGS) $(CXXFLAGS) -CTB_LIB_OBJECTS = \ - $(OUTPUT)\ctb_lib_fifo.obj \ - $(OUTPUT)\ctb_lib_getopt.obj \ - $(OUTPUT)\ctb_lib_iobase.obj \ - $(OUTPUT)\ctb_lib_portscan.obj \ - $(OUTPUT)\ctb_lib_serportx.obj \ - $(OUTPUT)\ctb_lib_serport.obj \ - $(OUTPUT)\ctb_lib_timer.obj \ - $(____GPIBSRC_FILENAMES_OBJECTS) -CTB_DLL_CXXFLAGS = -I$(BCCDIR)\include $(____DEBUG) $(____DEBUG_2) -tWM \ - $(__OPTIMIZE_FLAG) -I..\include $(CPPFLAGS) $(CXXFLAGS) -CTB_DLL_OBJECTS = \ - $(OUTPUT)\ctb_dll_fifo.obj \ - $(OUTPUT)\ctb_dll_getopt.obj \ - $(OUTPUT)\ctb_dll_iobase.obj \ - $(OUTPUT)\ctb_dll_portscan.obj \ - $(OUTPUT)\ctb_dll_serportx.obj \ - $(OUTPUT)\ctb_dll_serport.obj \ - $(OUTPUT)\ctb_dll_timer.obj \ - $(____GPIBSRC_FILENAMES_1_OBJECTS) -CTBTEST_CXXFLAGS = -I$(BCCDIR)\include $(____DEBUG) $(____DEBUG_2) \ - -DGPIB=$(GPIB) -tWM $(__OPTIMIZE_FLAG) -I..\include $(CPPFLAGS) $(CXXFLAGS) -CTBTEST_OBJECTS = \ - $(OUTPUT)\ctbtest_ctbtest.obj - -### Conditionally set variables: ### - -!if "$(DEBUG)" == "0" -OUTPUT = release -!endif -!if "$(DEBUG)" == "1" -OUTPUT = debug -!endif -!if "$(WXDIR)" == "" -INSTALLDIR = ..\lib -!endif -!if "$(DEBUG)" == "1" -LIBFLAG = d -!endif -!if "$(GPIB)" == "1" -GPIBFLAG = _gpib -!endif -!if "$(GPIB)" == "1" -____GPIBSRC_FILENAMES_OBJECTS = \ - $(OUTPUT)\ctb_lib_gpib.obj -!endif -!if "$(GPIB)" == "1" -____GPIBSRC_FILENAMES_1_OBJECTS = \ - $(OUTPUT)\ctb_dll_gpib.obj -!endif -!if "$(DEBUG)" == "0" -____DEBUG = -DNDEBUG -!endif -!if "$(DEBUG)" == "1" -____DEBUG = -!endif -!if "$(DEBUG)" == "0" -__OPTIMIZE_FLAG = -Od -!endif -!if "$(DEBUG)" == "1" -__OPTIMIZE_FLAG = -O2 -!endif -!if "$(GPIB)" == "1" -__SYSLIB2_p = gpib32.lib -!endif -!if "$(DEBUG)" == "0" -____DEBUG_2 = -v- -!endif -!if "$(DEBUG)" == "1" -____DEBUG_2 = -v -!endif - - -all: $(OUTPUT) -$(OUTPUT): - -if not exist $(OUTPUT) mkdir $(OUTPUT) - -### Targets: ### - -all: ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(OUTPUT)\ctbtest.exe tip-win32 - -clean: - -if exist $(OUTPUT)\*.obj del $(OUTPUT)\*.obj - -if exist $(OUTPUT)\*.res del $(OUTPUT)\*.res - -if exist $(OUTPUT)\*.csm del $(OUTPUT)\*.csm - -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib - -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll - -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.tds del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.tds - -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ilc del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ilc - -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ild del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ild - -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ilf del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ilf - -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ils del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ils - -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib - -if exist $(OUTPUT)\ctbtest.exe del $(OUTPUT)\ctbtest.exe - -if exist $(OUTPUT)\ctbtest.tds del $(OUTPUT)\ctbtest.tds - -if exist $(OUTPUT)\ctbtest.ilc del $(OUTPUT)\ctbtest.ilc - -if exist $(OUTPUT)\ctbtest.ild del $(OUTPUT)\ctbtest.ild - -if exist $(OUTPUT)\ctbtest.ilf del $(OUTPUT)\ctbtest.ilf - -if exist $(OUTPUT)\ctbtest.ils del $(OUTPUT)\ctbtest.ils - -..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib: $(CTB_LIB_OBJECTS) - if exist $@ del $@ - tlib /a /p4096 $@ @&&| - $(CTB_LIB_OBJECTS) -| - -..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll: $(CTB_DLL_OBJECTS) - ilink32 -Tpd -q -L$(BCCDIR)\lib -L$(BCCDIR)\lib\psdk $(____DEBUG_2) -L..\lib $(LDFLAGS) @&&| - c0d32.obj $(CTB_DLL_OBJECTS),$@,, winmm.lib $(__SYSLIB2_p) import32.lib cw32mt.lib,, -| - implib -f ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16 $@ - -$(OUTPUT)\ctbtest.exe: $(CTBTEST_OBJECTS) ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib - ilink32 -Tpe -q -L$(BCCDIR)\lib -L$(BCCDIR)\lib\psdk $(____DEBUG_2) -L..\lib $(LDFLAGS) @&&| - c0x32.obj $(CTBTEST_OBJECTS),$@,, ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib winmm.lib $(__SYSLIB2_p) import32.lib cw32mt.lib,, -| - -wxinstall: - @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib $(INSTALLDIR)\lib\borland_lib - @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(INSTALLDIR)\lib\borland_lib - - @if not exist $(INSTALLDIR)\include\ctb-0.16\win32 mkdir $(INSTALLDIR)\include\ctb-0.16\win32 - @copy ..\include\ctb-0.16\*.h $(INSTALLDIR)\include\ctb-0.16 - @copy ..\include\ctb-0.16\win32\*.h $(INSTALLDIR)\include\ctb-0.16\win32 - -tip-win32: - @echo " " - @echo "================================================================" - @echo " The building of ctb is finished. If you have an installed " - @echo " wxWidget package (WXWIN must be defined in the enviroment), " - @echo " you'll now have to run: " - @echo " " - @echo " make DEBUG=$(DEBUG) GPIB=$(GPIB) wxinstall " - @echo " " - @echo " to install the libraries in: " - @echo " $(INSTALLDIR)\lib\borland_lib " - @echo " and the header files in" - @echo " $(INSTALLDIR)\ctb-0.16" - @echo " " - @echo " If you are using another compiler (Borland, Watcom, mingw,...) " - @echo " take a look in the README in this directory! " - @echo " " - @echo " ctb comes with no guarantees and doesn't claim " - @echo " to be suitable for any purpose. " - @echo "================================================================" - @echo " " - -$(OUTPUT)\ctb_lib_fifo.obj: .\..\src\fifo.cpp - $(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\fifo.cpp - -$(OUTPUT)\ctb_lib_getopt.obj: .\..\src\getopt.cpp - $(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\getopt.cpp - -$(OUTPUT)\ctb_lib_iobase.obj: .\..\src\iobase.cpp - $(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\iobase.cpp - -$(OUTPUT)\ctb_lib_portscan.obj: .\..\src\portscan.cpp - $(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\portscan.cpp - -$(OUTPUT)\ctb_lib_serportx.obj: .\..\src\serportx.cpp - $(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\serportx.cpp - -$(OUTPUT)\ctb_lib_serport.obj: .\..\src\win32\serport.cpp - $(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\win32\serport.cpp - -$(OUTPUT)\ctb_lib_timer.obj: .\..\src\win32\timer.cpp - $(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\win32\timer.cpp - -$(OUTPUT)\ctb_lib_gpib.obj: .\..\src\gpib.cpp - $(CXX) -q -c -P -o$@ $(CTB_LIB_CXXFLAGS) .\..\src\gpib.cpp - -$(OUTPUT)\ctb_dll_fifo.obj: .\..\src\fifo.cpp - $(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\fifo.cpp - -$(OUTPUT)\ctb_dll_getopt.obj: .\..\src\getopt.cpp - $(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\getopt.cpp - -$(OUTPUT)\ctb_dll_iobase.obj: .\..\src\iobase.cpp - $(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\iobase.cpp - -$(OUTPUT)\ctb_dll_portscan.obj: .\..\src\portscan.cpp - $(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\portscan.cpp - -$(OUTPUT)\ctb_dll_serportx.obj: .\..\src\serportx.cpp - $(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\serportx.cpp - -$(OUTPUT)\ctb_dll_serport.obj: .\..\src\win32\serport.cpp - $(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\win32\serport.cpp - -$(OUTPUT)\ctb_dll_timer.obj: .\..\src\win32\timer.cpp - $(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\win32\timer.cpp - -$(OUTPUT)\ctb_dll_gpib.obj: .\..\src\gpib.cpp - $(CXX) -q -c -P -o$@ $(CTB_DLL_CXXFLAGS) .\..\src\gpib.cpp - -$(OUTPUT)\ctbtest_ctbtest.obj: .\..\samples\ctbtest.cpp - $(CXX) -q -c -P -o$@ $(CTBTEST_CXXFLAGS) .\..\samples\ctbtest.cpp - diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.gcc b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.gcc deleted file mode 100644 index febca07dc8..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.gcc +++ /dev/null @@ -1,238 +0,0 @@ -# ========================================================================= -# This makefile was generated by -# Bakefile 0.2.5 (http://www.bakefile.org) -# Do not modify, all changes will be overwritten! -# ========================================================================= - - - -# ------------------------------------------------------------------------- -# These are configurable options: -# ------------------------------------------------------------------------- - -# Compiler flags to link shared library -LINK_DLL_FLAGS ?= -shared - -# C++ compiler -CXX = g++ - -# Standard flags for C++ -CXXFLAGS ?= - -# Standard preprocessor flags (common for CC and CXX) -CPPFLAGS ?= - -# Standard linker flags -LDFLAGS ?= - -# Set to 1 to build debug version [0,1] -DEBUG ?= 0 - -# -GPIB ?= 0 - -# -WXDIR ?= $(WXWIN) - -# -INSTALLDIR ?= $(WXWIN) - - - -# ------------------------------------------------------------------------- -# Do not modify the rest of this file! -# ------------------------------------------------------------------------- - -### Variables: ### - -CPPDEPS = -MT$@ -MF$@.d -MD -MP -CTB_LIB_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -mthreads $(__OPTIMIZE_FLAG) \ - -I..\include $(CPPFLAGS) $(CXXFLAGS) -CTB_LIB_OBJECTS = \ - $(OUTPUT)\ctb_lib_fifo.o \ - $(OUTPUT)\ctb_lib_getopt.o \ - $(OUTPUT)\ctb_lib_iobase.o \ - $(OUTPUT)\ctb_lib_portscan.o \ - $(OUTPUT)\ctb_lib_serportx.o \ - $(OUTPUT)\ctb_lib_serport.o \ - $(OUTPUT)\ctb_lib_timer.o \ - $(____GPIBSRC_FILENAMES_OBJECTS) -CTB_DLL_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -mthreads $(__OPTIMIZE_FLAG) \ - -I..\include $(CPPFLAGS) $(CXXFLAGS) -CTB_DLL_OBJECTS = \ - $(OUTPUT)\ctb_dll_fifo.o \ - $(OUTPUT)\ctb_dll_getopt.o \ - $(OUTPUT)\ctb_dll_iobase.o \ - $(OUTPUT)\ctb_dll_portscan.o \ - $(OUTPUT)\ctb_dll_serportx.o \ - $(OUTPUT)\ctb_dll_serport.o \ - $(OUTPUT)\ctb_dll_timer.o \ - $(____GPIBSRC_FILENAMES_1_OBJECTS) -CTBTEST_CXXFLAGS = $(____DEBUG) $(____DEBUG_1) -DGPIB=$(GPIB) -mthreads \ - $(__OPTIMIZE_FLAG) -I..\include $(CPPFLAGS) $(CXXFLAGS) -CTBTEST_OBJECTS = \ - $(OUTPUT)\ctbtest_ctbtest.o - -### Conditionally set variables: ### - -ifeq ($(DEBUG),0) -OUTPUT = release -endif -ifeq ($(DEBUG),1) -OUTPUT = debug -endif -ifeq ($(WXDIR),) -INSTALLDIR = ..\lib -endif -ifeq ($(DEBUG),1) -LIBFLAG = d -endif -ifeq ($(GPIB),1) -GPIBFLAG = _gpib -endif -ifeq ($(GPIB),1) -____GPIBSRC_FILENAMES_OBJECTS = \ - $(OUTPUT)\ctb_lib_gpib.o -endif -ifeq ($(GPIB),1) -____GPIBSRC_FILENAMES_1_OBJECTS = \ - $(OUTPUT)\ctb_dll_gpib.o -endif -ifeq ($(DEBUG),0) -____DEBUG = -DNDEBUG -endif -ifeq ($(DEBUG),1) -____DEBUG = -endif -ifeq ($(DEBUG),0) -__OPTIMIZE_FLAG = -O0 -endif -ifeq ($(DEBUG),1) -__OPTIMIZE_FLAG = -O2 -endif -ifeq ($(GPIB),1) -__SYSLIB2_p = -lgpib32 -endif -ifeq ($(DEBUG),0) -____DEBUG_1 = -endif -ifeq ($(DEBUG),1) -____DEBUG_1 = -g -endif - - -all: $(OUTPUT) -$(OUTPUT): - -if not exist $(OUTPUT) mkdir $(OUTPUT) - -### Targets: ### - -all: ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(OUTPUT)\ctbtest.exe tip-win32 - -clean: - -if exist $(OUTPUT)\*.o del $(OUTPUT)\*.o - -if exist $(OUTPUT)\*.d del $(OUTPUT)\*.d - -if exist ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a del ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a - -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll - -if exist ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a del ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a - -if exist $(OUTPUT)\ctbtest.exe del $(OUTPUT)\ctbtest.exe - -..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a: $(CTB_LIB_OBJECTS) - if exist $@ del $@ - ar rcu $@ $(CTB_LIB_OBJECTS) - ranlib $@ - -..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll: $(CTB_DLL_OBJECTS) - $(CXX) $(LINK_DLL_FLAGS) -fPIC -o $@ $(CTB_DLL_OBJECTS) $(____DEBUG_1) -mthreads -Wl,--out-implib=..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a -L..\lib $(LDFLAGS) -lwinmm $(__SYSLIB2_p) - -$(OUTPUT)\ctbtest.exe: $(CTBTEST_OBJECTS) ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a - $(CXX) -o $@ $(CTBTEST_OBJECTS) $(____DEBUG_1) -mthreads -L..\lib $(LDFLAGS) ..\lib\libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a -lwinmm $(__SYSLIB2_p) - -wxinstall: - @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib $(INSTALLDIR)\lib\mingw_lib - @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(INSTALLDIR)\lib\mingw_lib - - @if not exist $(INSTALLDIR)\include\ctb-0.16\win32 mkdir $(INSTALLDIR)\include\ctb-0.16\win32 - @copy ..\include\ctb-0.16\*.h $(INSTALLDIR)\include\ctb-0.16 - @copy ..\include\ctb-0.16\win32\*.h $(INSTALLDIR)\include\ctb-0.16\win32 - -tip-win32: - @echo " " - @echo "================================================================" - @echo " The building of ctb is finished. If you have an installed " - @echo " wxWidget package (WXWIN must be defined in the enviroment), " - @echo " you'll now have to run: " - @echo " " - @echo " make DEBUG=$(DEBUG) GPIB=$(GPIB) wxinstall " - @echo " " - @echo " to install the libraries in: " - @echo " $(INSTALLDIR)\lib\mingw_lib " - @echo " and the header files in" - @echo " $(INSTALLDIR)\ctb-0.16" - @echo " " - @echo " If you are using another compiler (Borland, Watcom, mingw,...) " - @echo " take a look in the README in this directory! " - @echo " " - @echo " ctb comes with no guarantees and doesn't claim " - @echo " to be suitable for any purpose. " - @echo "================================================================" - @echo " " - -$(OUTPUT)\ctb_lib_fifo.o: ./../src/fifo.cpp - $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)\ctb_lib_getopt.o: ./../src/getopt.cpp - $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)\ctb_lib_iobase.o: ./../src/iobase.cpp - $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)\ctb_lib_portscan.o: ./../src/portscan.cpp - $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)\ctb_lib_serportx.o: ./../src/serportx.cpp - $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)\ctb_lib_serport.o: ./../src/win32/serport.cpp - $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)\ctb_lib_timer.o: ./../src/win32/timer.cpp - $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)\ctb_lib_gpib.o: ./../src/gpib.cpp - $(CXX) -c -o $@ $(CTB_LIB_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)\ctb_dll_fifo.o: ./../src/fifo.cpp - $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)\ctb_dll_getopt.o: ./../src/getopt.cpp - $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)\ctb_dll_iobase.o: ./../src/iobase.cpp - $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)\ctb_dll_portscan.o: ./../src/portscan.cpp - $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)\ctb_dll_serportx.o: ./../src/serportx.cpp - $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)\ctb_dll_serport.o: ./../src/win32/serport.cpp - $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)\ctb_dll_timer.o: ./../src/win32/timer.cpp - $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)\ctb_dll_gpib.o: ./../src/gpib.cpp - $(CXX) -c -o $@ $(CTB_DLL_CXXFLAGS) $(CPPDEPS) $< - -$(OUTPUT)\ctbtest_ctbtest.o: ./../samples/ctbtest.cpp - $(CXX) -c -o $@ $(CTBTEST_CXXFLAGS) $(CPPDEPS) $< - -.PHONY: all clean - - -SHELL := $(COMSPEC) - -# Dependencies tracking: --include $(OUTPUT)/*.d diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.vc b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.vc deleted file mode 100644 index 6b773f429b..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.vc +++ /dev/null @@ -1,260 +0,0 @@ -# ========================================================================= -# This makefile was generated by -# Bakefile 0.2.5 (http://www.bakefile.org) -# Do not modify, all changes will be overwritten! -# ========================================================================= - - - -# ------------------------------------------------------------------------- -# These are configurable options: -# ------------------------------------------------------------------------- - -# C++ compiler -CXX = cl - -# Standard flags for C++ -CXXFLAGS = - -# Standard preprocessor flags (common for CC and CXX) -CPPFLAGS = - -# Standard linker flags -LDFLAGS = - -# Set to 1 to build debug version [0,1] -# 0 - Release -# 1 - Debug -DEBUG = 0 - -# -GPIB = 0 - -# -WXDIR = $(WXWIN) - -# -INSTALLDIR = $(WXWIN) - - - -# ------------------------------------------------------------------------- -# Do not modify the rest of this file! -# ------------------------------------------------------------------------- - -### Variables: ### - -CTB_LIB_CXXFLAGS = /MD$(____DEBUG_4) /DWIN32 $(____DEBUG) $(____DEBUG_2) \ - $(______DEBUG) /Fd..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.pdb \ - $(__OPTIMIZE_FLAG) /I..\include /GR /EHsc $(CPPFLAGS) $(CXXFLAGS) -CTB_LIB_OBJECTS = \ - $(OUTPUT)\ctb_lib_fifo.obj \ - $(OUTPUT)\ctb_lib_getopt.obj \ - $(OUTPUT)\ctb_lib_iobase.obj \ - $(OUTPUT)\ctb_lib_portscan.obj \ - $(OUTPUT)\ctb_lib_serportx.obj \ - $(OUTPUT)\ctb_lib_serport.obj \ - $(OUTPUT)\ctb_lib_timer.obj \ - $(____GPIBSRC_FILENAMES_OBJECTS) -CTB_DLL_CXXFLAGS = /MD$(____DEBUG_4) /DWIN32 $(____DEBUG) $(____DEBUG_2) \ - $(______DEBUG) /Fd..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.pdb \ - $(__OPTIMIZE_FLAG) /I..\include /GR /EHsc $(CPPFLAGS) $(CXXFLAGS) -CTB_DLL_OBJECTS = \ - $(OUTPUT)\ctb_dll_fifo.obj \ - $(OUTPUT)\ctb_dll_getopt.obj \ - $(OUTPUT)\ctb_dll_iobase.obj \ - $(OUTPUT)\ctb_dll_portscan.obj \ - $(OUTPUT)\ctb_dll_serportx.obj \ - $(OUTPUT)\ctb_dll_serport.obj \ - $(OUTPUT)\ctb_dll_timer.obj \ - $(____GPIBSRC_FILENAMES_1_OBJECTS) -CTBTEST_CXXFLAGS = /MD$(____DEBUG_4) /DWIN32 $(____DEBUG) $(____DEBUG_2) \ - $(______DEBUG) /Fd$(OUTPUT)\ctbtest.pdb /DGPIB=$(GPIB) $(__OPTIMIZE_FLAG) \ - /I..\include /GR /EHsc $(CPPFLAGS) $(CXXFLAGS) -CTBTEST_OBJECTS = \ - $(OUTPUT)\ctbtest_ctbtest.obj - -### Conditionally set variables: ### - -!if "$(DEBUG)" == "0" -OUTPUT = release -!endif -!if "$(DEBUG)" == "1" -OUTPUT = debug -!endif -!if "$(WXDIR)" == "" -INSTALLDIR = ..\lib -!endif -!if "$(DEBUG)" == "1" -LIBFLAG = d -!endif -!if "$(GPIB)" == "1" -GPIBFLAG = _gpib -!endif -!if "$(GPIB)" == "1" -____GPIBSRC_FILENAMES_OBJECTS = \ - $(OUTPUT)\ctb_lib_gpib.obj -!endif -!if "$(GPIB)" == "1" -____GPIBSRC_FILENAMES_1_OBJECTS = \ - $(OUTPUT)\ctb_dll_gpib.obj -!endif -!if "$(DEBUG)" == "0" -____DEBUG = /DNDEBUG -!endif -!if "$(DEBUG)" == "1" -____DEBUG = -!endif -!if "$(DEBUG)" == "0" -____DEBUG_2 = -!endif -!if "$(DEBUG)" == "1" -____DEBUG_2 = /Zi -!endif -!if "$(DEBUG)" == "0" -____DEBUG_3 = -!endif -!if "$(DEBUG)" == "1" -____DEBUG_3 = /DEBUG -!endif -!if "$(DEBUG)" == "0" -______DEBUG = -!endif -!if "$(DEBUG)" == "1" -______DEBUG = /D_DEBUG -!endif -!if "$(DEBUG)" == "0" -____DEBUG_4 = -!endif -!if "$(DEBUG)" == "1" -____DEBUG_4 = d -!endif -!if "$(DEBUG)" == "0" -__OPTIMIZE_FLAG = /Od -!endif -!if "$(DEBUG)" == "1" -__OPTIMIZE_FLAG = /O2 -!endif -!if "$(GPIB)" == "1" -__SYSLIB2_p = gpib32.lib -!endif - - -all: $(OUTPUT) -$(OUTPUT): - -if not exist $(OUTPUT) mkdir $(OUTPUT) - -### Targets: ### - -all: ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(OUTPUT)\ctbtest.exe tip-win32 - -clean: - -if exist $(OUTPUT)\*.obj del $(OUTPUT)\*.obj - -if exist $(OUTPUT)\*.res del $(OUTPUT)\*.res - -if exist $(OUTPUT)\*.pch del $(OUTPUT)\*.pch - -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib - -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll - -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ilk del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.ilk - -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.pdb del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.pdb - -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib - -if exist $(OUTPUT)\ctbtest.exe del $(OUTPUT)\ctbtest.exe - -if exist $(OUTPUT)\ctbtest.ilk del $(OUTPUT)\ctbtest.ilk - -if exist $(OUTPUT)\ctbtest.pdb del $(OUTPUT)\ctbtest.pdb - -..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib: $(CTB_LIB_OBJECTS) - if exist $@ del $@ - link /LIB /NOLOGO /OUT:$@ @<< - $(CTB_LIB_OBJECTS) -<< - -..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll: $(CTB_DLL_OBJECTS) - link /DLL /NOLOGO /OUT:$@ $(____DEBUG_3) /pdb:"..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.pdb" /LIBPATH:..\lib $(LDFLAGS) @<< - $(CTB_DLL_OBJECTS) winmm.lib $(__SYSLIB2_p) /IMPLIB:..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib -<< - -$(OUTPUT)\ctbtest.exe: $(CTBTEST_OBJECTS) ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib - link /NOLOGO /OUT:$@ $(____DEBUG_3) /pdb:"$(OUTPUT)\ctbtest.pdb" /LIBPATH:..\lib $(LDFLAGS) @<< - $(CTBTEST_OBJECTS) ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib winmm.lib $(__SYSLIB2_p) -<< - -wxinstall: - @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib $(INSTALLDIR)\lib\vc_lib - @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(INSTALLDIR)\lib\vc_lib - - @if not exist $(INSTALLDIR)\include\ctb-0.16\win32 mkdir $(INSTALLDIR)\include\ctb-0.16\win32 - @copy ..\include\ctb-0.16\*.h $(INSTALLDIR)\include\ctb-0.16 - @copy ..\include\ctb-0.16\win32\*.h $(INSTALLDIR)\include\ctb-0.16\win32 - -tip-win32: - @echo " " - @echo "================================================================" - @echo " The building of ctb is finished. If you have an installed " - @echo " wxWidget package (WXWIN must be defined in the enviroment), " - @echo " you'll now have to run: " - @echo " " - @echo " make DEBUG=$(DEBUG) GPIB=$(GPIB) wxinstall " - @echo " " - @echo " to install the libraries in: " - @echo " $(INSTALLDIR)\lib\vc_lib " - @echo " and the header files in" - @echo " $(INSTALLDIR)\ctb-0.16" - @echo " " - @echo " If you are using another compiler (Borland, Watcom, mingw,...) " - @echo " take a look in the README in this directory! " - @echo " " - @echo " ctb comes with no guarantees and doesn't claim " - @echo " to be suitable for any purpose. " - @echo "================================================================" - @echo " " - -$(OUTPUT)\ctb_lib_fifo.obj: .\..\src\fifo.cpp - $(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\fifo.cpp - -$(OUTPUT)\ctb_lib_getopt.obj: .\..\src\getopt.cpp - $(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\getopt.cpp - -$(OUTPUT)\ctb_lib_iobase.obj: .\..\src\iobase.cpp - $(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\iobase.cpp - -$(OUTPUT)\ctb_lib_portscan.obj: .\..\src\portscan.cpp - $(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\portscan.cpp - -$(OUTPUT)\ctb_lib_serportx.obj: .\..\src\serportx.cpp - $(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\serportx.cpp - -$(OUTPUT)\ctb_lib_serport.obj: .\..\src\win32\serport.cpp - $(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\win32\serport.cpp - -$(OUTPUT)\ctb_lib_timer.obj: .\..\src\win32\timer.cpp - $(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\win32\timer.cpp - -$(OUTPUT)\ctb_lib_gpib.obj: .\..\src\gpib.cpp - $(CXX) /c /nologo /TP /Fo$@ $(CTB_LIB_CXXFLAGS) .\..\src\gpib.cpp - -$(OUTPUT)\ctb_dll_fifo.obj: .\..\src\fifo.cpp - $(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\fifo.cpp - -$(OUTPUT)\ctb_dll_getopt.obj: .\..\src\getopt.cpp - $(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\getopt.cpp - -$(OUTPUT)\ctb_dll_iobase.obj: .\..\src\iobase.cpp - $(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\iobase.cpp - -$(OUTPUT)\ctb_dll_portscan.obj: .\..\src\portscan.cpp - $(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\portscan.cpp - -$(OUTPUT)\ctb_dll_serportx.obj: .\..\src\serportx.cpp - $(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\serportx.cpp - -$(OUTPUT)\ctb_dll_serport.obj: .\..\src\win32\serport.cpp - $(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\win32\serport.cpp - -$(OUTPUT)\ctb_dll_timer.obj: .\..\src\win32\timer.cpp - $(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\win32\timer.cpp - -$(OUTPUT)\ctb_dll_gpib.obj: .\..\src\gpib.cpp - $(CXX) /c /nologo /TP /Fo$@ $(CTB_DLL_CXXFLAGS) .\..\src\gpib.cpp - -$(OUTPUT)\ctbtest_ctbtest.obj: .\..\samples\ctbtest.cpp - $(CXX) /c /nologo /TP /Fo$@ $(CTBTEST_CXXFLAGS) .\..\samples\ctbtest.cpp - diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.wat b/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.wat deleted file mode 100644 index 5041ddac36..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/build/makefile.wat +++ /dev/null @@ -1,283 +0,0 @@ -# ========================================================================= -# This makefile was generated by -# Bakefile 0.2.5 (http://www.bakefile.org) -# Do not modify, all changes will be overwritten! -# ========================================================================= - - - -# ------------------------------------------------------------------------- -# These are configurable options: -# ------------------------------------------------------------------------- - -# C++ compiler -CXX = wpp386 - -# Standard flags for C++ -CXXFLAGS = - -# Standard preprocessor flags (common for CC and CXX) -CPPFLAGS = - -# Standard linker flags -LDFLAGS = - -# Set to 1 to build debug version [0,1] -# 0 - Release -# 1 - Debug -DEBUG = 0 - -# -GPIB = 0 - -# -WXDIR = $(%WXWIN) - -# -INSTALLDIR = $(%WXWIN) - - - -# ------------------------------------------------------------------------- -# Do not modify the rest of this file! -# ------------------------------------------------------------------------- - -# Speed up compilation a bit: -!ifdef __LOADDLL__ -! loaddll wcc wccd -! loaddll wccaxp wccdaxp -! loaddll wcc386 wccd386 -! loaddll wpp wppdi86 -! loaddll wppaxp wppdaxp -! loaddll wpp386 wppd386 -! loaddll wlink wlink -! loaddll wlib wlibd -!endif - -# We need these variables in some bakefile-made rules: -WATCOM_CWD = $+ $(%cdrive):$(%cwd) $- - -### Conditionally set variables: ### - -OUTPUT = -!ifeq DEBUG 0 -OUTPUT = release -!endif -!ifeq DEBUG 1 -OUTPUT = debug -!endif -INSTALLDIR = -!ifeq WXDIR -INSTALLDIR = ..\lib -!endif -LIBFLAG = -!ifeq DEBUG 1 -LIBFLAG = d -!endif -GPIBFLAG = -!ifeq GPIB 1 -GPIBFLAG = _gpib -!endif -____GPIBSRC_FILENAMES_OBJECTS = -!ifeq GPIB 1 -____GPIBSRC_FILENAMES_OBJECTS = & - $(OUTPUT)\ctb_lib_gpib.obj -!endif -____GPIBSRC_FILENAMES_1_OBJECTS = -!ifeq GPIB 1 -____GPIBSRC_FILENAMES_1_OBJECTS = & - $(OUTPUT)\ctb_dll_gpib.obj -!endif -____DEBUG = -!ifeq DEBUG 0 -____DEBUG = -dNDEBUG -!endif -!ifeq DEBUG 1 -____DEBUG = -!endif -____DEBUG_0 = -!ifeq DEBUG 0 -____DEBUG_0 = -d0 -!endif -!ifeq DEBUG 1 -____DEBUG_0 = -d2 -!endif -____DEBUG_2 = -!ifeq DEBUG 0 -____DEBUG_2 = -!endif -!ifeq DEBUG 1 -____DEBUG_2 = debug all -!endif -__OPTIMIZE_FLAG = -!ifeq DEBUG 0 -__OPTIMIZE_FLAG = -od -!endif -!ifeq DEBUG 1 -__OPTIMIZE_FLAG = -ot -ox -!endif -__SYSLIB2_p = -!ifeq GPIB 1 -__SYSLIB2_p = gpib32.lib -!endif - -### Variables: ### - -CTB_LIB_CXXFLAGS = $(____DEBUG) $(____DEBUG_0) -bm $(__OPTIMIZE_FLAG) & - -i=..\include $(CPPFLAGS) $(CXXFLAGS) -CTB_LIB_OBJECTS = & - $(OUTPUT)\ctb_lib_fifo.obj & - $(OUTPUT)\ctb_lib_getopt.obj & - $(OUTPUT)\ctb_lib_iobase.obj & - $(OUTPUT)\ctb_lib_portscan.obj & - $(OUTPUT)\ctb_lib_serportx.obj & - $(OUTPUT)\ctb_lib_serport.obj & - $(OUTPUT)\ctb_lib_timer.obj & - $(____GPIBSRC_FILENAMES_OBJECTS) -CTB_DLL_CXXFLAGS = -bd $(____DEBUG) $(____DEBUG_0) -bm $(__OPTIMIZE_FLAG) & - -i=..\include $(CPPFLAGS) $(CXXFLAGS) -CTB_DLL_OBJECTS = & - $(OUTPUT)\ctb_dll_fifo.obj & - $(OUTPUT)\ctb_dll_getopt.obj & - $(OUTPUT)\ctb_dll_iobase.obj & - $(OUTPUT)\ctb_dll_portscan.obj & - $(OUTPUT)\ctb_dll_serportx.obj & - $(OUTPUT)\ctb_dll_serport.obj & - $(OUTPUT)\ctb_dll_timer.obj & - $(____GPIBSRC_FILENAMES_1_OBJECTS) -CTBTEST_CXXFLAGS = $(____DEBUG) $(____DEBUG_0) -dGPIB=$(GPIB) -bm & - $(__OPTIMIZE_FLAG) -i=..\include $(CPPFLAGS) $(CXXFLAGS) -CTBTEST_OBJECTS = & - $(OUTPUT)\ctbtest_ctbtest.obj - - -all : $(OUTPUT) -$(OUTPUT) : - -if not exist $(OUTPUT) mkdir $(OUTPUT) - -### Targets: ### - -all : .SYMBOLIC ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(OUTPUT)\ctbtest.exe tip-win32 - -clean : .SYMBOLIC - -if exist $(OUTPUT)\*.obj del $(OUTPUT)\*.obj - -if exist $(OUTPUT)\*.res del $(OUTPUT)\*.res - -if exist $(OUTPUT)\*.lbc del $(OUTPUT)\*.lbc - -if exist $(OUTPUT)\*.ilk del $(OUTPUT)\*.ilk - -if exist $(OUTPUT)\*.pch del $(OUTPUT)\*.pch - -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib - -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll - -if exist ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib del ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib - -if exist $(OUTPUT)\ctbtest.exe del $(OUTPUT)\ctbtest.exe - -..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib : $(CTB_LIB_OBJECTS) - @%create $(OUTPUT)\ctb_lib.lbc - @for %i in ($(CTB_LIB_OBJECTS)) do @%append $(OUTPUT)\ctb_lib.lbc +%i - wlib -q -p4096 -n -b $^@ @$(OUTPUT)\ctb_lib.lbc - -..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll : $(CTB_DLL_OBJECTS) - @%create $(OUTPUT)\ctb_dll.lbc - @%append $(OUTPUT)\ctb_dll.lbc option quiet - @%append $(OUTPUT)\ctb_dll.lbc name $^@ - @%append $(OUTPUT)\ctb_dll.lbc option caseexact - @%append $(OUTPUT)\ctb_dll.lbc $(____DEBUG_2) libpath ..\lib $(LDFLAGS) - @for %i in ($(CTB_DLL_OBJECTS)) do @%append $(OUTPUT)\ctb_dll.lbc file %i - @for %i in ( winmm.lib $(__SYSLIB2_p)) do @%append $(OUTPUT)\ctb_dll.lbc library %i - @%append $(OUTPUT)\ctb_dll.lbc - @%append $(OUTPUT)\ctb_dll.lbc system nt_dll - wlink @$(OUTPUT)\ctb_dll.lbc - wlib -q -n -b ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib +$^@ - -$(OUTPUT)\ctbtest.exe : $(CTBTEST_OBJECTS) ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib - @%create $(OUTPUT)\ctbtest.lbc - @%append $(OUTPUT)\ctbtest.lbc option quiet - @%append $(OUTPUT)\ctbtest.lbc name $^@ - @%append $(OUTPUT)\ctbtest.lbc option caseexact - @%append $(OUTPUT)\ctbtest.lbc $(____DEBUG_2) libpath ..\lib $(LDFLAGS) - @for %i in ($(CTBTEST_OBJECTS)) do @%append $(OUTPUT)\ctbtest.lbc file %i - @for %i in ( ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib winmm.lib $(__SYSLIB2_p)) do @%append $(OUTPUT)\ctbtest.lbc library %i - @%append $(OUTPUT)\ctbtest.lbc - @for %i in () do @%append $(OUTPUT)\ctbtest.lbc option stack=%i - wlink @$(OUTPUT)\ctbtest.lbc - -wxinstall : - @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.lib $(INSTALLDIR)\lib\watcom_lib - @copy ..\lib\ctb$(LIBFLAG)$(GPIBFLAG)-0.16.dll $(INSTALLDIR)\lib\watcom_lib - - @if not exist $(INSTALLDIR)\include\ctb-0.16\win32 mkdir $(INSTALLDIR)\include\ctb-0.16\win32 - @copy ..\include\ctb-0.16\*.h $(INSTALLDIR)\include\ctb-0.16 - @copy ..\include\ctb-0.16\win32\*.h $(INSTALLDIR)\include\ctb-0.16\win32 - -tip-win32 : - @echo " " - @echo "================================================================" - @echo " The building of ctb is finished. If you have an installed " - @echo " wxWidget package (WXWIN must be defined in the enviroment), " - @echo " you'll now have to run: " - @echo " " - @echo " make DEBUG=$(DEBUG) GPIB=$(GPIB) wxinstall " - @echo " " - @echo " to install the libraries in: " - @echo " $(INSTALLDIR)\lib\watcom_lib " - @echo " and the header files in" - @echo " $(INSTALLDIR)\ctb-0.16" - @echo " " - @echo " If you are using another compiler (Borland, Watcom, mingw,...) " - @echo " take a look in the README in this directory! " - @echo " " - @echo " ctb comes with no guarantees and doesn't claim " - @echo " to be suitable for any purpose. " - @echo "================================================================" - @echo " " - -$(OUTPUT)\ctb_lib_fifo.obj : .AUTODEPEND .\..\src\fifo.cpp - $(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $< - -$(OUTPUT)\ctb_lib_getopt.obj : .AUTODEPEND .\..\src\getopt.cpp - $(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $< - -$(OUTPUT)\ctb_lib_iobase.obj : .AUTODEPEND .\..\src\iobase.cpp - $(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $< - -$(OUTPUT)\ctb_lib_portscan.obj : .AUTODEPEND .\..\src\portscan.cpp - $(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $< - -$(OUTPUT)\ctb_lib_serportx.obj : .AUTODEPEND .\..\src\serportx.cpp - $(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $< - -$(OUTPUT)\ctb_lib_serport.obj : .AUTODEPEND .\..\src\win32\serport.cpp - $(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $< - -$(OUTPUT)\ctb_lib_timer.obj : .AUTODEPEND .\..\src\win32\timer.cpp - $(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $< - -$(OUTPUT)\ctb_lib_gpib.obj : .AUTODEPEND .\..\src\gpib.cpp - $(CXX) -bt=nt -zq -fo=$^@ $(CTB_LIB_CXXFLAGS) $< - -$(OUTPUT)\ctb_dll_fifo.obj : .AUTODEPEND .\..\src\fifo.cpp - $(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $< - -$(OUTPUT)\ctb_dll_getopt.obj : .AUTODEPEND .\..\src\getopt.cpp - $(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $< - -$(OUTPUT)\ctb_dll_iobase.obj : .AUTODEPEND .\..\src\iobase.cpp - $(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $< - -$(OUTPUT)\ctb_dll_portscan.obj : .AUTODEPEND .\..\src\portscan.cpp - $(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $< - -$(OUTPUT)\ctb_dll_serportx.obj : .AUTODEPEND .\..\src\serportx.cpp - $(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $< - -$(OUTPUT)\ctb_dll_serport.obj : .AUTODEPEND .\..\src\win32\serport.cpp - $(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $< - -$(OUTPUT)\ctb_dll_timer.obj : .AUTODEPEND .\..\src\win32\timer.cpp - $(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $< - -$(OUTPUT)\ctb_dll_gpib.obj : .AUTODEPEND .\..\src\gpib.cpp - $(CXX) -bt=nt -zq -fo=$^@ $(CTB_DLL_CXXFLAGS) $< - -$(OUTPUT)\ctbtest_ctbtest.obj : .AUTODEPEND .\..\samples\ctbtest.cpp - $(CXX) -bt=nt -zq -fo=$^@ $(CTBTEST_CXXFLAGS) $< - diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/ctb.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/ctb.h deleted file mode 100644 index c71929f2be..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/ctb.h +++ /dev/null @@ -1,139 +0,0 @@ -#ifndef LIBCTB_CTB_H_INCLUDED_ -#define LIBCTB_CTB_H_INCLUDED_ - -#include "ctb-0.16/fifo.h" -#if ( GPIB ) -# include "ctb-0.16/gpib.h" -#endif -#include "ctb-0.16/getopt.h" -#include "ctb-0.16/iobase.h" -//#include "ctb-0.16/kbhit.h" -#include "ctb-0.16/portscan.h" -#include "ctb-0.16/serport.h" -#include "ctb-0.16/serportx.h" -#include "ctb-0.16/timer.h" - -/*! - \mainpage ctb overview - - The ctb (communication toolbox) library was realized, to simplify the - communication with other instruments throughout the serial com ports - (at first). To make my life easier, it should works with Linux and - all win32 plattforms (excepted windows 3.1, which is a only 16bit OS) - because I develope my applications for both plattforms).\n - Some times later GPIB support was added to make ctb an integrated part - for the extensive test and calibration system of a company I worked - these days.\n - The main goal of the library was a non-blocked communication to avoid - frozen GUIs waiting for data which in some conditions never arrives. - - On the base ctb defines an abstract class IOBase, which must be - derivate for several interfaces (at now this was done for the - RS232 comports and GPIB IEEE488 interface). - - This leads to another feature: Because all classes depends on one - super class, you have just open your wanted interface and don't - worry about it's special typ later. This is like the 'Virtual - Instrument' featured by Nation Instruments LabView. - - Last not least: ctb provides one written code for Linux and Windows - (compiles well with GNU G++ and VC++). Without any dependences (execept - for a standard C++ compilier) ctb runs also in small enviroments like - embedded systems and doesn't need any graphic stuff for use. - - ctb is composed of five parts: - - - ctb::IOBase class - - ctb::SerialPort class - - ctb::GpibDevice class - - ctb::Timer class - - ctb::Fifo class - - \section IOBase IOBase class - - An abstract class for different interfaces. The idea behind this: - Similar to the virtual file system this class defines a lot of - preset member functions, which the derivate classes must be - overload.\n - In the main thing these are: open a interface (such as RS232), - reading and writing non blocked through the interface and at - last, close it.\n - For special interface settings the method ioctl was defined. - (control interface). ioctl covers some interface dependent - settings like switch on/off the RS232 status lines and must also - be defined from each derivated class. - - - \section SerialPort SerialPort class - - The class for the serial ports is named as - ctb::SerialPort. SerialPort is a wrapper for non blocked reading and - writing. This is easy under linux, but with windows a lot more - tricky. SerialPort is as simple as possible. It doesn't create any - gui events or signals, so it works also standalone. It's also not a - device driver, means, you must call the read method, if you look for - receiving data. - - You can write any desired data with any length (length type is - size_t, I think, on win32 and linux this is a 32Bit integer) and - SerialPort returns the really writen data length, also you can read - a lot of data and SerialPort returns the really received data count. - - Both, read and write returns immediatelly. Using these, the program - never blocks. Also IOBase implements a blocked read and write. You can - use these functions, if you want a definitiv count of data and never - accept less than this. Because there is a difficulty, when the - communication is interrupted or death, both blocked functions get a - timeout flag to returns after a given time interval. The timeouts - will be handled with the second timer class. - - As an additional benefit ctb features also 9 Bit transmission (with - take advantage of the parity bit), non-standard baudrates (depending - on your hardware but not on ctb) and all parity eventualities - including static parity settings like Mark and Space. - - \section GpibDevice GpibDevice class - - Named as ctb::GpibDevice. In the philosophy of the SerialPort class - GpibDevice also supports non-blocking communication. You can instant - as many GpibDevice objects as you need for instance to communicate - with a lot of different bus participants in a typical GPIB enviroment. - GPIB support was tested with PCI cards and USB adapter from Nation - Instrument and Keithley. - - \section Timer Timer class - - The idea of the ctb::Timer class is to base on the Unix C alarm - function. You create a Timer with a given alarm time and a adress of - flag, which the timer must set after the time is over. - - Because the alarm function cannot used more than once in the same - process (under windows I don't know a similar function), every timer - instance will be a separate thread after starting it. So you can start - a timer and continue in your program, make a lot of things and test - the flag whenever you want this. (For example, you read/write a - given count of data). - - \note - I think, it's a better style, to request a given count of data in - 100ms (for example) and trap the situation, if there are not enough - data after this time. And not do this for every byte! - - \section Fifo Fifo cass - Provides a simple thread safe fifo to realize a fast and simple - communication pipe between two threads (and was used also as a put - back mechanism for the wxIOBase and it's derivated classes).\n - ctb::Fifo tackles the concurrently access from different threads with an - internal temporary pointer asignment which was atomic. From there no - mutex or semaphore is involved and lead to a fast access. - - Please note:\n - The thread safeness is limited to the put/get write/read methods but - which should be sufficent for a fifo. - - - \latexonly \newpage \endlatexonly - - */ - -#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/fifo.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/fifo.h deleted file mode 100644 index d17079d4a2..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/fifo.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef __LIBCTB_FIFO_H_INCLUDED_ -#define __LIBCTB_FIFO_H_INCLUDED_ - -///////////////////////////////////////////////////////////////////////////// -// Name: fifo.h -// Purpose: -// Author: Joachim Buermann, Michael Hungershausen -// Copyright: (c) 2010 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include - -/** - \file fifo.h -*/ - -namespace ctb { - -/*! - \class Fifo - A simple thread safe fifo to realize a put back mechanism for the - wxIOBase and it's derivated classes. -*/ - class Fifo - { - protected: - /*! the size of the fifo */ - size_t m_size; - /*! the start of the internal fifo buffer */ - char* m_begin; - /*! - the end of the internal fifo buffer (m_end marks the first - invalid byte AFTER the internal buffer) - */ - char* m_end; - /*! the current read position */ - char* m_rdptr; - /*! the current write position */ - char* m_wrptr; - public: - /*! - \brief the constructor initialize a fifo with the given size. - \param size size of the fifo - */ - Fifo(size_t size); - /*! - \brief the destructor destroys all internal memory. - */ - virtual ~Fifo(); - /*! - \brief clear all internal memory and set the read and write - pointers to the start of the internal memory. - \Note This function is not thread safe! Don't use it, if another - thread takes access to the fifo instance. Use a looping get() or - read() call instead of this. - */ - virtual void clear(); - /*! - \brief fetch the next available byte from the fifo. - \param ch points to a charater to store the result - \return 1 if successful, 0 otherwise - */ - virtual int get(char* ch); - /*! - \brief query the fifo for it's available bytes. - \return count of readable bytes, storing in the fifo - */ - size_t items(); - /*! - \brief put a character into the fifo. - \param ch the character to put in - \return 1 if successful, 0 otherwise - */ - virtual int put(char ch); - /*! - \brief read a given count of bytes out of the fifo. - \param data memory to store the readed data - \param count number of bytes to read - \return On success, the number of bytes read are returned, - 0 otherwise - */ - virtual int read(char* data,int count); - /*! - \brief write a given count of bytes into the fifo. - \param data start of the data to write - \param count number of bytes to write - \return On success, the number of bytes written are returned, - 0 otherwise - */ - virtual int write(char* data,int count); - }; - -} // namespace ctb - -#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/getopt.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/getopt.h deleted file mode 100644 index 2efd341889..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/getopt.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef LIBCTB_GETOPT_H_INCLUDED_ -#define LIBCTB_GETOPT_H_INCLUDED_ - -///////////////////////////////////////////////////////////////////////////// -// Name: getopt.h -// Purpose: Simple wrapper file -// Author: Joachim Buermann -// Copyright: (c) 2010 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#if defined (WIN32) -# include "win32/getopt.h" -#else -# include -#endif - -#endif -// __WX_GETOPT_H diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/gpib.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/gpib.h deleted file mode 100644 index 1d360a8c49..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/gpib.h +++ /dev/null @@ -1,378 +0,0 @@ -#ifndef LIBCTB_GPIB_H_INCLUDED_ -#define LIBCTB_GPIB_H_INCLUDED_ - -///////////////////////////////////////////////////////////////////////////// -// Name: gpibx.h -// Purpose: base class for gpib devices -// Author: Joachim Buermann -// Copyright: (c) 2010 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "ctb-0.16/iobase.h" - -namespace ctb { - -/*! - \file gpib.h -*/ - - /*! defines the os specific name for the first gpib controller */ - extern const char* GPIB1; - - /*! defines the os specific name for the second gpib controller */ - extern const char* GPIB2; - - /*! - \enum GpibTimeout - NI488.2 API defines the following valid timeouts. - */ - enum GpibTimeout - { - /// no timeout (infinity) - GpibTimeoutNone = 0, - /// 10 micro seconds - GpibTimeout10us, - /// 30 micro seconds - GpibTimeout30us, - /// 100 micro seconds - GpibTimeout100us, - /// 300 micro seconds - GpibTimeout300us, - /// 1 milli second - GpibTimeout1ms, - /// 3 milli seconds - GpibTimeout3ms, - /// 10 milli seconds - GpibTimeout10ms, - /// 30 milli seconds - GpibTimeout30ms, - /// 0.1 seconds - GpibTimeout100ms, - /// 0.3 seconds - GpibTimeout300ms, - /// 1 second - GpibTimeout1s, - /// 3 seconds - GpibTimeout3s, - /// 10 seconds - GpibTimeout10s, - /// 30 seconds - GpibTimeout30s, - /// 100 seconds - GpibTimeout100s, - /// 300 seconds (5 minutes) - GpibTimeout300s, - /// 1000 seconds - GpibTimeout1000s - }; - - /*! - \struct Gpib_DCS - - The device control struct for the gpib communication class. - This struct should be used, if you refer advanced parameter. - */ - struct Gpib_DCS - { - /*! primary address of GPIB device */ - int m_address1; - /*! secondary address of GPIB device */ - int m_address2; - /*! I/O timeout */ - GpibTimeout m_timeout; - /*! EOT enable */ - bool m_eot; - /*! - Defines the EOS character. - Note! Defining an EOS byte does not cause the driver to - automatically send that byte at the end of write I/O - operations. The application is responsible for placing the - EOS byte at the end of the data strings that it defines. - (National Instruments NI-488.2M Function Reference Manual) - */ - unsigned char m_eosChar; - /*! - Set the EOS mode (handling).m_eosMode may be a combination - of bits ORed together. The following bits can be used: - 0x04: Terminate read when EOS is detected. - 0x08: Set EOI (End or identify line) with EOS on write function - 0x10: Compare all 8 bits of EOS byte rather than low 7 bits - (all read and write functions). - */ - unsigned char m_eosMode; - /*! buffer for internal use */ - char m_buf[32]; - /*! to avoid memory leak warnings generated by swig */ - ~Gpib_DCS() {}; - /*! - \brief the constructor initiate the device control struct with - the common useful values and set the internal timeout for the - GPIB controller to 1ms to avoid (or better reduce) blocking - */ - Gpib_DCS() { - /*! set default device address to 1 */ - m_address1 = 1; - m_address2 = 0; - /*! - set the timeout to a short value to avoid blocking - (default are 1msec) - */ - m_timeout = GpibTimeout1ms; - m_eot = true; - /*! EOS character, see above! */ - m_eosChar = 0;//'\n'; - /*! EOS mode, see above! */ - m_eosMode = 0; - }; - /*! - \brief returns the internal parameters in a more human readable - string format like 'Adr: (1,0) to:1ms'. - \return the settings as a null terminated string - */ - char* GetSettings(); - }; - -/*! - \enum GpibIoctls - - The following Ioctl calls are only valid for the GpibDevice class. -*/ - enum GpibIoctls { - /*! - Set the adress of the via gpib connected device. - */ - CTB_GPIB_SETADR = CTB_GPIB, - /*! - Get the serial poll byte - */ - CTB_GPIB_GETRSP, - /*! - Get the GPIB status - */ - CTB_GPIB_GETSTA, - /*! - Get the last GPIB error number - */ - CTB_GPIB_GETERR, - /*! - Get the GPIB line status (hardware control lines) as an - integer. The lowest 8 bits correspond to the current state - of the lines. - */ - CTB_GPIB_GETLINES, - /*! - Set the GPIB specific timeout - */ - CTB_GPIB_SETTIMEOUT, - /*! - Forces the specified device to go to local program mode - */ - CTB_GPIB_GTL, - /*! - This routine can only be used if the specified GPIB - Interface Board is the System Controller. - Remember that even though the REN line is asserted, - the device(s) will not be put into remote state until is - addressed to listen by the Active Controller - */ - CTB_GPIB_REN, - /*! - The command asserts the GPIB interface clear (IFC) line for - ast least 100us if the GPIB board is the system controller. - This initializes the GPIB and makes the interface CIC and - active controller with ATN asserted. - Note! The IFC signal resets only the GPIB interface functions - of the bus devices and not the internal device functions. - For a device reset you should use the CTB_RESET command above. - */ - CTB_GPIB_RESET_BUS, - /*! - Configure the end-of-string (EOS) termination character. - Note! Defining an EOS byte does not cause the driver to - automatically send that byte at the end of write I/O - operations. The application is responsible for placing the - EOS byte at the end of the data strings that it defines. - (National Instruments NI-488.2M Function Reference Manual) - */ - CTB_GPIB_SET_EOS_CHAR, - /*! - Get the internal EOS termination character (see above). - */ - CTB_GPIB_GET_EOS_CHAR, - /*! - Set the EOS mode (handling).m_eosMode may be a combination - of bits ORed together. The following bits can be used: - 0x04: Terminate read when EOS is detected. - 0x08: Set EOI (End or identify line) with EOS on write function - 0x10: Compare all 8 bits of EOS byte rather than low 7 bits - (all read and write functions). - */ - CTB_GPIB_SET_EOS_MODE, - /*! - Get the internal EOS mode (see above). - */ - CTB_GPIB_GET_EOS_MODE, - }; - -/*! - \class GpibDevice - GpibDevice is the basic class for communication via the GPIB bus. -*/ - class GpibDevice : public IOBase - { - protected: - /*! - \brief - the internal board identifier, 0 for the first gpib controller, - 1 for the second one - */ - int m_board; - /*! - \brief - the file descriptor of the connected gpib device - */ - int m_hd; - /*! - \brief - contains the internal conditions of the GPIB communication like - GPIB error, timeout and so on... - */ - int m_state; - /*! the internal GPIB error number */ - int m_error; - /*! the count of data read or written */ - int m_count; - /*! - \brief contains the internal settings of the GPIB connection like - address, timeout, end of string character and so one... - */ - Gpib_DCS m_dcs; - int CloseDevice(); - /*! - \brief returns a short notation or more detail description of - the given GPIB error number. - \param error the occured GPIB error - \param detailed true for a more detailed description, false - otherwise - \return a null terminated string with the short or detailed - error message. - */ - virtual const char* GetErrorString(int error,bool detailed); - /*! - Open the interface (internally to request a file descriptor for the - given interface). The second parameter is a undefined pointer of a - Gpib_DCS data struct. - \param devname the name of the GPIB device, GPIB1 means the first - GPIB controller, GPIB2 the second (if available). - \param dcs untyped pointer of advanced device parameters, - \sa struct Gpib_DCS (data struct for the gpib device) - \return zero on success, otherwise -1 - */ - int OpenDevice(const char* devname, void* dcs); - public: - GpibDevice() { - m_board = -1; - m_hd = -1; - m_state = m_count = m_error = 0; - }; - virtual ~GpibDevice() {Close();}; - /*! - \brief returns the name of the class instance. You find this useful, - if you handle different devices like a serial port or a gpib device - via a IOBase pointer. - \return name of the class. - */ - const char* ClassName() {return "ctb::GpibDevice";}; - /*! - \brief returns a more detail description of the given error - number. - \param error the occured error number - \return null terminated string with the error description - */ - virtual const char* GetErrorDescription(int error) { - return GetErrorString(error,true); - }; - /*! - \brief returns a short notation like 'EABO' of the given error - number. - \param error the occured error number - \return null terminated string with the short error notation - */ - virtual const char* GetErrorNotation(int error) { - return GetErrorString(error,false); - }; - /*! - \brief request the current settings of the connected gpib device - as a null terminated string. - \return the settings as a string like 'Adr: (1,0) to:1ms' - */ - virtual char* GetSettingsAsString() { - return m_dcs.GetSettings(); - }; - /// This is only for internal usage - int Ibrd(char* buf,size_t len); - /// This is only for internal usage - int Ibwrt(char* buf,size_t len); - /*! - \brief Many operating characteristics are only possible for - special devices. To avoid the need of a lot of different functions - and to give the user a uniform interface, all this special - operating instructions will covered by one Ioctl methode (like - the linux ioctl call). - The Ioctl command (cmd) has encoded in it whether the argument - is an in parameter or out parameter, and the size of the - argument args in bytes. Macros and defines used in specifying an - ioctl request are located in iobase.h and the header file for - the derivated device (for example in gpib.h). - \param cmd one of GpibIoctls specify the ioctl request. - \param args is a typeless pointer to a memory location, where - Ioctl reads the request arguments or write the results. - Please note, that an invalid memory location or size involving - a buffer overflow or segmention fault! - */ - virtual int Ioctl(int cmd,void* args); - /*! - Returns the current state of the device. - \return 1 if device is valid and open, otherwise 0 - */ - int IsOpen() { - return m_hd >= 0; - }; - - /*! - \brief Opens a GPIB device in a user likely way. Insteed of - using the Device Control Struct just input your parameter in a - more intuitive manner. - \param devname the name of the GPIB controler like GPIB1 or GPIB2 - \param address the address of the connected device (1...31) - \return the new file descriptor, or -1 if an error occurred - */ - int Open( const char* devname, int address ); - - // Open overrides and hides the IOBase::Open( const char* - // devname, void* dcs ) of the base class! So bring it into scope - // again! - using IOBase::Open; - - int Read(char* buf,size_t len); - - int Write(char* buf,size_t len); - - /*! - \brief FindListener returns all listening devices connected to - the GPIB bus of the given board. - This function is not member of the GPIB class, becauce it - should do it's job before you open any GPIB connection. - \param board the board nummber. Default is the first board (=0). - Valid board numbers are 0 and 1. - \return -1 if an error occurred, otherwise a setting bit for - each listener address. Bit0 is always 0 (address 0 isn't valid, - Bit1 means address 1, Bit2 address 2 and so on... - */ - static int FindListeners(int board = 0); - }; - -} // namespace ctb - -#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/iobase.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/iobase.h deleted file mode 100644 index eda03b314f..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/iobase.h +++ /dev/null @@ -1,294 +0,0 @@ -#ifndef LIBCTB_IOBASE_H_INCLUDED_ -#define LIBCTB_IOBASE_H_INCLUDED_ - -///////////////////////////////////////////////////////////////////////////// -// Name: iobase.h -// Purpose: io basic class -// Author: Joachim Buermann -// Copyright: (c) 2010 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "ctb-0.16/fifo.h" -#include - -/** - \file iobase.h -*/ - -namespace ctb { - - enum { - - CTB_COMMON = 0x0000, - CTB_SERIAL = 0x0100, - CTB_GPIB = 0x0200, - CTB_TIMEOUT_INFINITY = 0xFFFFFFFF - }; - -// const unsigned int wxTIMEOUT_INFINITY = 0xFFFFFFFF; - -/*! - \enum IOBaseIoctls - - Defines the ioctl calls for derivated classes. The following Ioctl - calls are valid for all from wxIOBase derivated classes. -*/ - enum IOBaseIoctls { - /*! - Reset the connected device. For a serial (RS232) connection, - a break is send. For GPIB the IFC (Interface Clear) line is - set. - */ - CTB_RESET = CTB_COMMON - }; - -/*! - \class IOBase - An abstract class for different interfaces. The idea behind this: - Similar to the virtual file system this class defines a lot of - preset member functions, which the derivate classes must be - overload. - In the main thing these are: open a interface (such as RS232), - reading and writing non blocked through the interface and at - last, close it. - For special interface settings the method ioctl was defined. - (control interface). ioctl covers some interface dependent - settings like switch on/off the RS232 status lines and must also - be defined from each derivated class. -*/ - - class IOBase - { - protected: - /*! - \brief internal fifo (first in, first out queue) to put back - already readed bytes into the reading stream. After put back a single - byte or sequence of characters, you can read them again with the - next Read call. - */ - Fifo* m_fifo; - enum { - /// fifosize of the putback fifo - fifoSize = 256 - }; - /*! - Close the interface (internally the file descriptor, which was - connected with the interface). - \return zero on success, otherwise -1. - */ - virtual int CloseDevice() = 0; - /*! - Open the interface (internally to request a file descriptor for the - given interface). The second parameter is a undefined pointer of a - device dependent data struct. It must be undefined, because different - devices have different settings. A serial device like the com ports - points here to a data struct, includes information like baudrate, - parity, count of stopbits and wordlen and so on. Another devices - (for example a IEEE) needs a adress and EOS (end of string character) - and don't use baudrate or parity. - \param devname the name of the device, presents the given interface. - Under windows for example COM1, under Linux /dev/cua0. Use wxCOMn to - avoid plattform depended code (n is the serial port number, beginning - with 1). - \param dcs untyped pointer of advanced device parameters, - \sa struct dcs_devCUA (data struct for the serail com ports) - \return zero on success, otherwise -1 - */ - virtual int OpenDevice(const char* devname, void* dcs = 0L) = 0; - public: - /*! - Default constructor - */ - IOBase() { - m_fifo = new Fifo(fifoSize); - }; - - /*! - Default destructor - */ - virtual ~IOBase() { - delete m_fifo; - }; - /*! - \brief A little helper function to detect the class name - \return the name of the class - */ - virtual const char* ClassName() {return "ctb::IOBase";}; - /*! - Closed the interface. Internally it calls the CloseDevice() - method, which must be defined in the derivated class. - \return zero on success, or -1 if an error occurred. - */ - int Close() {return CloseDevice();}; - - /*! - In this method we can do all things, which are different - between the discrete interfaces. The method is similar to the - C ioctl function. We take a command number and a integer - pointer as command parameter. - An example for this is the reset of a connection between a PC - and one ore more other instruments. On serial (RS232) connections - mostly a break will be send, GPIB on the other hand defines a - special line on the GPIB bus, to reset all connected devices. - If you only want to reset your connection, you should use the - Ioctl methode for doing this, independent of the real type of - the connection. - \param cmd a command identifier, (under Posix such as TIOCMBIS - for RS232 interfaces), IOBaseIoctls - \param args typeless parameter pointer for the command above. - \return zero on success, or -1 if an error occurred. - */ - virtual int Ioctl(int cmd,void* args) {return -1;}; - - /*! - Returns the current state of the device. - \return 1 if device is valid and open, otherwise 0 - */ - virtual int IsOpen() = 0; - - /*! - \param devname name of the interface, we want to open - \param dcs a untyped pointer to a device control struct. If - he is NULL, the default device parameter will be used. - \return the new file descriptor, or -1 if an error occurred - - The pointer dcs will be used for special device dependent - settings. Because this is very specific, the struct or - destination of the pointer will be defined by every device - itself. (For example: a serial device class should refer - things like parity, word length and count of stop bits, - a IEEE class adress and EOS character). - */ - int Open(const char* devname,void* dcs=0L) { - return OpenDevice(devname,dcs); - }; - - /*! - \brief In some circumstances you want to put back a already - readed byte (for instance, you have overreaded it and like to - parse the recieving bytes again). - The internal fifo stores fifoSize characters until you - have to read again. - \param ch the character to put back in the input stream - \return 1, if successful, otherwise 0 - */ - int PutBack(char ch) { - return m_fifo->put(ch); - }; - - /*! - Read attempt to read len bytes from the interface into the buffer - starting with buf. Read never blocks. If there are no bytes for - reading, Read returns zero otherwise the count of bytes been readed. - \param buf starting adress of the buffer - \param len count of bytes, we want to read - \return -1 on fails, otherwise the count of readed bytes - */ - virtual int Read(char* buf,size_t len) = 0; - - /*! - \brief - ReadUntilEos read bytes from the interface until the EOS string - was received or a timeout occurs. - ReadUntilEos returns the count of bytes been readed. The received - bytes are stored on the heap point by the readbuf pointer and - must delete by the caller. - \param readbuf points to the start of the readed bytes. You must - delete them, also if you received no byte. - \param readedBytes A pointer to the variable that receives the number - of bytes read. - \param eosString is the null terminated end of string sequence. - Default is the linefeed character. - \param timeout_in_ms the function returns after this time, also - if no eos occured (default is 1s). - \param quota defines a character between those an EOS doesn't - terminate the string - \return 1 on sucess (the operation ends successfull without a timeout), - 0 if a timeout occurred and -1 otherwise - */ - virtual int ReadUntilEOS(char*& readbuf, - size_t* readedBytes, - char* eosString = "\n", - long timeout_in_ms = 1000L, - char quota = 0); - - /*! - \brief - readv() attempts to read up to len bytes from the interface - into the buffer starting at buf. - readv() is blocked till len bytes are readed or the given - timeout in milliseconds was reached. - \param buf starting address of the buffer - \param len count bytes, we want to read - \param timeout_in_ms in milliseconds. If you don't want any timeout, - you give the wxTIMEOUT_INFINITY here. - But think of it: In this case, this function never returns - if there a not enough bytes to read. - \return the number of data bytes successfully read - */ - int Readv(char* buf,size_t len,unsigned int timeout_in_ms); - - /*! - \brief - readv() attempts to read up to len bytes from the interface - into the buffer starting at buf. - readv() is blocked till len bytes are readed or the timeout_flag - points on a int greater then zero. - \param buf starting adress of the buffer - \param len count bytes, we want to read - \param timeout_flag a pointer to an integer. If you don't want - any timeout, you given a null pointer here. - But think of it: In this case, this function comes never - back, if there a not enough bytes to read. - \param nice if true go to sleep for one ms (reduce CPU last), - if there is no byte available (default is false) - */ - int Readv(char* buf,size_t len,int* timeout_flag,bool nice=false); - - /*! - Write writes up to len bytes from the buffer starting with buf - into the interface. - \param buf start adress of the buffer - \param len count of bytes, we want to write - \return on success, the number of bytes written are returned - (zero indicates nothing was written). On error, -1 is returned. - */ - virtual int Write(char* buf,size_t len) = 0; - - /*! - Writev() writes up to len bytes to the interface from the buffer, - starting at buf. - Also Writev() blocks till all bytes are written or the given - timeout in milliseconds was reached. - \param buf starting address of the buffer - \param len count bytes, we want to write - \param timeout_in_ms timeout in milliseconds. If you give - wxTIMEOUT_INFINITY here, the function blocks, till all data was - written. - \return the number of data bytes successfully written. - */ - int Writev(char* buf,size_t len,unsigned int timeout_in_ms); - - /*! - Writev() writes up to len bytes to the interface from the buffer, - starting at buf. - Also Writev() blocks till all bytes are written or the timeout_flag - points to an integer greater then zero. - \param buf starting adress of the buffer - \param len count bytes, we want to write - \param timeout_flag a pointer to an integer. You also can give a null - pointer here. This blocks, til all data is writen. - \param nice if true go to sleep for one ms (reduce CPU last), - if there is no byte available (default is false) - */ - int Writev(char* buf,size_t len,int* timeout_flag,bool nice = false); - - }; - -} // namespace ctb - -#endif - - - diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/kbhit.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/kbhit.h deleted file mode 100644 index 2a0545439c..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/kbhit.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef LIBCTB_KBHIT_H_INCLUDED_ -#define LIBCTB_KBHIT_H_INCLUDED_ - -namespace ctb { - - char GetKey(); - -} // namespace ctb - -#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/linux/serport.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/linux/serport.h deleted file mode 100644 index d88528bd25..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/linux/serport.h +++ /dev/null @@ -1,94 +0,0 @@ -#ifndef LIBCTB_LINUX_SERPORT_H_INCLUDED_ -#define LIBCTB_LINUX_SERPORT_H_INCLUDED_ - -///////////////////////////////////////////////////////////////////////////// -// Name: linux/serport.h -// Purpose: -// Author: Joachim Buermann -// Copyright: (c) 2010 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "ctb-0.16/serportx.h" -#include -#include - -namespace ctb { - -/*! - \class SerialPort - - \brief the linux version -*/ - class SerialPort : public SerialPort_x - { - protected: - /*! - \brief under Linux, the serial ports are normal file descriptor - */ - int fd; - /*! - \brief Linux defines this struct termios for controling asynchronous - communication. t covered the active settings, save_t the original - settings. - */ - struct termios t, save_t; - - /*! - \brief The Linux serial driver summing all breaks, framings, overruns - and parity errors for each port during system runtime. Because we only - need the errors during a active connection, we must save the actual - error numbers in this separate structurs. - */ - struct serial_icounter_struct save_info, last_info; - - /*! - \brief adaptor member function, to convert the plattform independent - type wxBaud into a linux conform value. - \param baud the baudrate as wxBaud type - \return speed_t linux specific data type, defined in termios.h - */ - speed_t AdaptBaudrate( int baud ); - - int CloseDevice(); - int OpenDevice(const char* devname, void* dcs); - - /*! - \brief internal member function to set an unusal (non-standard) - baudrate. Called by SetBaudrate. - */ - int SetBaudrateAny( int baudrate ); - - /*! - \brief internal member function to set a standard baudrate. - Called by SetBaudrate. - */ - int SetBaudrateStandard( int baudrate ); - - public: - SerialPort(); - - ~SerialPort(); - - int ChangeLineState( SerialLineState flags ); - - int ClrLineState( SerialLineState flags ); - - int GetLineState(); - int Ioctl(int cmd,void* args); - int IsOpen(); - int Read(char* buf,size_t len); - int SendBreak(int duration); - - int SetBaudrate( int baudrate ); - - int SetParityBit( bool parity ); - - int SetLineState( SerialLineState flags ); - - int Write(char* buf,size_t len); - }; - -} // namespace ctb - -#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/linux/timer.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/linux/timer.h deleted file mode 100644 index 7cc1a51e01..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/linux/timer.h +++ /dev/null @@ -1,139 +0,0 @@ -#ifndef LIBCTB_LINUX_TIMER_H_INCLUDED_ -#define LIBCTB_LINUX_TIMER_H_INCLUDED_ - -///////////////////////////////////////////////////////////////////////////// -// Name: linux/timer.h -// Purpose: -// Author: Joachim Buermann -// Id: $Id: timer.h,v 1.1.1.1 2004/11/24 10:30:11 jb Exp $ -// Copyright: (c) 2001 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -/** - \file timer.h -*/ - -#include - -namespace ctb { - -/*! - \brief A data struct, using from class timer. -*/ - struct timer_control - { - /*! - under linux, we used usec internally - */ - unsigned int usecs; - /*! - covers the adress of the exitflag - */ - int *exitflag; - /*! - covers the adress of the exit function. NULL, if - there was no exit function. - */ - void* (*exitfnc)(void*); - }; - -/*! - \class Timer - \brief A thread based timer class for handling timeouts in - an easier way. - - On starting every timer instance will create it's own thread. - The thread makes simply nothing, until it's given time is over. - After that, he set a variable, refer by it's adress to one - and exit. - - There are a lot of situations, which the timer class must handle. - The timer instance leaves his valid range (for example, the - timer instance is local inside a function, and the function fished) - BEFORE the thread was ending. In this case, the destructor must - terminate the thread in a correct way. (This is very different - between the OS. threads are a system resource like file descriptors - and must be deallocated after using it). - - The thread should be asynchronously stopped. Means, under all - circumstance, it must be possible, to finish the timer and start - it again. - - Several timer instance can be used simultanously. -*/ - class Timer - { - protected: - /*! - control covers the time interval, the adress - of the exitflag, and if not null, a function, which will - be called on the end. - */ - timer_control control; - /*! - stopped will be set by calling the stop() method. - Internaly the timer thread steadily tests the state of - this variable. If stopped not zero, the thread will be - finished. - */ - int stopped; - /*! - under linux we use the pthread library. tid covers the - identifier for a separate threads. - */ - pthread_t tid; - /*! - here we store the time interval, whilst the timer run. - This is waste!!! - */ - unsigned int timer_secs; - - public: - /*! - The constructor creates an timer object with the given - properties. The timer at this moment is not started. This - will be done with the start() member function. - \param msec time interval after that the the variable - pointed by exitflag is setting to one. - \param exitflag the adress of an integer, which was set - to one after the given time interval. - \warning The integer variable shouldn't leave it's valid - range, before the timer was finished. So never take a - local variable. - \param exitfnc A function, which was called after msec. - If you don't want this, refer a NULL pointer. - */ - Timer(unsigned int msec,int* exitflag,void*(*exitfnc)(void*)); - /*! - the destructor. If his was called (for example by leaving the - valid range of the timer object), the timer thread automaticaly - will finished. The exitflag wouldn't be set, also the exitfnc - wouldn't be called. - */ - ~Timer(); - /*! - starts the timer. But now a thread will created and started. - After this, the timer thread will be running until he was stopped - by calling stop() or reached his given time interval. - */ - int start(); - /*! - stops the timer and canceled the timer thread. After timer::stop() a new - start() will started the timer from beginning. - */ - int stop(); - }; - -/*! - \brief sleepms - A plattform independent function, to go to sleep for the given - time interval. - \param ms time interval in milli seconds -*/ - void sleepms(unsigned int ms); - -} // namespace ctb - -#endif - diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/portscan.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/portscan.h deleted file mode 100644 index 92c4ba11d6..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/portscan.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef LIBCTB_PORTSCAN_H_INCLUDED_ -#define LIBCTB_PORTSCAN_H_INCLUDED_ - -#include -#include - -/** - \file portscan.h -*/ - -namespace ctb { - - /*! - \brief returns all available COM ports as an array of strings. - \param result stores the available COM ports - \param checkInUse return only ports which are available AND - unused (default) - \return true if successful, false otherwise - */ - bool GetAvailablePorts( std::vector& result, - bool checkInUse = true ); - -} // namespace ctb - -#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/serport.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/serport.h deleted file mode 100644 index 9488753d4b..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/serport.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef LIBCTB_SERPORT_H_INCLUDED_ -#define LIBCTB_SERPORT_H_INCLUDED_ - -///////////////////////////////////////////////////////////////////////////// -// Name: serport.h -// Purpose: simple wrapper file -// Author: Joachim Buermann -// Copyright: (c) 2010 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#if defined (WIN32) -# include "ctb-0.16/win32/serport.h" -#else -# include "ctb-0.16/linux/serport.h" -#endif - -#endif -// __SERPORT_BASE_H - diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/serportx.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/serportx.h deleted file mode 100644 index 4d29bb4ccc..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/serportx.h +++ /dev/null @@ -1,451 +0,0 @@ -#ifndef LIBCTB_SERPORTX_H_INCLUDED_ -#define LIBCTB_SERPORTX_H_INCLUDED_ - -///////////////////////////////////////////////////////////////////////////// -// Name: serportx.h -// Purpose: -// Author: Joachim Buermann -// Copyright: (c) 2010 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include -#include -#include "ctb-0.16/iobase.h" - -#if defined(_MSC_VER) && _MSC_VER < 1900 -# define snprintf _snprintf -#endif - -/** - \file serportx.h -*/ - -/*! - \def SERIALPORT_NAME_LEN - defines the maximum length of the os depending serial port names -*/ -#define SERIALPORT_NAME_LEN 32 - -namespace ctb { - - /*! specifices the first serial port */ - extern const char* COM1; - /*! specifies the second serial port */ - extern const char* COM2; - /*! specifies the third serial port */ - extern const char* COM3; - /*! specifies the fourth serial port */ - extern const char* COM4; - /*! specifies the fifth serial port */ - extern const char* COM5; - /*! specifies the sixth serial port */ - extern const char* COM6; - /*! specifies the seventh serial port */ - extern const char* COM7; - /*! specifies the eighth serial port */ - extern const char* COM8; - /*! specifies the ninth serial port */ - extern const char* COM9; - /*! specifies the tenth serial port */ - extern const char* COM10; - /*! specifies the eleventh serial port */ - extern const char* COM11; - /*! specifies the twelfth serial port */ - extern const char* COM12; - /*! specifies the thriteenth serial port */ - extern const char* COM13; - /*! specifies the fourteenth serial port */ - extern const char* COM14; - /*! specifies the fiveteenth serial port */ - extern const char* COM15; - /*! specifies the sixteenth serial port */ - extern const char* COM16; - /*! specifies the seventeenth serial port */ - extern const char* COM17; - /*! specifies the eighteenth serial port */ - extern const char* COM18; - /*! specifies the nineteenth serial port */ - extern const char* COM19; - /*! specifies the twentieth serial port */ - extern const char* COM20; - - /*! - \enum Parity - - \brief Defines the different modes of parity checking. Under - Linux, the struct termios will be set to provide the wanted - behaviour. - */ - enum Parity - { - /*! no parity check */ - ParityNone, - /*! odd parity check */ - ParityOdd, - /*! even parity check */ - ParityEven, - /*! mark (not implemented yet) */ - ParityMark, - /*! space (not implemented yet) */ - ParitySpace - }; - - /*! - \enum SerialLineState - - Defines the different modem control lines. The value for - each item are defined in /usr/include/bits/ioctl-types.h. - This is the linux definition. The window version translate - each item in it's own value. - modem lines defined in ioctl-types.h - \code - #define TIOCM_LE 0x001 - #define TIOCM_DTR 0x002 - #define TIOCM_RTS 0x004 - #define TIOCM_ST 0x008 - #define TIOCM_SR 0x010 - #define TIOCM_CTS 0x020 - #define TIOCM_CAR 0x040 - #define TIOCM_RNG 0x080 - #define TIOCM_DSR 0x100 - #define TIOCM_CD TIOCM_CAR - #define TIOCM_RI TIOCM_RNG - \endcode - */ - enum SerialLineState - { - /*! Data Carrier Detect (read only) */ - LinestateDcd = 0x040, - /*! Clear To Send (read only) */ - LinestateCts = 0x020, - /*! Data Set Ready (read only) */ - LinestateDsr = 0x100, - /*! Data Terminal Ready (write only) */ - LinestateDtr = 0x002, - /*! Ring Detect (read only) */ - LinestateRing = 0x080, - /*! Request To Send (write only) */ - LinestateRts = 0x004, - /*! no active line state, use this for clear */ - LinestateNull = 0x000 - }; - - /*! - \struct SerialPort_DCS - - The device control struct for the serial communication class. - This struct should be used, if you refer advanced parameter. - */ - struct SerialPort_DCS - { - /*! the baudrate */ - int baud; - /*! the parity */ - Parity parity; - /*! the wordlen */ - unsigned char wordlen; - /*! count of stopbits */ - unsigned char stopbits; - /*! rtscts flow control */ - bool rtscts; - /*! XON/XOFF flow control */ - bool xonxoff; - /*! buffer for internal use */ - char buf[16]; - SerialPort_DCS() { - baud = 38400; - parity = ParityNone; - wordlen = 8; - stopbits = 1; - rtscts = false; - xonxoff = false; - }; - // to avoid memory leak warnings generated by swig - ~SerialPort_DCS() {}; - /*! - \brief returns the internal settings of the DCS as a human - readable string like '8N1 115200'. - \return the internal settings as null terminated string - */ - char* GetSettings() { - const char ac[5] = {'N','O','E','M','S'}; - memset(buf,0,sizeof(buf)); - snprintf(buf,sizeof(buf)-1,"%i%c%i %i", - wordlen, - ac[parity], - stopbits, - baud); - return buf; - }; - }; - -/*! - \struct SerialPort_EINFO - - The internal communication error struct. It contains the number - of each error (break, framing, overrun and parity) since opening - the serial port. Each error number will be cleared if the open - methode was called. -*/ - struct SerialPort_EINFO - { - /*! number of breaks */ - int brk; - /*! number of framing errors */ - int frame; - /*! number of overrun errors */ - int overrun; - /*! number of parity errors */ - int parity; - SerialPort_EINFO() { - brk = frame = overrun = parity = 0; - }; - ~SerialPort_EINFO() {}; - }; - - /*! - \enum SerialPortIoctls - - The following Ioctl calls are only valid for the SerialPort - class. - */ - enum SerialPortIoctls { - /*! - Get all numbers of occured communication errors (breaks - framing, overrun and parity), so the args parameter of - the Ioctl call must pointed to a SerialPort_EINFO - struct. - */ - CTB_SER_GETEINFO = CTB_SERIAL, - /*! - Get integer 1, if a break occured since the last call - so the args parameter of the Ioctl methode must pointed - to an integer value. If there was no break, the result - is integer 0. - */ - CTB_SER_GETBRK, - /*! - Get integer 1, if a framing occured since the last call - so the args parameter of the Ioctl methode must pointed - to an integer value. If there was no break, the result - is integer 0. - */ - CTB_SER_GETFRM, - /*! - Get integer 1, if a overrun occured since the last call - so the args parameter of the Ioctl methode must pointed - to an integer value. If there was no break, the result - is integer 0. - */ - CTB_SER_GETOVR, - /*! - Get integer 1, if a parity occured since the last call - so the args parameter of the Ioctl methode must pointed - to an integer value. If there was no break, the result - is integer 0. - */ - CTB_SER_GETPAR, - /*! - Get the number of bytes received by the serial port driver - but not yet read by a Read or Readv Operation. - */ - CTB_SER_GETINQUE, - /*! - Set the parity bit on or off to use it as a ninth bit. - */ - CTB_SER_SETPAR - }; - -/*! - \class SerialPort_x - SerialPort_x is the basic class for serial communication via - the serial comports. It is also an abstract class and defines - all necessary methods, which the derivated plattform depended - classes must be invoke. -*/ - class SerialPort_x : public IOBase - { - protected: - /*! - \brief contains the internal settings of the serial port like - baudrate, protocol, wordlen and so on. - */ - SerialPort_DCS m_dcs; - /*! - \brief contains the internal (os specific) name of the serial - device. - */ - char m_devname[SERIALPORT_NAME_LEN]; - public: - - /*! - \enum FlowControl - \brief Specifies the flow control. - - - */ - enum FlowControl - { - NoFlowControl, /*!< No flow control at all */ - - RtsCtsFlowControl, /*!< Enable RTS/CTS hardware flow control */ - - XonXoffFlowControl /*!< Enable XON/XOFF protocol */ - }; - - SerialPort_x() {m_devname[0] = '\0';}; - virtual ~SerialPort_x() {}; - /*! - \brief returns the name of the class instance. You find this useful, - if you handle different devices like a serial port or a gpib device - via a IOBase pointer. - \return name of the class. - */ - const char* ClassName() {return "ctb::SerialPort";}; - - /*! - \brief change the linestates according to which bits - are set/unset in flags. - \param flags valid line flags are SERIAL_LINESTATE_DSR and/or - SERIAL_LINESTATE_RTS - \return zero on success, -1 if an error occurs - */ - virtual int ChangeLineState( SerialLineState flags ) = 0; - - /*! - \brief turn off status lines depending upon which bits (DSR and/or RTS) - are set in flags. - \param flags valid line flags are SERIAL_LINESTATE_DSR and/or - SERIAL_LINESTATE_RTS - \return zero on success, -1 if an error occurs - */ - virtual int ClrLineState( SerialLineState flags ) = 0; - - /*! - \brief Read the line states of DCD, CTS, DSR and RING - \return returns the appropriate bits on sucess, otherwise -1 - */ - virtual int GetLineState() = 0; - - /*! - \brief request the current settings of the connected serial port - as a null terminated string. - \return the settings as a string like '8N1 115200' - */ - virtual char* GetSettingsAsString() { - return m_dcs.GetSettings(); - }; - - /*! - \brief Many operating characteristics are only possible for - special devices. To avoid the need of a lot of different functions - and to give the user a uniform interface, all this special - operating instructions will covered by one Ioctl methode (like - the linux ioctl call). - The Ioctl command (cmd) has encoded in it whether the argument - is an in parameter or out parameter, and the size of the - argument args in bytes. Macros and defines used in specifying an - ioctl request are located in iobase.h and the header file for - the derivated device (for example in serportx.h). - \param cmd one of SerialPortIoctls specify the ioctl request. - \param args is a typeless pointer to a memory location, where - Ioctl reads the request arguments or write the results. - Please note, that an invalid memory location or size involving - a buffer overflow or segmention fault! - */ - virtual int Ioctl(int cmd,void* args) {return -1;}; - - /*! - \brief Opens a serial port in a user likely way. Insteed of - using the Device Control Struct just input your parameter in a - more intuitive manner. - \param portname the name of the serial port - \param baudrate any baudrate, also an unusual one, if your - serial device support them - \param protocol a string with the number of databits (5...8), - the parity setting (N=None,O=Odd,E=Even,M=Mark,S=Space), also - in lower case, and the count of stopbits (1...2) - \param flowControl one of NoFlowControl, RtsCtsFlowControl or - XonXoffFlowControl. - \return the new file descriptor, or -1 if an error occurred - */ - int Open( const char* portname, int baudrate, - const char* protocol = "8N1", - FlowControl flowControl = NoFlowControl ); - - /*! - \brief Opens the serial port with the given number. - \note The port numbering starts with 1 (COM1 for windows and - /dev/ttyS0 for Linux. Please note, that USB to RS232 converter - in Linux are named as /dev/ttyUSBx and from there have to - opened with their device name! - \param number of the serial port count from 1 - \param baudrate any baudrate, also an unusual one, if your - serial device support them - \param protocol a string with the number of databits (5...8), - the parity setting (N=None,O=Odd,E=Even,M=Mark,S=Space), also - in lower case, and the count of stopbits (1...2) - \param flowControl one of NoFlowControl, RtsCtsFlowControl or - XonXoffFlowControl. - \return the new file descriptor, or -1 if an error occurred - */ - int Open( const int portnumber, int baudrate, - const char* protocol = "8N1", - FlowControl flowControl = NoFlowControl ); - - // Open overrides and hides the IOBase::Open( const char* - // devname, void* dcs ) of the base class! So bring it into scope - // again! - using IOBase::Open; - - /*! - \brief Sendbreak transmits a continuous stream of zero-valued - bits for a specific duration. - \param duration If duration is zero, it transmits - zero-valued bits for at least 0.25 seconds, and not more that - 0.5 seconds. If duration is not zero, it sends zero-valued bits - for duration*N seconds, where N is at least 0.25, and not more - than 0.5. - \return zero on success, -1 if an error occurs. - */ - virtual int SendBreak(int duration) = 0; - - /*! - \brief Set the baudrate (also non-standard) - Please note: Non-standard baudrates like 70000 are not supported - by each UART and depends on the RS232 chipset you apply. - \param baudrate the new baudrate - \return zero on success, -1 if an error occurs - */ - virtual int SetBaudrate( int baudrate ) = 0; - - /*! - \brief turn on status lines depending upon which bits (DSR and/or RTS) - are set in flags. - \param flags valid line flags are SERIAL_LINESTATE_DSR and/or - SERIAL_LINESTATE_RTS - \return zero on success, -1 if an error occurs - */ - virtual int SetLineState( SerialLineState flags ) = 0; - - /*! - \brief Set the parity bit to a firm state, for instance to use - the parity bit as the ninth bit in a 9 bit dataword - communication. - \return zero on succes, a negative value if an error occurs - */ - virtual int SetParityBit( bool parity ) = 0; - - /*! - \brief check the given baudrate against a list of standard rates. - \ return true, if the baudrate is a standard value, false - otherwise - */ - static bool IsStandardRate( int rate ); - - }; - -} // namespace ctb - -#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/timer.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/timer.h deleted file mode 100644 index b1313ebfef..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/timer.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef LIBCTB_TIMER_H_INCLUDED_ -#define LIBCTB_TIMER_H_INCLUDED_ - -///////////////////////////////////////////////////////////////////////////// -// Name: timer.h -// Purpose: simple wrapper file -// Author: Joachim Buermann -// Copyright: (c) 2010 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#if defined (WIN32) -# include "win32/timer.h" -#else -# include "linux/timer.h" -#endif - -#endif - diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/getopt.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/getopt.h deleted file mode 100644 index d2a909fd73..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/getopt.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef LIBCTB_WIN32_GETOPT_H_INCLUDED_ -#define LIBCTB_WIN32_GETOPT_H_INCLUDED_ - -///////////////////////////////////////////////////////////////////////////// -// Name: win32/getopt.h -// Purpose: -// Author: Joachim Buermann -// Copyright: (c) 2010 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -extern char* optarg; -extern int optind; - -int getopt(int argc, char* argv[], char* optstring); - -#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/gpib-32.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/gpib-32.h deleted file mode 100644 index 307c6ce001..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/gpib-32.h +++ /dev/null @@ -1,414 +0,0 @@ -/* - * - * - * Win32 include file - * for accessing the 32-bit GPIB DLL (gpib-32.dll) - * - * - * Contains user variables (ibsta, iberr, ibcnt, ibcntl), - * function prototypes and useful defined constants for - * calling NI-488 and NI-488.2 routines from a Microsoft - * C/C++ Win32 application. - * - * - * Copyright 1998 National Instruments Corporation - * - */ - -#ifndef DECL_32_H // ensure we are only included once -#define DECL_32_H - -#include "windows.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/***************************************************************************/ -/* HANDY CONSTANTS FOR USE BY APPLICATION PROGRAMS ... */ -/***************************************************************************/ -#define UNL 0x3f /* GPIB unlisten command */ -#define UNT 0x5f /* GPIB untalk command */ -#define GTL 0x01 /* GPIB go to local */ -#define SDC 0x04 /* GPIB selected device clear */ -#define PPC 0x05 /* GPIB parallel poll configure */ -#define GET 0x08 /* GPIB group execute trigger */ -#define TCT 0x09 /* GPIB take control */ -#define LLO 0x11 /* GPIB local lock out */ -#define DCL 0x14 /* GPIB device clear */ -#define PPU 0.16 /* GPIB parallel poll unconfigure */ -#define SPE 0x18 /* GPIB serial poll enable */ -#define SPD 0x19 /* GPIB serial poll disable */ -#define PPE 0x60 /* GPIB parallel poll enable */ -#define PPD 0x70 /* GPIB parallel poll disable */ - -/* GPIB status bit vector : */ -/* global variable ibsta and wait mask */ - -#define ERR (1<<15) /* Error detected */ -#define TIMO (1<<14) /* Timeout */ -#define END (1<<13) /* EOI or EOS detected */ -#define SRQI (1<<12) /* SRQ detected by CIC */ -#define RQS (1<<11) /* Device needs service */ -#define CMPL (1<<8) /* I/O completed */ -#define LOK (1<<7) /* Local lockout state */ -#define REM (1<<6) /* Remote state */ -#define CIC (1<<5) /* Controller-in-Charge */ -#define ATN (1<<4) /* Attention asserted */ -#define TACS (1<<3) /* Talker active */ -#define LACS (1<<2) /* Listener active */ -#define DTAS (1<<1) /* Device trigger state */ -#define DCAS (1<<0) /* Device clear state */ - -/* Error messages returned in global variable iberr */ - -#define EDVR 0 /* System error */ -#define ECIC 1 /* Function requires GPIB board to be CIC */ -#define ENOL 2 /* Write function detected no Listeners */ -#define EADR 3 /* Interface board not addressed correctly*/ -#define EARG 4 /* Invalid argument to function call */ -#define ESAC 5 /* Function requires GPIB board to be SAC */ -#define EABO 6 /* I/O operation aborted */ -#define ENEB 7 /* Non-existent interface board */ -#define EDMA 8 /* Error performing DMA */ -#define EOIP 10 /* I/O operation started before previous */ - /* operation completed */ -#define ECAP 11 /* No capability for intended operation */ -#define EFSO 12 /* File system operation error */ -#define EBUS 14 /* Command error during device call */ -#define ESTB 15 /* Serial poll status byte lost */ -#define ESRQ 16 /* SRQ remains asserted */ -#define ETAB 20 /* The return buffer is full. */ -#define ELCK 21 /* Address or board is locked. */ - -/* EOS mode bits */ - -#define BIN (1<<12) /* Eight bit compare */ -#define XEOS (1<<11) /* Send END with EOS byte */ -#define REOS (1<<10) /* Terminate read on EOS */ - -/* Timeout values and meanings */ - -#define TNONE 0 /* Infinite timeout (disabled) */ -#define T10us 1 /* Timeout of 10 us (ideal) */ -#define T30us 2 /* Timeout of 30 us (ideal) */ -#define T100us 3 /* Timeout of 100 us (ideal) */ -#define T300us 4 /* Timeout of 300 us (ideal) */ -#define T1ms 5 /* Timeout of 1 ms (ideal) */ -#define T3ms 6 /* Timeout of 3 ms (ideal) */ -#define T10ms 7 /* Timeout of 10 ms (ideal) */ -#define T30ms 8 /* Timeout of 30 ms (ideal) */ -#define T100ms 9 /* Timeout of 100 ms (ideal) */ -#define T300ms 10 /* Timeout of 300 ms (ideal) */ -#define T1s 11 /* Timeout of 1 s (ideal) */ -#define T3s 12 /* Timeout of 3 s (ideal) */ -#define T10s 13 /* Timeout of 10 s (ideal) */ -#define T30s 14 /* Timeout of 30 s (ideal) */ -#define T100s 15 /* Timeout of 100 s (ideal) */ -#define T300s 16 /* Timeout of 300 s (ideal) */ -#define T1000s 17 /* Timeout of 1000 s (ideal) */ - - -/* IBLN Constants */ -#define NO_SAD 0 -#define ALL_SAD -1 - - -/* The following constants are used for the second parameter of the - * ibconfig function. They are the "option" selection codes. - */ -#define IbcPAD 0x0001 /* Primary Address */ -#define IbcSAD 0x0002 /* Secondary Address */ -#define IbcTMO 0x0003 /* Timeout Value */ -#define IbcEOT 0x0004 /* Send EOI with last data byte? */ -#define IbcPPC 0x0005 /* Parallel Poll Configure */ -#define IbcREADDR 0x0006 /* Repeat Addressing */ -#define IbcAUTOPOLL 0x0007 /* Disable Auto Serial Polling */ -#define IbcCICPROT 0x0008 /* Use the CIC Protocol? */ -#define IbcIRQ 0x0009 /* Use PIO for I/O */ -#define IbcSC 0x000A /* Board is System Controller? */ -#define IbcSRE 0x000B /* Assert SRE on device calls? */ -#define IbcEOSrd 0x000C /* Terminate reads on EOS */ -#define IbcEOSwrt 0x000D /* Send EOI with EOS character */ -#define IbcEOScmp 0x000E /* Use 7 or 8-bit EOS compare */ -#define IbcEOSchar 0x000F /* The EOS character. */ -#define IbcPP2 0x0010 /* Use Parallel Poll Mode 2. */ -#define IbcTIMING 0x0011 /* NORMAL, HIGH, or VERY_HIGH timing. */ -#define IbcDMA 0x0012 /* Use DMA for I/O */ -#define IbcReadAdjust 0x0013 /* Swap bytes during an ibrd. */ -#define IbcWriteAdjust 0x014 /* Swap bytes during an ibwrt. */ -#define IbcSendLLO 0x0017 /* Enable/disable the sending of LLO. */ -#define IbcSPollTime 0x0018 /* Set the timeout value for serial polls. */ -#define IbcPPollTime 0x0019 /* Set the parallel poll length period. */ -#define IbcEndBitIsNormal 0x001A /* Remove EOS from END bit of IBSTA. */ -#define IbcUnAddr 0x001B /* Enable/disable device unaddressing. */ -#define IbcSignalNumber 0x001C /* Set UNIX signal number - unsupported */ -#define IbcBlockIfLocked 0x001D /* Enable/disable blocking for locked boards/devices */ -#define IbcHSCableLength 0x001F /* Length of cable specified for high speed timing.*/ -#define IbcIst 0x0020 /* Set the IST bit. */ -#define IbcRsv 0x0021 /* Set the RSV byte. */ - -/* - * Constants that can be used (in addition to the ibconfig constants) - * when calling the ibask() function. - */ - -#define IbaPAD IbcPAD -#define IbaSAD IbcSAD -#define IbaTMO IbcTMO -#define IbaEOT IbcEOT -#define IbaPPC IbcPPC -#define IbaREADDR IbcREADDR -#define IbaAUTOPOLL IbcAUTOPOLL -#define IbaCICPROT IbcCICPROT -#define IbaIRQ IbcIRQ -#define IbaSC IbcSC -#define IbaSRE IbcSRE -#define IbaEOSrd IbcEOSrd -#define IbaEOSwrt IbcEOSwrt -#define IbaEOScmp IbcEOScmp -#define IbaEOSchar IbcEOSchar -#define IbaPP2 IbcPP2 -#define IbaTIMING IbcTIMING -#define IbaDMA IbcDMA -#define IbaReadAdjust IbcReadAdjust -#define IbaWriteAdjust IbcWriteAdjust -#define IbaSendLLO IbcSendLLO -#define IbaSPollTime IbcSPollTime -#define IbaPPollTime IbcPPollTime -#define IbaEndBitIsNormal IbcEndBitIsNormal -#define IbaUnAddr IbcUnAddr -#define IbaSignalNumber IbcSignalNumber -#define IbaBlockIfLocked IbcBlockIfLocked -#define IbaHSCableLength IbcHSCableLength -#define IbaIst IbcIst -#define IbaRsv IbcRsv - -#define IbaBNA 0x0200 /* A device's access board. */ - - -/* Values used by the Send 488.2 command. */ -#define NULLend 0x00 /* Do nothing at the end of a transfer.*/ -#define NLend 0x01 /* Send NL with EOI after a transfer. */ -#define DABend 0x02 /* Send EOI with the last DAB. */ - -/* Value used by the 488.2 Receive command. - */ -#define STOPend 0x0100 - - -/* Address type (for 488.2 calls) */ - -typedef short Addr4882_t; /* System dependent: must be 16 bits */ - -/* - * This macro can be used to easily create an entry in address list - * that is required by many of the 488.2 functions. The primary address goes in the - * lower 8-bits and the secondary address goes in the upper 8-bits. - */ -#define MakeAddr(pad, sad) ((Addr4882_t)(((pad)&0xFF) | ((sad)<<8))) - -/* - * This value is used to terminate an address list. It should be - * assigned to the last entry. - */ -#ifndef NOADDR -#define NOADDR (Addr4882_t)((unsigned short)0xFFFF) -#endif - -/* - * The following two macros are used to "break apart" an address list - * entry. They take an unsigned integer and return either the primary - * or secondary address stored in the integer. - */ -#define GetPAD(val) ((val) & 0xFF) -#define GetSAD(val) (((val) >> 8) & 0xFF) - -/* iblines constants */ - -#define ValidEOI (short)0x0080 -#define ValidATN (short)0x0040 -#define ValidSRQ (short)0x0020 -#define ValidREN (short)0x0010 -#define ValidIFC (short)0x0008 -#define ValidNRFD (short)0x0004 -#define ValidNDAC (short)0x0002 -#define ValidDAV (short)0x0001 -#define BusEOI (short)0x8000 -#define BusATN (short)0x4000 -#define BusSRQ (short)0x2000 -#define BusREN (short)0x1000 -#define BusIFC (short)0x0800 -#define BusNRFD (short)0x0400 -#define BusNDAC (short)0x0200 -#define BusDAV (short)0x0100 - -/**** - **** typedef for ibnotify callback **** - ****/ -typedef int (__stdcall * GpibNotifyCallback_t)(int, int, int, long, PVOID); - -#define IBNOTIFY_REARM_FAILED 0xE00A003F - - -/*************************************************************************/ -/* */ -/* iblockx and ibunlockx definitions --- for use with GPIB-ENET only !! */ -/* */ -/*************************************************************************/ -#define TIMMEDIATE -1 -#define TINFINITE -2 -#define MAX_LOCKSHARENAME_LENGTH 64 - -#if defined(UNICODE) - #define iblockx iblockxW -#else - #define iblockx iblockxA -#endif - -extern int __stdcall iblockxA (int ud, int LockWaitTime, PCHAR LockShareName); -extern int __stdcall iblockxW (int ud, int LockWaitTime, PWCHAR LockShareName); -extern int __stdcall ibunlockx (int ud); - - -/***************************************************************************/ -/* IBSTA, IBERR, IBCNT, IBCNTL and FUNCTION PROTOTYPES */ -/* ( only included if not accessing the 32-bit DLL directly ) */ -/***************************************************************************/ -#if !defined(GPIB_DIRECT_ACCESS) - -/* - * Set up access to the user variables (ibsta, iberr, ibcnt, ibcntl). - * These are declared and exported by the 32-bit DLL. Separate copies - * exist for each process that accesses the DLL. They are shared by - * multiple threads of a single process. - */ - -extern int ibsta; -extern int iberr; -extern int ibcnt; -extern long ibcntl; - - -#if defined(UNICODE) - #define ibbna ibbnaW - #define ibfind ibfindW - #define ibrdf ibrdfW - #define ibwrtf ibwrtfW -#else - #define ibbna ibbnaA - #define ibfind ibfindA - #define ibrdf ibrdfA - #define ibwrtf ibwrtfA -#endif - -/* - * Extern 32-bit GPIB DLL functions - */ - -/* NI-488 Function Prototypes */ -extern int __stdcall ibfindA (LPCSTR udname); -extern int __stdcall ibbnaA (int ud, LPCSTR udname); -extern int __stdcall ibrdfA (int ud, LPCSTR filename); -extern int __stdcall ibwrtfA (int ud, LPCSTR filename); - -extern int __stdcall ibfindW (LPCWSTR udname); -extern int __stdcall ibbnaW (int ud, LPCWSTR udname); -extern int __stdcall ibrdfW (int ud, LPCWSTR filename); -extern int __stdcall ibwrtfW (int ud, LPCWSTR filename); - -extern int __stdcall ibask (int ud, int option, PINT v); -extern int __stdcall ibcac (int ud, int v); -extern int __stdcall ibclr (int ud); -extern int __stdcall ibcmd (int ud, PVOID buf, long cnt); -extern int __stdcall ibcmda (int ud, PVOID buf, long cnt); -extern int __stdcall ibconfig (int ud, int option, int v); -extern int __stdcall ibdev (int boardID, int pad, int sad, int tmo, int eot, int eos); -extern int __stdcall ibdiag (int ud, PVOID buf, long cnt); -extern int __stdcall ibdma (int ud, int v); -extern int __stdcall ibeos (int ud, int v); -extern int __stdcall ibeot (int ud, int v); -extern int __stdcall ibgts (int ud, int v); -extern int __stdcall ibist (int ud, int v); -extern int __stdcall iblines (int ud, PSHORT result); -extern int __stdcall ibln (int ud, int pad, int sad, PSHORT listen); -extern int __stdcall ibloc (int ud); -extern int __stdcall ibnotify (int ud, int mask, GpibNotifyCallback_t Callback, PVOID RefData); -extern int __stdcall ibonl (int ud, int v); -extern int __stdcall ibpad (int ud, int v); -extern int __stdcall ibpct (int ud); -extern int __stdcall ibpoke (int ud, long option, long v); -extern int __stdcall ibppc (int ud, int v); -extern int __stdcall ibrd (int ud, PVOID buf, long cnt); -extern int __stdcall ibrda (int ud, PVOID buf, long cnt); -extern int __stdcall ibrpp (int ud, PCHAR ppr); -extern int __stdcall ibrsc (int ud, int v); -extern int __stdcall ibrsp (int ud, PCHAR spr); -extern int __stdcall ibrsv (int ud, int v); -extern int __stdcall ibsad (int ud, int v); -extern int __stdcall ibsic (int ud); -extern int __stdcall ibsre (int ud, int v); -extern int __stdcall ibstop (int ud); -extern int __stdcall ibtmo (int ud, int v); -extern int __stdcall ibtrg (int ud); -extern int __stdcall ibwait (int ud, int mask); -extern int __stdcall ibwrt (int ud, PVOID buf, long cnt); -extern int __stdcall ibwrta (int ud, PVOID buf, long cnt); - -// GPIB-ENET only functions to support locking across machines -extern int __stdcall iblock (int ud); -extern int __stdcall ibunlock (int ud); - -/**************************************************************************/ -/* Functions to access Thread-Specific copies of the GPIB global vars */ - -extern int __stdcall ThreadIbsta (void); -extern int __stdcall ThreadIberr (void); -extern int __stdcall ThreadIbcnt (void); -extern long __stdcall ThreadIbcntl (void); - - -/**************************************************************************/ -/* NI-488.2 Function Prototypes */ - -extern void __stdcall AllSpoll (int boardID, Addr4882_t * addrlist, PSHORT results); -extern void __stdcall DevClear (int boardID, Addr4882_t addr); -extern void __stdcall DevClearList (int boardID, Addr4882_t * addrlist); -extern void __stdcall EnableLocal (int boardID, Addr4882_t * addrlist); -extern void __stdcall EnableRemote (int boardID, Addr4882_t * addrlist); -extern void __stdcall FindLstn (int boardID, Addr4882_t * addrlist, Addr4882_t * results, int limit); -extern void __stdcall FindRQS (int boardID, Addr4882_t * addrlist, PSHORT dev_stat); -extern void __stdcall PPoll (int boardID, PSHORT result); -extern void __stdcall PPollConfig (int boardID, Addr4882_t addr, int dataLine, int lineSense); -extern void __stdcall PPollUnconfig (int boardID, Addr4882_t * addrlist); -extern void __stdcall PassControl (int boardID, Addr4882_t addr); -extern void __stdcall RcvRespMsg (int boardID, PVOID buffer, long cnt, int Termination); -extern void __stdcall ReadStatusByte(int boardID, Addr4882_t addr, PSHORT result); -extern void __stdcall Receive (int boardID, Addr4882_t addr, PVOID buffer, long cnt, int Termination); -extern void __stdcall ReceiveSetup (int boardID, Addr4882_t addr); -extern void __stdcall ResetSys (int boardID, Addr4882_t * addrlist); -extern void __stdcall Send (int boardID, Addr4882_t addr, PVOID databuf, long datacnt, int eotMode); -extern void __stdcall SendCmds (int boardID, PVOID buffer, long cnt); -extern void __stdcall SendDataBytes (int boardID, PVOID buffer, long cnt, int eot_mode); -extern void __stdcall SendIFC (int boardID); -extern void __stdcall SendLLO (int boardID); -extern void __stdcall SendList (int boardID, Addr4882_t * addrlist, PVOID databuf, long datacnt, int eotMode); -extern void __stdcall SendSetup (int boardID, Addr4882_t * addrlist); -extern void __stdcall SetRWLS (int boardID, Addr4882_t * addrlist); -extern void __stdcall TestSRQ (int boardID, PSHORT result); -extern void __stdcall TestSys (int boardID, Addr4882_t * addrlist, PSHORT results); -extern void __stdcall Trigger (int boardID, Addr4882_t addr); -extern void __stdcall TriggerList (int boardID, Addr4882_t * addrlist); -extern void __stdcall WaitSRQ (int boardID, PSHORT result); - -#endif - - -#ifdef __cplusplus -} -#endif - - -#endif // DECL_32_H - diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/serport.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/serport.h deleted file mode 100644 index 503f25cffb..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/serport.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef LIBCTB_WIN32_TIMER_H_INCLUDED_ -#define LIBCTB_WIN32_TIMER_H_INCLUDED_ - -///////////////////////////////////////////////////////////////////////////// -// Name: win32/serport.h -// Purpose: -// Author: Joachim Buermann -// Copyright: (c) 2010 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "../serportx.h" -#include - -namespace ctb { - - /*! - \class SerialPort - - \brief the win32 version - */ - class SerialPort : public SerialPort_x - { - protected: - /*! - \brief the win32 api equivalent for the Linux - file descriptor - */ - HANDLE fd; - /*! - \brief a very special struct in the win32 api for controling - an asynchronous serial communication through the com ports. - */ - OVERLAPPED m_ov; - - /*! - \brief The win32 API only allows to test for an existing - break, framing, overrun or parity, not for the occured numbers. - So every error event decrement this internal error struct and - can request by an Ioctl call. - */ - SerialPort_EINFO einfo; - - /*! - \brief The win32 API doesn't have any function to detect the - current state of the output lines RST and DTR (if someone knows - some function, please contact me). - So we save the state always after changing one or both lines - (for example, on Open, SetLineState and ChangeLineState) - */ - int m_rtsdtr_state; - - int CloseDevice(); - int OpenDevice(const char* devname, void* dcs); - public: - SerialPort(); - ~SerialPort(); - - int ChangeLineState( SerialLineState flags ); - int ClrLineState( SerialLineState flags ); - int GetLineState(); - int Ioctl(int cmd,void* args); - int IsOpen(); - int Read(char* buf,size_t len); - int SendBreak(int duration); - int SetBaudrate( int baudrate ); - int SetLineState( SerialLineState flags ); - int SetParityBit( bool parity ); - int Write(char* buf,size_t len); - }; - -} // namespace ctb - -#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/timer.h b/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/timer.h deleted file mode 100644 index e750baead3..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/include/ctb-0.16/win32/timer.h +++ /dev/null @@ -1,140 +0,0 @@ -#ifndef LIBCTB_WINDOWS_TIMER_H_INCLUDED_ -#define LIBCTB_WINDOWS_TIMER_H_INCLUDED_ - -///////////////////////////////////////////////////////////////////////////// -// Name: win32/timer.h -// Purpose: -// Author: Joachim Buermann -// Copyright: (c) 2010 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include - -namespace ctb { - -/*! - \brief A data struct, using from class timer. -*/ - struct timer_control - { - /*! - under win32, we used msec internally - */ - unsigned int msecs; - /*! - covers the adress of the exitflag - */ - int *exitflag; - /*! - the running thread steadily polls this variable (only under win32). - If it's not zero, the thread terminate. - */ - MMRESULT stop; - /*! - covers the adress of the exit function. NULL, if - there was no exit function. - */ - void* (*exitfnc)(void*); - }; - -/*! - \class Timer - \brief A thread based timer class for handling timeouts in - an easier way. - - On starting every timer instance will create it's own thread. - The thread makes simply nothing, until it's given time is over. - After that, he set a variable, refer by it's adress to one - and exit. - - There are a lot of situations, which the timer class must handle. - The timer instance leaves his valid range (for example, the - timer instance is local inside a function, and the function fished) - BEFORE the thread was ending. In this case, the destructor must - terminate the thread in a correct way. (This is very different - between the OS. threads are a system resource like file descriptors - and must be deallocated after using it). - - The thread should be asynchronously stopped. Means, under all - circumstance, it must be possible, to finish the timer and start - it again. - - Several timer instance can be used simultanously. -*/ - class Timer - { - protected: - /*! - \brief win32 needs this - */ - DWORD id; - /*! - \brief in win32 internal handle for the timer thread - */ - MMRESULT h; - /*! - control covers the time interval, the adress - of the exitflag, and if not null, a function, which will - be called on the end. - */ - timer_control control; - /*! - here we store the time interval, whilst the timer run. - This is waste!!! - */ - unsigned int timer_secs; - public: - /*! - The constructor creates an timer object with the given - properties. The timer at this moment is not started. This - will be done with the start() member function. - \param msec time interval after that the the variable - pointed by exitflag is setting to one. - \param exitflag the adress of an integer, which was set - to one after the given time interval. - \warning The integer variable shouldn't leave it's valid - range, before the timer was finished. So never take a - local variable. - \param exitfnc A function, which was called after msec. - If you don't want this, refer a NULL pointer. - */ - Timer(unsigned int msec,int* exitflag,void*(*exitfnc)(void*)); - /*! - the destructor. If his was called (for example by leaving the - valid range of the timer object), the timer thread automaticaly - will finished. The exitflag wouldn't be set, also the exitfnc - wouldn't be called. - */ - ~Timer(); - /*! - starts the timer. But now a thread will created and started. - After this, the timer thread will be running until he was stopped - by calling stop() or reached his given time interval. - */ - int start(); - /*! - stops the timer and canceled the timer thread. After timer::stop() a new - start() will started the timer from beginning. - */ - int stop(); - }; - -/*! - \fn kill_all_timer() - \warning This function don't works under win32 and will be removed next - time. So don't use that! -*/ - void kill_all_timer(); - -/*! - \fn - A plattform independent function, to go to sleep for the given - time interval. - \param ms time interval in milli seconds -*/ - void sleepms(unsigned int ms); - -} // namespace ctb - -#endif diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/lib/EMPTY b/src/mod/endpoints/mod_gsmopen/libctb-0.16/lib/EMPTY deleted file mode 100644 index 887ae9333d..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/lib/EMPTY +++ /dev/null @@ -1 +0,0 @@ -ciao diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/manual/refman.pdf b/src/mod/endpoints/mod_gsmopen/libctb-0.16/manual/refman.pdf deleted file mode 100644 index 285e523de3..0000000000 Binary files a/src/mod/endpoints/mod_gsmopen/libctb-0.16/manual/refman.pdf and /dev/null differ diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/module/linux/ctb.py b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/module/linux/ctb.py deleted file mode 100644 index 6b541ffe39..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/module/linux/ctb.py +++ /dev/null @@ -1,455 +0,0 @@ -import wxctb, sys, re - -DCD = wxctb.LinestateDcd -CTS = wxctb.LinestateCts -DSR = wxctb.LinestateDsr -DTR = wxctb.LinestateDtr -RING = wxctb.LinestateRing -RTS = wxctb.LinestateRts -NULL = wxctb.LinestateNull - -def abstract(): - import inspect - caller = inspect.getouterframes(inspect.currentframe())[1][3] - raise NotImplementedError(caller + ' must be implemented in subclass') - -class IOBase: - def __init__(self): - self.device = None - # set timeout to 1000ms (the default) - self.timeout = 1000 - - def __del__(self): - pass - - def Close(self): - if self.device: - self.device.Close() - - def GetTimeout(self): - """ - Returns the internal timeout value in milliseconds - """ - return self.timeout - - def Ioctl(self,cmd,arg): - if self.device: - self.device.Ioctl(cmd,arg) - - def Open(self): - abstract() - - def PutBack(self,char): - return self.device.PutBack(char) - - def Read(self,length): - """ - Try to read the given count of data (length) and returns the - successfully readed number of data. The function never blocks. - For example: - readed = dev.Read(100) - """ - buf = "\x00"*(length+1) - rd = self.device.Read(buf,length) - return buf[0:rd] - - def ReadBinary(self,eos="\n"): - """ - Special SCPI command. Read the next data coded as a SCPI - binary format. - A binary data transfer will be startet by '#'. The next byte - tells the count of bytes for the binary length header, - following by the length bytes. After these the data begins. - For example: - #500004xxxx - The header length covers 5 Byte, the length of the binary - data is 4 (x means the binary data bytes) - """ - try: - eoslen = len(eos) - b=self.Readv(2) - if len(b) == 2: - hl = int(b[1]) - b = self.Readv(hl) - if len(b) == hl: - dl = int(b) - # don't left over the eos string or character in the - # device input buffer - data = self.Readv(dl+eoslen) - # check, if the binary data block is complete - if data[dl] == '#': - # not complete, another block is following - for c in data[dl:dl+eoslen]: - self.PutBack(c) - - data = data[:dl] + self.ReadBinary() - return data - except: - pass - return '' - - def ReadUntilEOS(self,eos="\n",quota=0): - """ - ReadUntilEOS(eosString=\"\\n\",timeout=1000) - Reads data until the given eos string was received (default is - the linefeed character (0x0a) or the internal timeout - (default 1000ms) was reached. - ReadUntilEOS returns the result as the following tuple: - ['received string',state,readedBytes] - If a timeout occurred, state is 0, otherwise 1 - """ - return self.device.ReadUntilEOS("",0,eos,self.timeout,quota) - - def Readv(self,length): - """ - Try to read the given count of data. Readv blocks until all data - was readed successfully or the internal timeout, set with the - class member function SetTimeout(timeout), was reached. - Returns the readed data. - """ - buf = "\x00"*length - rd = self.device.Readv(buf,length,self.timeout) - return buf[0:rd] - - def ResetBus(self): - """ - If the underlaying interface needs some special reset operations - (for instance the GPIB distinguish between a normal device reset - and a special bus reset), you can put some code here) - """ - pass - - def SetTimeout(self,timeout): - """ - Set the internal timeout value in milliseconds for all blocked - operations like ReadUntilEOS, Readv and Writev. - """ - self.timeout = timeout - - def Write(self,string): - """ - Writes the given string to the device and returns immediately. - Write returns the number of data bytes successfully written or a - negativ number if an error occured. For some circumstances, not - the complete string was written. - So you have to verify the return value to check this out. - """ - return self.device.Write(string,len(string)) - - def Writev(self,string): - """ - Writes the given string to the device. The function blocks until - the complete string was written or the internal timeout, set with - SetTimeout(timeout), was reached. - Writev returns the number of data successfully written or a - negativ value, if an errors occurred. - """ - return self.device.Writev(string,len(string),self.timeout) - -class SerialPort(IOBase): - def __init__(self): - IOBase.__init__(self) - - def __del__(self): - self.Close() - - def ChangeLineState(self,lineState): - """ - Change (toggle) the state of each the lines given in the - linestate parameter. Possible values are DTR and/or RTS. - For example to toggle the RTS line only: - dev.ChangeLineState(RTS) - """ - self.device.ChangeLineState(lineState) - - def ClrLineState(self,lineState): - """ - Clear the lines given in the linestate parameter. Possible - values are DTR and/or RTS. For example to clear only - the RTS line: - dev.ClrLineState(RTS) - """ - self.device.ClrLineState(lineState) - - def GetAvailableBytes(self): - """ - Returns the available bytes in the input queue of the serial - driver. - """ - n = wxctb.new_intp() - wxctb.intp_assign(n, 0) - self.device.Ioctl(wxctb.CTB_SER_GETINQUE,n) - return wxctb.intp_value(n) - - def GetCommErrors(self): - """ - Get the internal communication errors like breaks, framing, - parity or overrun errors. - Returns the count of each error as a tuple like this: - (b,f,o,p) = dev.GetCommErrors() - b: breaks, f: framing errors, o: overruns, p: parity errors - """ - einfo = wxctb.SerialPort_EINFO() - self.device.Ioctl(wxctb.CTB_SER_GETEINFO,einfo) - return einfo.brk,einfo.frame,einfo.overrun,einfo.parity - - def GetLineState(self): - """ - Returns the current linestates of the CTS, DCD, DSR and RING - signal line as an integer value with the appropriate bits or - -1 on error. - For example: - lines = dev.GetLineState() - if lines & CTS: - print \"CTS is on\" - """ - return self.device.GetLineState() - - def Open(self,devname,baudrate,protocol='8N1',handshake='no_handshake'): - """ - Open the device devname with the given baudrate, the protocol - like '8N1' (default) and the use of the handshake [no_handshake - (default), rtscts or xonxoff] - For example: - At Linux: - dev = SerialPort() - dev.Open(\"/dev/ttyS0\",115200) - or with a datalen of 7 bits, even parity, 2 stopbits and rts/cts - handshake: - dev.Open(\"/dev/ttyS0\",115200,'7E2',True) - At Windows: - dev = SerialPort() - dev.Open(\"COM1\",115200) - dev.Open(\"COM1\",115200,'7E2',True) - Returns the handle on success or a negativ value on failure. - """ - # the following parity values are valid: - # N:None, O:Odd, E:Even, M:Mark, S:Space - parity = {'N':0,'O':1,'E':2,'M':3,'S':4} - # the regular expression ensures a valid value for the datalen - # (5...8 bit) and the count of stopbits (1,2) - reg=re.compile(r"(?P[8765])"r"(?P

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

-

- - - - - -
 
-Modules
       
re
-
sys
-
wxctb
-

- - - - - -
 
-Classes
       
-
wxIOBase -
-
-
wxGPIB -
wxSerialPort -
-
-
-

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

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

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

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

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

[NOEMS])"r"(?P[12])") - self.device = wxctb.SerialPort() - dcs = wxctb.SerialPort_DCS() - dcs.baud = baudrate - res = reg.search(protocol) - # handle the given protocol - if res: - dcs.wordlen = int(res.group('w')) - dcs.stopbits = int(res.group('s')) - dcs.parity = parity[res.group('p')] - # valid handshake are no one, rts/cts or xon/xoff - if handshake == 'rtscts': - dcs.rtscts = True - elif handshake == 'xonxoff': - dcs.xonxoff = True - - return self.device.Open(devname,dcs) - - def Reset(self): - """ - Send a break for 0.25s. - """ - self.device.SendBreak(0) - - def SetBaudrate(self,baudrate): - """ - Set the baudrate for the device. - """ - self.device.SetBaudrate(baudrate) - - def SetLineState(self,lineState): - """ - Set the lines given in the linestate parameter. Possible - values are DTR and/or RTS. For example to set both: - dev.SetLineState( DTR | RTS) - """ - self.device.SetLineState(lineState) - - def SetParityBit(self,parity): - """ - Set the parity bit explicitly to 0 or 1. Use this function, if - you would like to simulate a 9 bit wordlen at what the ninth bit - was represented by the parity bit value. For example: - dev.SetParityBit( 0 ) - dev.Write('some data sent with parity 0') - dev.SetParityBit( 1 ) - dev.Write('another sequence with parity 1') - """ - return self.device.SetParityBit( parity ) - -class GpibDevice(IOBase): - """ - GPIB class - """ - def __init__(self): - IOBase.__init__(self) - - def __del__(self): - self.Close() - - def FindListeners(self,board = 0): - """ - Returns the address of the connected devices as a list. - If no device is listening, the list is empty. If an error - occurs an IOError exception raised. For example: - g = GPIB() - listeners = g.FindListeners() - """ - listeners = wxctb.GPIB_x_FindListeners(board) - if listeners < 0: - raise IOError("GPIB board error") - result = [] - for i in range(1,31): - if listeners & (1 << i): - result.append(i) - return result - - def GetEosChar(self): - """ - Get the internal EOS termination character (see SetEosChar). - For example: - g = GPIB() - g.Open(\"gpib1\",1) - eos = g.GetEosChar() - """ - eos = wxctb.new_intp() - wxctb.intp_assign(eos, 0) - self.device.Ioctl(wxctb.CTB_GPIB_GET_EOS_CHAR,eos) - return wxctb.intp_value(eos) - - def GetEosMode(self): - """ - Get the internal EOS mode (see SetEosMode). - For example: - g = GPIB() - g.Open(\"gpib1\",1) - eos = g.GetEosMode() - """ - mode = wxctb.new_intp() - wxctb.intp_assign(mode, 0) - self.device.Ioctl(wxctb.CTB_GPIB_GET_EOS_MODE,mode) - return wxctb.intp_value(mode) - - def GetError(self): - errorString = " "*256 - self.device.GetError(errorString,256) - return errorString - - def GetSTB(self): - """ - Returns the value of the internal GPIB status byte register. - """ - stb = wxctb.new_intp() - wxctb.intp_assign(stb, 0) - self.device.Ioctl(wxctb.CTB_GPIB_GETRSP,stb) - return wxctb.intp_value(stb) - - # This is only for internal usage!!! - def Ibrd(self,length): - buf = "\x00"*length - state = self.device.Ibrd(buf,length) - return state,buf - - # This is only for internal usage!!! - def Ibwrt(self,string): - return self.device.Ibwrt(string,len(string)) - - def Open(self,devname,adr,eosChar=10,eosMode=0x08|0x04): - """ - Open(gpibdevice,address,eosChar,eosMode) - Opens a connected device at the GPIB bus. gpibdevice means the - controller, (mostly \"gpib1\"), address the address of the desired - device in the range 1...31. The eosChar defines the EOS character - (default is linefeed), eosMode may be a combination of bits ORed - together. The following bits can be used: - 0x04: Terminate read when EOS is detected. - 0x08: Set EOI (End or identify line) with EOS on write function - 0x10: Compare all 8 bits of EOS byte rather than low 7 bits - (all read and write functions). Default is 0x12 - For example: - dev = GPIB() - dev.Open(\"gpib1\",17) - Opens the device with the address 17, linefeed as EOS (default) - and eos mode with 0x04 and 0x08. - Open returns >= 0 or a negativ value, if something going wrong. - """ - self.device = wxctb.GpibDevice() - dcs = wxctb.Gpib_DCS() - dcs.m_address1 = adr - dcs.m_eosChar = eosChar - dcs.m_eosMode = eosMode - result = self.device.Open(devname,dcs) - return result - - def Reset(self): - """ - Resets the connected device. In the GPIB definition, the device - should be reset to it's initial state, so you can restart a - formely lost communication. - """ - self.device.Ioctl(wxctb.CTB_RESET,None) - - def ResetBus(self): - """ - The command asserts the GPIB interface clear (IFC) line for - ast least 100us if the GPIB board is the system controller. - This initializes the GPIB and makes the interface CIC and - active controller with ATN asserted. - Note! The IFC signal resets only the GPIB interface functions - of the bus devices and not the internal device functions. - For a device reset you should use the Reset() command above. - """ - self.device.Ioctl(wxctb.CTB_GPIB_RESET_BUS,None) - - def SetEosChar(self,eos): - """ - Configure the end-of-string (EOS) termination character. - Note! Defining an EOS byte does not cause the driver to - automatically send that byte at the end of write I/O - operations. The application is responsible for placing the - EOS byte at the end of the data strings that it defines. - (National Instruments NI-488.2M Function Reference Manual) - For example: - g = GPIB() - g.Open(\"gpib1\",1) - eos = g.GetEosChar(0x10) - """ - intp = wxctb.new_intp() - wxctb.intp_assign(intp, eos) - return self.device.Ioctl(wxctb.CTB_GPIB_SET_EOS_CHAR,intp) - - def SetEosMode(self,mode): - """ - Set the EOS mode (handling).m_eosMode may be a combination - of bits ORed together. The following bits can be used: - 0x04: Terminate read when EOS is detected. - 0x08: Set EOI (End or identify line) with EOS on write function - 0x10: Compare all 8 bits of EOS byte rather than low 7 bits - (all read and write functions). For example: - g = GPIB() - g.Open(\"gpib1\",1) - eos = g.GetEosMode(0x04 | 0x08) - """ - intp = wxctb.new_intp() - wxctb.intp_assign(intp, mode) - return self.device.Ioctl(wxctb.CTB_GPIB_SET_EOS_MODE,intp) - -def GetKey(): - """ - Returns the current pressed key or '\0', if no key is pressed. - You can simply create a query loop with: - while GetKey() == '\0': - ... make some stuff ... - - """ - return wxctb.GetKey() - -def GetVersion(): - """ - Returns the version of the ctb python module. The numbering - has the following format: x.y.z - x.y means the version of the underlaying ctb lib, z the version - of the python port. - """ - return "0.16" diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/gpib.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/gpib.i deleted file mode 100644 index 752ecd3a18..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/gpib.i +++ /dev/null @@ -1,96 +0,0 @@ -%{ -#include "ctb-0.16/gpib.h" -%} - -%include iobase.i - -namespace ctb { - -%typemap(in) void * dcs (Gpib_DCS tmp) { - /* dont check for list */ - $1 = &tmp; -} - -enum GpibTimeout -{ - GpibTimeoutNONE = 0, - GpibTimeout10us, - GpibTimeout30us, - GpibTimeout100us, - GpibTimeout300us, - GpibTimeout1ms, - GpibTimeout3ms, - GpibTimeout10ms, - GpibTimeout30ms, - GpibTimeout100ms, - GpibTimeout300ms, - GpibTimeout1s, - GpibTimeout3s, - GpibTimeout10s, - GpibTimeout30s, - GpibTimeout100s, - GpibTimeout300s, - GpibTimeout1000s -}; - -struct Gpib_DCS -{ - int m_address1; - int m_address2; - GpibTimeout m_timeout; - bool m_eot; - unsigned char m_eosChar; - unsigned char m_eosMode; - Gpib_DCS(); - ~Gpib_DCS(); - char* GetSettings(); -}; - -enum { - CTB_GPIB_SETADR = CTB_GPIB, - CTB_GPIB_GETRSP, - CTB_GPIB_GETSTA, - CTB_GPIB_GETERR, - CTB_GPIB_GETLINES, - CTB_GPIB_SETTIMEOUT, - CTB_GPIB_GTL, - CTB_GPIB_REN, - CTB_GPIB_RESET_BUS, - CTB_GPIB_SET_EOS_CHAR, - CTB_GPIB_GET_EOS_CHAR, - CTB_GPIB_SET_EOS_MODE, - CTB_GPIB_GET_EOS_MODE -}; - -class GpibDevice : public IOBase -{ -protected: - int m_board; - int m_hd; - int m_state; - int m_error; - int m_count; - int m_asyncio; - Gpib_DCS m_dcs; - int CloseDevice(); - int OpenDevice(const char* devname, void* dcs); - virtual const char* GetErrorString(int error,bool detailed); -public: - GpibDevice(); - virtual ~GpibDevice(); - const char* ClassName(); - virtual const char* GetErrorDescription(int error); - virtual const char* GetErrorNotation(int error); - virtual char* GetSettingsAsString(); - int Ibrd(char* buf,size_t len); - int Ibwrt(char* buf,size_t len); - virtual int Ioctl(int cmd,void* args); - int IsOpen(); - int Read(char* buf,size_t len); - int Write(char* buf,size_t len); - - static int FindListeners(int board = 0); - -}; - -}; diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/iobase.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/iobase.i deleted file mode 100644 index c6bc452adb..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/iobase.i +++ /dev/null @@ -1,59 +0,0 @@ -%{ -#include "ctb-0.16/iobase.h" -%} - -namespace ctb { - -enum { - CTB_RESET = CTB_COMMON -}; - -%typemap(in) char *& readbuf (char * tmp) { - /* dont check for list */ - $1 = &tmp; -} - -%typemap(argout) char *& readbuf { - PyObject * plist = PyList_New(2); - PyList_SetItem(plist, 0, PyString_FromString(*$1)); - PyList_SetItem(plist, 1, $result); - $result = plist; - delete *$1; -} - -%typemap(in) size_t * readedBytes (size_t tmp) { - /* dont check for list */ - $1 = &tmp; -} - -%typemap(argout) size_t * readedBytes { - PyList_Append($result, PyInt_FromLong(*$1)); -} - -class IOBase -{ -protected: - virtual int CloseDevice() = 0; - virtual int OpenDevice(const char* devname, void* dcs = 0L) = 0; -public: - IOBase(); - virtual ~IOBase(); - - virtual const char* ClassName(); - int Close(); - virtual int Ioctl(int cmd,void* args); - virtual int IsOpen() = 0; - int Open(const char* devname,void* dcs=0L); - int PutBack(char ch); - virtual int Read(char* buf,size_t len) = 0; - virtual int ReadUntilEOS(char*& readbuf, - size_t* readedBytes, - char* eosString = "\n", - long timeout_in_ms = 1000L, - char quota = 0); - int Readv(char* buf,size_t len,unsigned int timeout_in_ms); - virtual int Write(char* buf,size_t len) = 0; - int Writev(char* buf,size_t len,unsigned int timeout_in_ms); -}; - -}; diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/kbhit.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/kbhit.i deleted file mode 100644 index 7e5b6cddd3..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/kbhit.i +++ /dev/null @@ -1,9 +0,0 @@ -%{ -#include "ctb-0.16/kbhit.h" -%} - -namespace ctb { - -char GetKey(); - -}; diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/makepy.sh b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/makepy.sh deleted file mode 100755 index 40b49dfb2e..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/makepy.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -CFLAG='' -GPIB_SOURCES='' -GPIB_LIB='' -GPIB_SUPPORT='' - -# the python develop version. Please check the right version of your -# python developent enviroment -PYTHON_VERSION='2.6' - -for arg in $*; do - if [ "$arg" = "USE_GPIB" ]; then - GPIB_SOURCES='../../../src/gpib.cpp' - GPIB_LIB='-lgpib' - GPIB_SUPPORT='Yes' - else - echo '============================================================' - echo 'You run makepy.sh without GPIB support.' - echo 'If you want to create the python wxctb library with' - echo 'GPIB support, rerun the command with:' - echo 'makepy.sh USE_GPIB=1' - echo '============================================================' - GPIB_SUPPORT='No' - fi - if [ "$arg" = "USE_DEBUG" ]; then - CFLAG='-g' - fi -done - -echo "// This file is created automatically, don't change it!" > wxctb.i -echo "%module wxctb" >> wxctb.i -echo "typedef int size_t;" >> wxctb.i -echo "%include timer.i" >> wxctb.i -echo "%include serport.i" >> wxctb.i -echo "%include ../kbhit.i" >> wxctb.i -if [ "$arg" = "USE_GPIB" ]; then - echo "%include ../gpib.i" >> wxctb.i -fi - -echo "swig generates python wrapper files..." -swig -c++ -Wall -nodefault -python -keyword -new_repr -modern wxctb.i - -echo "create shared library wxctb with GPIB=$GPIB_SUPPORT for python"\ - "$PYTHON_VERSION ..." -g++ -Wall $CFLAG -shared -I /usr/include/python$PYTHON_VERSION/ \ - -I ../../../include \ - wxctb_wrap.cxx \ - ../../../src/linux/timer.cpp \ - ../../../src/linux/serport.cpp \ - ../../../src/serportx.cpp \ - ../../../src/kbhit.cpp \ - ../../../src/iobase.cpp \ - ../../../src/fifo.cpp \ - $GPIB_SOURCES \ - $GPIB_LIB \ - -o _wxctb.so - -echo "copy ctb.py, wxctb.py and _wxctb.so to the module/linux folder..." -mkdir -p ../../module/linux -cp ../ctb.py ../../module/linux/ -cp wxctb.py ../../module/linux/ -cp _wxctb.so ../../module/linux/ diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/serport.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/serport.i deleted file mode 100644 index 3150fe9117..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/serport.i +++ /dev/null @@ -1,50 +0,0 @@ -%module serport - -%{ -#include "ctb-0.16/linux/serport.h" -%} - -%include ../serportx.i - -namespace ctb { - -%pythoncode { -COM1 = "/dev/ttyS0" -COM2 = "/dev/ttyS1" -COM3 = "/dev/ttyS2" -COM4 = "/dev/ttyS3" -COM5 = "/dev/ttyS4" -COM6 = "/dev/ttyS5" -COM7 = "/dev/ttyS6" -COM8 = "/dev/ttyS7" -COM9 = "/dev/ttyS8" -}; - -class SerialPort : public SerialPort_x -{ -protected: - int fd; - struct termios t, save_t; - struct serial_icounter_struct save_info, last_info; - speed_t AdaptBaudrate(int baud); - - int CloseDevice(); - int OpenDevice(const char* devname, void* dcs); -public: - SerialPort(); - ~SerialPort(); - - int ChangeLineState(SerialLineState flags); - int ClrLineState(SerialLineState flags); - int GetLineState(); - int Ioctl(int cmd,void* args); - int IsOpen(); - int Read(char* buf,size_t len); - int SendBreak(int duration); - int SetBaudrate(int baudrate); - int SetLineState(SerialLineState flags); - int SetParityBit( bool parity ); - int Write(char* buf,size_t len); -}; - -}; diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/timer.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/timer.i deleted file mode 100644 index 5709224113..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/timer.i +++ /dev/null @@ -1,37 +0,0 @@ -%{ -#include "ctb-0.16/linux/timer.h" -%} - -%include cpointer.i - -// lets create new fuctions for pointer handling in python (for int *exitflag) -%pointer_functions(int, intp); - -namespace ctb { - -// perhaps we doesn''t need timer_control to export -// but we need if we want to inherit from timer in python -struct timer_control -{ - unsigned int usecs; - int *exitflag; - void* (*exitfnc)(void*); -}; - -class Timer -{ -protected: - timer_control control; - int stopped; - pthread_t tid; - unsigned int timer_secs; -public: - Timer(unsigned int msec,int* exitflag,void*(*exitfnc)(void*)=NULL); - ~Timer(); - int start(); - int stop(); -}; - -void sleepms(unsigned int ms); - -}; diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/wxctb.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/wxctb.i deleted file mode 100644 index 7f84b5fb33..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/wxctb.i +++ /dev/null @@ -1,6 +0,0 @@ -// This file is created automatically, don't change it! -%module wxctb -typedef int size_t; -%include timer.i -%include serport.i -%include ../kbhit.i diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/wxctb.py b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/wxctb.py deleted file mode 100644 index f9e0d2ee6e..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/wxctb.py +++ /dev/null @@ -1,264 +0,0 @@ -# This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.40 -# -# Do not make changes to this file unless you know what you are doing--modify -# the SWIG interface file instead. - -from sys import version_info -if version_info >= (2,6,0): - def swig_import_helper(): - from os.path import dirname - import imp - fp = None - try: - fp, pathname, description = imp.find_module('_wxctb', [dirname(__file__)]) - except ImportError: - import _wxctb - return _wxctb - if fp is not None: - try: - _mod = imp.load_module('_wxctb', fp, pathname, description) - finally: - fp.close() - return _mod - _wxctb = swig_import_helper() - del swig_import_helper -else: - import _wxctb -del version_info -try: - _swig_property = property -except NameError: - pass # Python < 2.2 doesn't have 'property'. -def _swig_setattr_nondynamic(self,class_type,name,value,static=1): - if (name == "thisown"): return self.this.own(value) - if (name == "this"): - if type(value).__name__ == 'SwigPyObject': - self.__dict__[name] = value - return - method = class_type.__swig_setmethods__.get(name,None) - if method: return method(self,value) - if (not static) or hasattr(self,name): - self.__dict__[name] = value - else: - raise AttributeError("You cannot add attributes to %s" % self) - -def _swig_setattr(self,class_type,name,value): - return _swig_setattr_nondynamic(self,class_type,name,value,0) - -def _swig_getattr(self,class_type,name): - if (name == "thisown"): return self.this.own() - method = class_type.__swig_getmethods__.get(name,None) - if method: return method(self) - raise AttributeError(name) - -def _swig_repr(self): - try: strthis = "proxy of " + self.this.__repr__() - except: strthis = "" - return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) - -try: - _object = object - _newclass = 1 -except AttributeError: - class _object : pass - _newclass = 0 - - -def _swig_setattr_nondynamic_method(set): - def set_attr(self,name,value): - if (name == "thisown"): return self.this.own(value) - if hasattr(self,name) or (name == "this"): - set(self,name,value) - else: - raise AttributeError("You cannot add attributes to %s" % self) - return set_attr - - - -def new_intp(): - return _wxctb.new_intp() -new_intp = _wxctb.new_intp - -def copy_intp(*args, **kwargs): - return _wxctb.copy_intp(*args, **kwargs) -copy_intp = _wxctb.copy_intp - -def delete_intp(*args, **kwargs): - return _wxctb.delete_intp(*args, **kwargs) -delete_intp = _wxctb.delete_intp - -def intp_assign(*args, **kwargs): - return _wxctb.intp_assign(*args, **kwargs) -intp_assign = _wxctb.intp_assign - -def intp_value(*args, **kwargs): - return _wxctb.intp_value(*args, **kwargs) -intp_value = _wxctb.intp_value -class timer_control(object): - thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') - def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") - __repr__ = _swig_repr - usecs = _swig_property(_wxctb.timer_control_usecs_get, _wxctb.timer_control_usecs_set) - exitflag = _swig_property(_wxctb.timer_control_exitflag_get, _wxctb.timer_control_exitflag_set) - exitfnc = _swig_property(_wxctb.timer_control_exitfnc_get, _wxctb.timer_control_exitfnc_set) -timer_control_swigregister = _wxctb.timer_control_swigregister -timer_control_swigregister(timer_control) - -class Timer(object): - thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') - __repr__ = _swig_repr - def __init__(self, *args, **kwargs): - this = _wxctb.new_Timer(*args, **kwargs) - try: self.this.append(this) - except: self.this = this - __swig_destroy__ = _wxctb.delete_Timer - __del__ = lambda self : None; - def start(self): return _wxctb.Timer_start(self) - def stop(self): return _wxctb.Timer_stop(self) -Timer_swigregister = _wxctb.Timer_swigregister -Timer_swigregister(Timer) - - -def sleepms(*args, **kwargs): - return _wxctb.sleepms(*args, **kwargs) -sleepms = _wxctb.sleepms -CTB_RESET = _wxctb.CTB_RESET -class IOBase(object): - thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') - def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_destroy__ = _wxctb.delete_IOBase - __del__ = lambda self : None; - def ClassName(self): return _wxctb.IOBase_ClassName(self) - def Close(self): return _wxctb.IOBase_Close(self) - def Ioctl(self, *args, **kwargs): return _wxctb.IOBase_Ioctl(self, *args, **kwargs) - def IsOpen(self): return _wxctb.IOBase_IsOpen(self) - def Open(self, *args, **kwargs): return _wxctb.IOBase_Open(self, *args, **kwargs) - def PutBack(self, *args, **kwargs): return _wxctb.IOBase_PutBack(self, *args, **kwargs) - def Read(self, *args, **kwargs): return _wxctb.IOBase_Read(self, *args, **kwargs) - def ReadUntilEOS(self, *args, **kwargs): return _wxctb.IOBase_ReadUntilEOS(self, *args, **kwargs) - def Readv(self, *args, **kwargs): return _wxctb.IOBase_Readv(self, *args, **kwargs) - def Write(self, *args, **kwargs): return _wxctb.IOBase_Write(self, *args, **kwargs) - def Writev(self, *args, **kwargs): return _wxctb.IOBase_Writev(self, *args, **kwargs) -IOBase_swigregister = _wxctb.IOBase_swigregister -IOBase_swigregister(IOBase) - -ParityNone = _wxctb.ParityNone -ParityOdd = _wxctb.ParityOdd -ParityEven = _wxctb.ParityEven -ParityMark = _wxctb.ParityMark -ParitySpace = _wxctb.ParitySpace -LinestateDcd = _wxctb.LinestateDcd -LinestateCts = _wxctb.LinestateCts -LinestateDsr = _wxctb.LinestateDsr -LinestateDtr = _wxctb.LinestateDtr -LinestateRing = _wxctb.LinestateRing -LinestateRts = _wxctb.LinestateRts -LinestateNull = _wxctb.LinestateNull -class SerialPort_DCS(object): - thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') - __repr__ = _swig_repr - baud = _swig_property(_wxctb.SerialPort_DCS_baud_get, _wxctb.SerialPort_DCS_baud_set) - parity = _swig_property(_wxctb.SerialPort_DCS_parity_get, _wxctb.SerialPort_DCS_parity_set) - wordlen = _swig_property(_wxctb.SerialPort_DCS_wordlen_get, _wxctb.SerialPort_DCS_wordlen_set) - stopbits = _swig_property(_wxctb.SerialPort_DCS_stopbits_get, _wxctb.SerialPort_DCS_stopbits_set) - rtscts = _swig_property(_wxctb.SerialPort_DCS_rtscts_get, _wxctb.SerialPort_DCS_rtscts_set) - xonxoff = _swig_property(_wxctb.SerialPort_DCS_xonxoff_get, _wxctb.SerialPort_DCS_xonxoff_set) - buf = _swig_property(_wxctb.SerialPort_DCS_buf_get, _wxctb.SerialPort_DCS_buf_set) - def __init__(self): - this = _wxctb.new_SerialPort_DCS() - try: self.this.append(this) - except: self.this = this - __swig_destroy__ = _wxctb.delete_SerialPort_DCS - __del__ = lambda self : None; - def GetSettings(self): return _wxctb.SerialPort_DCS_GetSettings(self) -SerialPort_DCS_swigregister = _wxctb.SerialPort_DCS_swigregister -SerialPort_DCS_swigregister(SerialPort_DCS) - -class SerialPort_EINFO(object): - thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') - __repr__ = _swig_repr - brk = _swig_property(_wxctb.SerialPort_EINFO_brk_get, _wxctb.SerialPort_EINFO_brk_set) - frame = _swig_property(_wxctb.SerialPort_EINFO_frame_get, _wxctb.SerialPort_EINFO_frame_set) - overrun = _swig_property(_wxctb.SerialPort_EINFO_overrun_get, _wxctb.SerialPort_EINFO_overrun_set) - parity = _swig_property(_wxctb.SerialPort_EINFO_parity_get, _wxctb.SerialPort_EINFO_parity_set) - def __init__(self): - this = _wxctb.new_SerialPort_EINFO() - try: self.this.append(this) - except: self.this = this - __swig_destroy__ = _wxctb.delete_SerialPort_EINFO - __del__ = lambda self : None; -SerialPort_EINFO_swigregister = _wxctb.SerialPort_EINFO_swigregister -SerialPort_EINFO_swigregister(SerialPort_EINFO) - -CTB_SER_GETEINFO = _wxctb.CTB_SER_GETEINFO -CTB_SER_GETBRK = _wxctb.CTB_SER_GETBRK -CTB_SER_GETFRM = _wxctb.CTB_SER_GETFRM -CTB_SER_GETOVR = _wxctb.CTB_SER_GETOVR -CTB_SER_GETPAR = _wxctb.CTB_SER_GETPAR -CTB_SER_GETINQUE = _wxctb.CTB_SER_GETINQUE -CTB_SER_SETPAR = _wxctb.CTB_SER_SETPAR -class SerialPort_x(IOBase): - thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') - def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_destroy__ = _wxctb.delete_SerialPort_x - __del__ = lambda self : None; - def ClassName(self): return _wxctb.SerialPort_x_ClassName(self) - def ChangeLineState(self, *args, **kwargs): return _wxctb.SerialPort_x_ChangeLineState(self, *args, **kwargs) - def ClrLineState(self, *args, **kwargs): return _wxctb.SerialPort_x_ClrLineState(self, *args, **kwargs) - def GetLineState(self): return _wxctb.SerialPort_x_GetLineState(self) - def GetSettingsAsString(self): return _wxctb.SerialPort_x_GetSettingsAsString(self) - def Ioctl(self, *args, **kwargs): return _wxctb.SerialPort_x_Ioctl(self, *args, **kwargs) - def SendBreak(self, *args, **kwargs): return _wxctb.SerialPort_x_SendBreak(self, *args, **kwargs) - def SetBaudrate(self, *args, **kwargs): return _wxctb.SerialPort_x_SetBaudrate(self, *args, **kwargs) - def SetLineState(self, *args, **kwargs): return _wxctb.SerialPort_x_SetLineState(self, *args, **kwargs) - def SetParityBit(self, *args, **kwargs): return _wxctb.SerialPort_x_SetParityBit(self, *args, **kwargs) - IsStandardRate = staticmethod(_wxctb.SerialPort_x_IsStandardRate) -SerialPort_x_swigregister = _wxctb.SerialPort_x_swigregister -SerialPort_x_swigregister(SerialPort_x) - -def SerialPort_x_IsStandardRate(*args, **kwargs): - return _wxctb.SerialPort_x_IsStandardRate(*args, **kwargs) -SerialPort_x_IsStandardRate = _wxctb.SerialPort_x_IsStandardRate - -COM1 = "/dev/ttyS0" -COM2 = "/dev/ttyS1" -COM3 = "/dev/ttyS2" -COM4 = "/dev/ttyS3" -COM5 = "/dev/ttyS4" -COM6 = "/dev/ttyS5" -COM7 = "/dev/ttyS6" -COM8 = "/dev/ttyS7" -COM9 = "/dev/ttyS8" - -class SerialPort(SerialPort_x): - thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') - __repr__ = _swig_repr - def __init__(self): - this = _wxctb.new_SerialPort() - try: self.this.append(this) - except: self.this = this - __swig_destroy__ = _wxctb.delete_SerialPort - __del__ = lambda self : None; - def ChangeLineState(self, *args, **kwargs): return _wxctb.SerialPort_ChangeLineState(self, *args, **kwargs) - def ClrLineState(self, *args, **kwargs): return _wxctb.SerialPort_ClrLineState(self, *args, **kwargs) - def GetLineState(self): return _wxctb.SerialPort_GetLineState(self) - def Ioctl(self, *args, **kwargs): return _wxctb.SerialPort_Ioctl(self, *args, **kwargs) - def IsOpen(self): return _wxctb.SerialPort_IsOpen(self) - def Read(self, *args, **kwargs): return _wxctb.SerialPort_Read(self, *args, **kwargs) - def SendBreak(self, *args, **kwargs): return _wxctb.SerialPort_SendBreak(self, *args, **kwargs) - def SetBaudrate(self, *args, **kwargs): return _wxctb.SerialPort_SetBaudrate(self, *args, **kwargs) - def SetLineState(self, *args, **kwargs): return _wxctb.SerialPort_SetLineState(self, *args, **kwargs) - def SetParityBit(self, *args, **kwargs): return _wxctb.SerialPort_SetParityBit(self, *args, **kwargs) - def Write(self, *args, **kwargs): return _wxctb.SerialPort_Write(self, *args, **kwargs) -SerialPort_swigregister = _wxctb.SerialPort_swigregister -SerialPort_swigregister(SerialPort) - - -def GetKey(): - return _wxctb.GetKey() -GetKey = _wxctb.GetKey - - diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/wxctb_wrap.cxx b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/wxctb_wrap.cxx deleted file mode 100644 index c72f220ded..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/linux/wxctb_wrap.cxx +++ /dev/null @@ -1,6469 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.40 - * - * This file is not intended to be easily readable and contains a number of - * coding conventions designed to improve portability and efficiency. Do not make - * changes to this file unless you know what you are doing--modify the SWIG - * interface file instead. - * ----------------------------------------------------------------------------- */ - -#define SWIGPYTHON -#define SWIG_PYTHON_DIRECTOR_NO_VTABLE - - -#ifdef __cplusplus -/* SwigValueWrapper is described in swig.swg */ -template class SwigValueWrapper { - struct SwigMovePointer { - T *ptr; - SwigMovePointer(T *p) : ptr(p) { } - ~SwigMovePointer() { delete ptr; } - SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } - } pointer; - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); - SwigValueWrapper(const SwigValueWrapper& rhs); -public: - SwigValueWrapper() : pointer(0) { } - SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } - operator T&() const { return *pointer.ptr; } - T *operator&() { return pointer.ptr; } -}; - -template T SwigValueInit() { - return T(); -} -#endif - -/* ----------------------------------------------------------------------------- - * This section contains generic SWIG labels for method/variable - * declarations/attributes, and other compiler dependent labels. - * ----------------------------------------------------------------------------- */ - -/* template workaround for compilers that cannot correctly implement the C++ standard */ -#ifndef SWIGTEMPLATEDISAMBIGUATOR -# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) -# define SWIGTEMPLATEDISAMBIGUATOR template -# elif defined(__HP_aCC) -/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ -/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ -# define SWIGTEMPLATEDISAMBIGUATOR template -# else -# define SWIGTEMPLATEDISAMBIGUATOR -# endif -#endif - -/* inline attribute */ -#ifndef SWIGINLINE -# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) -# define SWIGINLINE inline -# else -# define SWIGINLINE -# endif -#endif - -/* attribute recognised by some compilers to avoid 'unused' warnings */ -#ifndef SWIGUNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -# elif defined(__ICC) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -#endif - -#ifndef SWIG_MSC_UNSUPPRESS_4505 -# if defined(_MSC_VER) -# pragma warning(disable : 4505) /* unreferenced local function has been removed */ -# endif -#endif - -#ifndef SWIGUNUSEDPARM -# ifdef __cplusplus -# define SWIGUNUSEDPARM(p) -# else -# define SWIGUNUSEDPARM(p) p SWIGUNUSED -# endif -#endif - -/* internal SWIG method */ -#ifndef SWIGINTERN -# define SWIGINTERN static SWIGUNUSED -#endif - -/* internal inline SWIG method */ -#ifndef SWIGINTERNINLINE -# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE -#endif - -/* exporting methods */ -#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY -# endif -#endif - -#ifndef SWIGEXPORT -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# if defined(STATIC_LINKED) -# define SWIGEXPORT -# else -# define SWIGEXPORT __declspec(dllexport) -# endif -# else -# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) -# define SWIGEXPORT __attribute__ ((visibility("default"))) -# else -# define SWIGEXPORT -# endif -# endif -#endif - -/* calling conventions for Windows */ -#ifndef SWIGSTDCALL -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# define SWIGSTDCALL __stdcall -# else -# define SWIGSTDCALL -# endif -#endif - -/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ -#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) -# define _CRT_SECURE_NO_DEPRECATE -#endif - -/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ -#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) -# define _SCL_SECURE_NO_DEPRECATE -#endif - - - -/* Python.h has to appear first */ -#include - -/* ----------------------------------------------------------------------------- - * swigrun.swg - * - * This file contains generic C API SWIG runtime support for pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -/* This should only be incremented when either the layout of swig_type_info changes, - or for whatever reason, the runtime changes incompatibly */ -#define SWIG_RUNTIME_VERSION "4" - -/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ -#ifdef SWIG_TYPE_TABLE -# define SWIG_QUOTE_STRING(x) #x -# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) -# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) -#else -# define SWIG_TYPE_TABLE_NAME -#endif - -/* - You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for - creating a static or dynamic library from the SWIG runtime code. - In 99.9% of the cases, SWIG just needs to declare them as 'static'. - - But only do this if strictly necessary, ie, if you have problems - with your compiler or suchlike. -*/ - -#ifndef SWIGRUNTIME -# define SWIGRUNTIME SWIGINTERN -#endif - -#ifndef SWIGRUNTIMEINLINE -# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE -#endif - -/* Generic buffer size */ -#ifndef SWIG_BUFFER_SIZE -# define SWIG_BUFFER_SIZE 1024 -#endif - -/* Flags for pointer conversions */ -#define SWIG_POINTER_DISOWN 0x1 -#define SWIG_CAST_NEW_MEMORY 0x2 - -/* Flags for new pointer objects */ -#define SWIG_POINTER_OWN 0x1 - - -/* - Flags/methods for returning states. - - The SWIG conversion methods, as ConvertPtr, return and integer - that tells if the conversion was successful or not. And if not, - an error code can be returned (see swigerrors.swg for the codes). - - Use the following macros/flags to set or process the returning - states. - - In old versions of SWIG, code such as the following was usually written: - - if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { - // success code - } else { - //fail code - } - - Now you can be more explicit: - - int res = SWIG_ConvertPtr(obj,vptr,ty.flags); - if (SWIG_IsOK(res)) { - // success code - } else { - // fail code - } - - which is the same really, but now you can also do - - Type *ptr; - int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); - if (SWIG_IsOK(res)) { - // success code - if (SWIG_IsNewObj(res) { - ... - delete *ptr; - } else { - ... - } - } else { - // fail code - } - - I.e., now SWIG_ConvertPtr can return new objects and you can - identify the case and take care of the deallocation. Of course that - also requires SWIG_ConvertPtr to return new result values, such as - - int SWIG_ConvertPtr(obj, ptr,...) { - if () { - if () { - *ptr = ; - return SWIG_NEWOBJ; - } else { - *ptr = ; - return SWIG_OLDOBJ; - } - } else { - return SWIG_BADOBJ; - } - } - - Of course, returning the plain '0(success)/-1(fail)' still works, but you can be - more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the - SWIG errors code. - - Finally, if the SWIG_CASTRANK_MODE is enabled, the result code - allows to return the 'cast rank', for example, if you have this - - int food(double) - int fooi(int); - - and you call - - food(1) // cast rank '1' (1 -> 1.0) - fooi(1) // cast rank '0' - - just use the SWIG_AddCast()/SWIG_CheckState() -*/ - -#define SWIG_OK (0) -#define SWIG_ERROR (-1) -#define SWIG_IsOK(r) (r >= 0) -#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) - -/* The CastRankLimit says how many bits are used for the cast rank */ -#define SWIG_CASTRANKLIMIT (1 << 8) -/* The NewMask denotes the object was created (using new/malloc) */ -#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) -/* The TmpMask is for in/out typemaps that use temporal objects */ -#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) -/* Simple returning values */ -#define SWIG_BADOBJ (SWIG_ERROR) -#define SWIG_OLDOBJ (SWIG_OK) -#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) -#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) -/* Check, add and del mask methods */ -#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) -#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) -#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) -#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) -#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) -#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - -/* Cast-Rank Mode */ -#if defined(SWIG_CASTRANK_MODE) -# ifndef SWIG_TypeRank -# define SWIG_TypeRank unsigned long -# endif -# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ -# define SWIG_MAXCASTRANK (2) -# endif -# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) -# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) -SWIGINTERNINLINE int SWIG_AddCast(int r) { - return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; -} -SWIGINTERNINLINE int SWIG_CheckState(int r) { - return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; -} -#else /* no cast-rank mode */ -# define SWIG_AddCast -# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) -#endif - - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void *(*swig_converter_func)(void *, int *); -typedef struct swig_type_info *(*swig_dycast_func)(void **); - -/* Structure to store information on one type */ -typedef struct swig_type_info { - const char *name; /* mangled name of this type */ - const char *str; /* human readable name of this type */ - swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ - struct swig_cast_info *cast; /* linked list of types that can cast into this type */ - void *clientdata; /* language specific type data */ - int owndata; /* flag if the structure owns the clientdata */ -} swig_type_info; - -/* Structure to store a type and conversion function used for casting */ -typedef struct swig_cast_info { - swig_type_info *type; /* pointer to type that is equivalent to this type */ - swig_converter_func converter; /* function to cast the void pointers */ - struct swig_cast_info *next; /* pointer to next cast in linked list */ - struct swig_cast_info *prev; /* pointer to the previous cast */ -} swig_cast_info; - -/* Structure used to store module information - * Each module generates one structure like this, and the runtime collects - * all of these structures and stores them in a circularly linked list.*/ -typedef struct swig_module_info { - swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ - size_t size; /* Number of types in this module */ - struct swig_module_info *next; /* Pointer to next element in circularly linked list */ - swig_type_info **type_initial; /* Array of initially generated type structures */ - swig_cast_info **cast_initial; /* Array of initially generated casting structures */ - void *clientdata; /* Language specific module data */ -} swig_module_info; - -/* - Compare two type names skipping the space characters, therefore - "char*" == "char *" and "Class" == "Class", etc. - - Return 0 when the two name types are equivalent, as in - strncmp, but skipping ' '. -*/ -SWIGRUNTIME int -SWIG_TypeNameComp(const char *f1, const char *l1, - const char *f2, const char *l2) { - for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { - while ((*f1 == ' ') && (f1 != l1)) ++f1; - while ((*f2 == ' ') && (f2 != l2)) ++f2; - if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; - } - return (int)((l1 - f1) - (l2 - f2)); -} - -/* - Check type equivalence in a name list like ||... - Return 0 if not equal, 1 if equal -*/ -SWIGRUNTIME int -SWIG_TypeEquiv(const char *nb, const char *tb) { - int equiv = 0; - const char* te = tb + strlen(tb); - const char* ne = nb; - while (!equiv && *ne) { - for (nb = ne; *ne; ++ne) { - if (*ne == '|') break; - } - equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; - if (*ne) ++ne; - } - return equiv; -} - -/* - Check type equivalence in a name list like ||... - Return 0 if equal, -1 if nb < tb, 1 if nb > tb -*/ -SWIGRUNTIME int -SWIG_TypeCompare(const char *nb, const char *tb) { - int equiv = 0; - const char* te = tb + strlen(tb); - const char* ne = nb; - while (!equiv && *ne) { - for (nb = ne; *ne; ++ne) { - if (*ne == '|') break; - } - equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; - if (*ne) ++ne; - } - return equiv; -} - - -/* - Check the typename -*/ -SWIGRUNTIME swig_cast_info * -SWIG_TypeCheck(const char *c, swig_type_info *ty) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (strcmp(iter->type->name, c) == 0) { - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* - Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison -*/ -SWIGRUNTIME swig_cast_info * -SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (iter->type == from) { - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* - Cast a pointer up an inheritance hierarchy -*/ -SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); -} - -/* - Dynamic pointer casting. Down an inheritance hierarchy -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { - swig_type_info *lastty = ty; - if (!ty || !ty->dcast) return ty; - while (ty && (ty->dcast)) { - ty = (*ty->dcast)(ptr); - if (ty) lastty = ty; - } - return lastty; -} - -/* - Return the name associated with this type -*/ -SWIGRUNTIMEINLINE const char * -SWIG_TypeName(const swig_type_info *ty) { - return ty->name; -} - -/* - Return the pretty name associated with this type, - that is an unmangled type name in a form presentable to the user. -*/ -SWIGRUNTIME const char * -SWIG_TypePrettyName(const swig_type_info *type) { - /* The "str" field contains the equivalent pretty names of the - type, separated by vertical-bar characters. We choose - to print the last name, as it is often (?) the most - specific. */ - if (!type) return NULL; - if (type->str != NULL) { - const char *last_name = type->str; - const char *s; - for (s = type->str; *s; s++) - if (*s == '|') last_name = s+1; - return last_name; - } - else - return type->name; -} - -/* - Set the clientdata field for a type -*/ -SWIGRUNTIME void -SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { - swig_cast_info *cast = ti->cast; - /* if (ti->clientdata == clientdata) return; */ - ti->clientdata = clientdata; - - while (cast) { - if (!cast->converter) { - swig_type_info *tc = cast->type; - if (!tc->clientdata) { - SWIG_TypeClientData(tc, clientdata); - } - } - cast = cast->next; - } -} -SWIGRUNTIME void -SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { - SWIG_TypeClientData(ti, clientdata); - ti->owndata = 1; -} - -/* - Search for a swig_type_info structure only by mangled name - Search is a O(log #types) - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_MangledTypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - swig_module_info *iter = start; - do { - if (iter->size) { - register size_t l = 0; - register size_t r = iter->size - 1; - do { - /* since l+r >= 0, we can (>> 1) instead (/ 2) */ - register size_t i = (l + r) >> 1; - const char *iname = iter->types[i]->name; - if (iname) { - register int compare = strcmp(name, iname); - if (compare == 0) { - return iter->types[i]; - } else if (compare < 0) { - if (i) { - r = i - 1; - } else { - break; - } - } else if (compare > 0) { - l = i + 1; - } - } else { - break; /* should never happen */ - } - } while (l <= r); - } - iter = iter->next; - } while (iter != end); - return 0; -} - -/* - Search for a swig_type_info structure for either a mangled name or a human readable name. - It first searches the mangled names of the types, which is a O(log #types) - If a type is not found it then searches the human readable names, which is O(#types). - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - /* STEP 1: Search the name field using binary search */ - swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); - if (ret) { - return ret; - } else { - /* STEP 2: If the type hasn't been found, do a complete search - of the str field (the human readable name) */ - swig_module_info *iter = start; - do { - register size_t i = 0; - for (; i < iter->size; ++i) { - if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) - return iter->types[i]; - } - iter = iter->next; - } while (iter != end); - } - - /* neither found a match */ - return 0; -} - -/* - Pack binary data into a string -*/ -SWIGRUNTIME char * -SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - register const unsigned char *u = (unsigned char *) ptr; - register const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - register unsigned char uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} - -/* - Unpack binary data from a string -*/ -SWIGRUNTIME const char * -SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - register unsigned char *u = (unsigned char *) ptr; - register const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - register char d = *(c++); - register unsigned char uu; - if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); - else - return (char *) 0; - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); - else - return (char *) 0; - *u = uu; - } - return c; -} - -/* - Pack 'void *' into a string buffer. -*/ -SWIGRUNTIME char * -SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { - char *r = buff; - if ((2*sizeof(void *) + 2) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,&ptr,sizeof(void *)); - if (strlen(name) + 1 > (bsz - (r - buff))) return 0; - strcpy(r,name); - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - *ptr = (void *) 0; - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sizeof(void *)); -} - -SWIGRUNTIME char * -SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { - char *r = buff; - size_t lname = (name ? strlen(name) : 0); - if ((2*sz + 2 + lname) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,ptr,sz); - if (lname) { - strncpy(r,name,lname+1); - } else { - *r = 0; - } - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - memset(ptr,0,sz); - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sz); -} - -#ifdef __cplusplus -} -#endif - -/* Errors in SWIG */ -#define SWIG_UnknownError -1 -#define SWIG_IOError -2 -#define SWIG_RuntimeError -3 -#define SWIG_IndexError -4 -#define SWIG_TypeError -5 -#define SWIG_DivisionByZero -6 -#define SWIG_OverflowError -7 -#define SWIG_SyntaxError -8 -#define SWIG_ValueError -9 -#define SWIG_SystemError -10 -#define SWIG_AttributeError -11 -#define SWIG_MemoryError -12 -#define SWIG_NullReferenceError -13 - - - -/* Compatibility macros for Python 3 */ -#if PY_VERSION_HEX >= 0x03000000 - -#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) -#define PyInt_Check(x) PyLong_Check(x) -#define PyInt_AsLong(x) PyLong_AsLong(x) -#define PyInt_FromLong(x) PyLong_FromLong(x) -#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) - -#endif - -#ifndef Py_TYPE -# define Py_TYPE(op) ((op)->ob_type) -#endif - -/* SWIG APIs for compatibility of both Python 2 & 3 */ - -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_Python_str_FromFormat PyUnicode_FromFormat -#else -# define SWIG_Python_str_FromFormat PyString_FromFormat -#endif - - -/* Warning: This function will allocate a new string in Python 3, - * so please call SWIG_Python_str_DelForPy3(x) to free the space. - */ -SWIGINTERN char* -SWIG_Python_str_AsChar(PyObject *str) -{ -#if PY_VERSION_HEX >= 0x03000000 - char *cstr; - char *newstr; - Py_ssize_t len; - str = PyUnicode_AsUTF8String(str); - PyBytes_AsStringAndSize(str, &cstr, &len); - newstr = (char *) malloc(len+1); - memcpy(newstr, cstr, len+1); - Py_XDECREF(str); - return newstr; -#else - return PyString_AsString(str); -#endif -} - -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) -#else -# define SWIG_Python_str_DelForPy3(x) -#endif - - -SWIGINTERN PyObject* -SWIG_Python_str_FromChar(const char *c) -{ -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_FromString(c); -#else - return PyString_FromString(c); -#endif -} - -/* Add PyOS_snprintf for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 -# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) -# define PyOS_snprintf _snprintf -# else -# define PyOS_snprintf snprintf -# endif -#endif - -/* A crude PyString_FromFormat implementation for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 - -#ifndef SWIG_PYBUFFER_SIZE -# define SWIG_PYBUFFER_SIZE 1024 -#endif - -static PyObject * -PyString_FromFormat(const char *fmt, ...) { - va_list ap; - char buf[SWIG_PYBUFFER_SIZE * 2]; - int res; - va_start(ap, fmt); - res = vsnprintf(buf, sizeof(buf), fmt, ap); - va_end(ap); - return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf); -} -#endif - -/* Add PyObject_Del for old Pythons */ -#if PY_VERSION_HEX < 0x01060000 -# define PyObject_Del(op) PyMem_DEL((op)) -#endif -#ifndef PyObject_DEL -# define PyObject_DEL PyObject_Del -#endif - -/* A crude PyExc_StopIteration exception for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 -# ifndef PyExc_StopIteration -# define PyExc_StopIteration PyExc_RuntimeError -# endif -# ifndef PyObject_GenericGetAttr -# define PyObject_GenericGetAttr 0 -# endif -#endif - -/* Py_NotImplemented is defined in 2.1 and up. */ -#if PY_VERSION_HEX < 0x02010000 -# ifndef Py_NotImplemented -# define Py_NotImplemented PyExc_RuntimeError -# endif -#endif - -/* A crude PyString_AsStringAndSize implementation for old Pythons */ -#if PY_VERSION_HEX < 0x02010000 -# ifndef PyString_AsStringAndSize -# define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;} -# endif -#endif - -/* PySequence_Size for old Pythons */ -#if PY_VERSION_HEX < 0x02000000 -# ifndef PySequence_Size -# define PySequence_Size PySequence_Length -# endif -#endif - -/* PyBool_FromLong for old Pythons */ -#if PY_VERSION_HEX < 0x02030000 -static -PyObject *PyBool_FromLong(long ok) -{ - PyObject *result = ok ? Py_True : Py_False; - Py_INCREF(result); - return result; -} -#endif - -/* Py_ssize_t for old Pythons */ -/* This code is as recommended by: */ -/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ -#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) -typedef int Py_ssize_t; -# define PY_SSIZE_T_MAX INT_MAX -# define PY_SSIZE_T_MIN INT_MIN -#endif - -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - -SWIGRUNTIME PyObject* -SWIG_Python_ErrorType(int code) { - PyObject* type = 0; - switch(code) { - case SWIG_MemoryError: - type = PyExc_MemoryError; - break; - case SWIG_IOError: - type = PyExc_IOError; - break; - case SWIG_RuntimeError: - type = PyExc_RuntimeError; - break; - case SWIG_IndexError: - type = PyExc_IndexError; - break; - case SWIG_TypeError: - type = PyExc_TypeError; - break; - case SWIG_DivisionByZero: - type = PyExc_ZeroDivisionError; - break; - case SWIG_OverflowError: - type = PyExc_OverflowError; - break; - case SWIG_SyntaxError: - type = PyExc_SyntaxError; - break; - case SWIG_ValueError: - type = PyExc_ValueError; - break; - case SWIG_SystemError: - type = PyExc_SystemError; - break; - case SWIG_AttributeError: - type = PyExc_AttributeError; - break; - default: - type = PyExc_RuntimeError; - } - return type; -} - - -SWIGRUNTIME void -SWIG_Python_AddErrorMsg(const char* mesg) -{ - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - - if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); - if (value) { - char *tmp; - PyObject *old_str = PyObject_Str(value); - PyErr_Clear(); - Py_XINCREF(type); - - PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(old_str); - Py_DECREF(value); - } else { - PyErr_SetString(PyExc_RuntimeError, mesg); - } -} - -#if defined(SWIG_PYTHON_NO_THREADS) -# if defined(SWIG_PYTHON_THREADS) -# undef SWIG_PYTHON_THREADS -# endif -#endif -#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ -# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) -# if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */ -# define SWIG_PYTHON_USE_GIL -# endif -# endif -# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ -# ifndef SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() -# endif -# ifdef __cplusplus /* C++ code */ - class SWIG_Python_Thread_Block { - bool status; - PyGILState_STATE state; - public: - void end() { if (status) { PyGILState_Release(state); status = false;} } - SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} - ~SWIG_Python_Thread_Block() { end(); } - }; - class SWIG_Python_Thread_Allow { - bool status; - PyThreadState *save; - public: - void end() { if (status) { PyEval_RestoreThread(save); status = false; }} - SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} - ~SWIG_Python_Thread_Allow() { end(); } - }; -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block -# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow -# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() -# else /* C code */ -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() -# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() -# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) -# endif -# else /* Old thread way, not implemented, user must provide it */ -# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) -# define SWIG_PYTHON_INITIALIZE_THREADS -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_END_BLOCK) -# define SWIG_PYTHON_THREAD_END_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# endif -# if !defined(SWIG_PYTHON_THREAD_END_ALLOW) -# define SWIG_PYTHON_THREAD_END_ALLOW -# endif -# endif -#else /* No thread support */ -# define SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# define SWIG_PYTHON_THREAD_END_BLOCK -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# define SWIG_PYTHON_THREAD_END_ALLOW -#endif - -/* ----------------------------------------------------------------------------- - * Python API portion that goes into the runtime - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#if 0 -} /* cc-mode */ -#endif -#endif - -/* ----------------------------------------------------------------------------- - * Constant declarations - * ----------------------------------------------------------------------------- */ - -/* Constant Types */ -#define SWIG_PY_POINTER 4 -#define SWIG_PY_BINARY 5 - -/* Constant information structure */ -typedef struct swig_const_info { - int type; - char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_const_info; - - -/* ----------------------------------------------------------------------------- - * Wrapper of PyInstanceMethod_New() used in Python 3 - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ -SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func) -{ -#if PY_VERSION_HEX >= 0x03000000 - return PyInstanceMethod_New(func); -#else - return NULL; -#endif -} - -#ifdef __cplusplus -#if 0 -{ /* cc-mode */ -#endif -} -#endif - - -/* ----------------------------------------------------------------------------- - * See the LICENSE file for information on copyright, usage and redistribution - * of SWIG, and the README file for authors - http://www.swig.org/release.html. - * - * pyrun.swg - * - * This file contains the runtime support for Python modules - * and includes code for managing global variables and pointer - * type checking. - * - * ----------------------------------------------------------------------------- */ - -/* Common SWIG API */ - -/* for raw pointers */ -#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(ptr, type, flags) -#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) -#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) -#define swig_owntype int - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Python_GetModule() -#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) - -#define SWIG_SetErrorObj SWIG_Python_SetErrorObj -#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg -#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) -#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) -#define SWIG_fail goto fail - - -/* Runtime API implementation */ - -/* Error manipulation */ - -SWIGINTERN void -SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetObject(errtype, obj); - Py_DECREF(obj); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -SWIGINTERN void -SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(errtype, (char *) msg); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) - -/* Set a constant value */ - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { - PyDict_SetItemString(d, (char*) name, obj); - Py_DECREF(obj); -} - -/* Append a value to the result obj */ - -SWIGINTERN PyObject* -SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { -#if !defined(SWIG_PYTHON_OUTPUT_TUPLE) - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyList_Check(result)) { - PyObject *o2 = result; - result = PyList_New(1); - PyList_SetItem(result, 0, o2); - } - PyList_Append(result,obj); - Py_DECREF(obj); - } - return result; -#else - PyObject* o2; - PyObject* o3; - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyTuple_Check(result)) { - o2 = result; - result = PyTuple_New(1); - PyTuple_SET_ITEM(result, 0, o2); - } - o3 = PyTuple_New(1); - PyTuple_SET_ITEM(o3, 0, obj); - o2 = result; - result = PySequence_Concat(o2, o3); - Py_DECREF(o2); - Py_DECREF(o3); - } - return result; -#endif -} - -/* Unpack the argument tuple */ - -SWIGINTERN int -SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) -{ - if (!args) { - if (!min && !max) { - return 1; - } else { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", - name, (min == max ? "" : "at least "), (int)min); - return 0; - } - } - if (!PyTuple_Check(args)) { - PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); - return 0; - } else { - register Py_ssize_t l = PyTuple_GET_SIZE(args); - if (l < min) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at least "), (int)min, (int)l); - return 0; - } else if (l > max) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at most "), (int)max, (int)l); - return 0; - } else { - register int i; - for (i = 0; i < l; ++i) { - objs[i] = PyTuple_GET_ITEM(args, i); - } - for (; l < max; ++l) { - objs[l] = 0; - } - return i + 1; - } - } -} - -/* A functor is a function object with one single object argument */ -#if PY_VERSION_HEX >= 0x02020000 -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); -#else -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj); -#endif - -/* - Helper for static pointer initialization for both C and C++ code, for example - static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); -*/ -#ifdef __cplusplus -#define SWIG_STATIC_POINTER(var) var -#else -#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var -#endif - -/* ----------------------------------------------------------------------------- - * Pointer declarations - * ----------------------------------------------------------------------------- */ - -/* Flags for new pointer objects */ -#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) -#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) - -#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) - -#ifdef __cplusplus -extern "C" { -#if 0 -} /* cc-mode */ -#endif -#endif - -/* How to access Py_None */ -#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# ifndef SWIG_PYTHON_NO_BUILD_NONE -# ifndef SWIG_PYTHON_BUILD_NONE -# define SWIG_PYTHON_BUILD_NONE -# endif -# endif -#endif - -#ifdef SWIG_PYTHON_BUILD_NONE -# ifdef Py_None -# undef Py_None -# define Py_None SWIG_Py_None() -# endif -SWIGRUNTIMEINLINE PyObject * -_SWIG_Py_None(void) -{ - PyObject *none = Py_BuildValue((char*)""); - Py_DECREF(none); - return none; -} -SWIGRUNTIME PyObject * -SWIG_Py_None(void) -{ - static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None(); - return none; -} -#endif - -/* The python void return value */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Py_Void(void) -{ - PyObject *none = Py_None; - Py_INCREF(none); - return none; -} - -/* SwigPyClientData */ - -typedef struct { - PyObject *klass; - PyObject *newraw; - PyObject *newargs; - PyObject *destroy; - int delargs; - int implicitconv; -} SwigPyClientData; - -SWIGRUNTIMEINLINE int -SWIG_Python_CheckImplicit(swig_type_info *ty) -{ - SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; - return data ? data->implicitconv : 0; -} - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_ExceptionType(swig_type_info *desc) { - SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; - PyObject *klass = data ? data->klass : 0; - return (klass ? klass : PyExc_RuntimeError); -} - - -SWIGRUNTIME SwigPyClientData * -SwigPyClientData_New(PyObject* obj) -{ - if (!obj) { - return 0; - } else { - SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); - /* the klass element */ - data->klass = obj; - Py_INCREF(data->klass); - /* the newraw method and newargs arguments used to create a new raw instance */ - if (PyClass_Check(obj)) { - data->newraw = 0; - data->newargs = obj; - Py_INCREF(obj); - } else { -#if (PY_VERSION_HEX < 0x02020000) - data->newraw = 0; -#else - data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__"); -#endif - if (data->newraw) { - Py_INCREF(data->newraw); - data->newargs = PyTuple_New(1); - PyTuple_SetItem(data->newargs, 0, obj); - } else { - data->newargs = obj; - } - Py_INCREF(data->newargs); - } - /* the destroy method, aka as the C++ delete method */ - data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__"); - if (PyErr_Occurred()) { - PyErr_Clear(); - data->destroy = 0; - } - if (data->destroy) { - int flags; - Py_INCREF(data->destroy); - flags = PyCFunction_GET_FLAGS(data->destroy); -#ifdef METH_O - data->delargs = !(flags & (METH_O)); -#else - data->delargs = 0; -#endif - } else { - data->delargs = 0; - } - data->implicitconv = 0; - return data; - } -} - -SWIGRUNTIME void -SwigPyClientData_Del(SwigPyClientData* data) -{ - Py_XDECREF(data->newraw); - Py_XDECREF(data->newargs); - Py_XDECREF(data->destroy); -} - -/* =============== SwigPyObject =====================*/ - -typedef struct { - PyObject_HEAD - void *ptr; - swig_type_info *ty; - int own; - PyObject *next; -} SwigPyObject; - -SWIGRUNTIME PyObject * -SwigPyObject_long(SwigPyObject *v) -{ - return PyLong_FromVoidPtr(v->ptr); -} - -SWIGRUNTIME PyObject * -SwigPyObject_format(const char* fmt, SwigPyObject *v) -{ - PyObject *res = NULL; - PyObject *args = PyTuple_New(1); - if (args) { - if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { - PyObject *ofmt = SWIG_Python_str_FromChar(fmt); - if (ofmt) { -#if PY_VERSION_HEX >= 0x03000000 - res = PyUnicode_Format(ofmt,args); -#else - res = PyString_Format(ofmt,args); -#endif - Py_DECREF(ofmt); - } - Py_DECREF(args); - } - } - return res; -} - -SWIGRUNTIME PyObject * -SwigPyObject_oct(SwigPyObject *v) -{ - return SwigPyObject_format("%o",v); -} - -SWIGRUNTIME PyObject * -SwigPyObject_hex(SwigPyObject *v) -{ - return SwigPyObject_format("%x",v); -} - -SWIGRUNTIME PyObject * -#ifdef METH_NOARGS -SwigPyObject_repr(SwigPyObject *v) -#else -SwigPyObject_repr(SwigPyObject *v, PyObject *args) -#endif -{ - const char *name = SWIG_TypePrettyName(v->ty); - PyObject *repr = SWIG_Python_str_FromFormat("", name, v); - if (v->next) { -#ifdef METH_NOARGS - PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); -#else - PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); -#endif -#if PY_VERSION_HEX >= 0x03000000 - PyObject *joined = PyUnicode_Concat(repr, nrep); - Py_DecRef(repr); - Py_DecRef(nrep); - repr = joined; -#else - PyString_ConcatAndDel(&repr,nrep); -#endif - } - return repr; -} - -SWIGRUNTIME int -SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) -{ - char *str; -#ifdef METH_NOARGS - PyObject *repr = SwigPyObject_repr(v); -#else - PyObject *repr = SwigPyObject_repr(v, NULL); -#endif - if (repr) { - str = SWIG_Python_str_AsChar(repr); - fputs(str, fp); - SWIG_Python_str_DelForPy3(str); - Py_DECREF(repr); - return 0; - } else { - return 1; - } -} - -SWIGRUNTIME PyObject * -SwigPyObject_str(SwigPyObject *v) -{ - char result[SWIG_BUFFER_SIZE]; - return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? - SWIG_Python_str_FromChar(result) : 0; -} - -SWIGRUNTIME int -SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) -{ - void *i = v->ptr; - void *j = w->ptr; - return (i < j) ? -1 : ((i > j) ? 1 : 0); -} - -/* Added for Python 3.x, would it also be useful for Python 2.x? */ -SWIGRUNTIME PyObject* -SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) -{ - PyObject* res; - if( op != Py_EQ && op != Py_NE ) { - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; - } - if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ) - res = Py_True; - else - res = Py_False; - Py_INCREF(res); - return res; -} - - -SWIGRUNTIME PyTypeObject* _PySwigObject_type(void); - -SWIGRUNTIME PyTypeObject* -SwigPyObject_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type(); - return type; -} - -SWIGRUNTIMEINLINE int -SwigPyObject_Check(PyObject *op) { - return (Py_TYPE(op) == SwigPyObject_type()) - || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own); - -SWIGRUNTIME void -SwigPyObject_dealloc(PyObject *v) -{ - SwigPyObject *sobj = (SwigPyObject *) v; - PyObject *next = sobj->next; - if (sobj->own == SWIG_POINTER_OWN) { - swig_type_info *ty = sobj->ty; - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - PyObject *destroy = data ? data->destroy : 0; - if (destroy) { - /* destroy is always a VARARGS method */ - PyObject *res; - if (data->delargs) { - /* we need to create a temporary object to carry the destroy operation */ - PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); - res = SWIG_Python_CallFunctor(destroy, tmp); - Py_DECREF(tmp); - } else { - PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); - PyObject *mself = PyCFunction_GET_SELF(destroy); - res = ((*meth)(mself, v)); - } - Py_XDECREF(res); - } -#if !defined(SWIG_PYTHON_SILENT_MEMLEAK) - else { - const char *name = SWIG_TypePrettyName(ty); - printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); - } -#endif - } - Py_XDECREF(next); - PyObject_DEL(v); -} - -SWIGRUNTIME PyObject* -SwigPyObject_append(PyObject* v, PyObject* next) -{ - SwigPyObject *sobj = (SwigPyObject *) v; -#ifndef METH_O - PyObject *tmp = 0; - if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; - next = tmp; -#endif - if (!SwigPyObject_Check(next)) { - return NULL; - } - sobj->next = next; - Py_INCREF(next); - return SWIG_Py_Void(); -} - -SWIGRUNTIME PyObject* -#ifdef METH_NOARGS -SwigPyObject_next(PyObject* v) -#else -SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif -{ - SwigPyObject *sobj = (SwigPyObject *) v; - if (sobj->next) { - Py_INCREF(sobj->next); - return sobj->next; - } else { - return SWIG_Py_Void(); - } -} - -SWIGINTERN PyObject* -#ifdef METH_NOARGS -SwigPyObject_disown(PyObject *v) -#else -SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = 0; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -#ifdef METH_NOARGS -SwigPyObject_acquire(PyObject *v) -#else -SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif -{ - SwigPyObject *sobj = (SwigPyObject *)v; - sobj->own = SWIG_POINTER_OWN; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -SwigPyObject_own(PyObject *v, PyObject *args) -{ - PyObject *val = 0; -#if (PY_VERSION_HEX < 0x02020000) - if (!PyArg_ParseTuple(args,(char *)"|O:own",&val)) -#else - if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) -#endif - { - return NULL; - } - else - { - SwigPyObject *sobj = (SwigPyObject *)v; - PyObject *obj = PyBool_FromLong(sobj->own); - if (val) { -#ifdef METH_NOARGS - if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v); - } else { - SwigPyObject_disown(v); - } -#else - if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v,args); - } else { - SwigPyObject_disown(v,args); - } -#endif - } - return obj; - } -} - -#ifdef METH_O -static PyMethodDef -swigobject_methods[] = { - {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, - {0, 0, 0, 0} -}; -#else -static PyMethodDef -swigobject_methods[] = { - {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, - {0, 0, 0, 0} -}; -#endif - -#if PY_VERSION_HEX < 0x02020000 -SWIGINTERN PyObject * -SwigPyObject_getattr(SwigPyObject *sobj,char *name) -{ - return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); -} -#endif - -SWIGRUNTIME PyTypeObject* -_PySwigObject_type(void) { - static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - - static PyNumberMethods SwigPyObject_as_number = { - (binaryfunc)0, /*nb_add*/ - (binaryfunc)0, /*nb_subtract*/ - (binaryfunc)0, /*nb_multiply*/ - /* nb_divide removed in Python 3 */ -#if PY_VERSION_HEX < 0x03000000 - (binaryfunc)0, /*nb_divide*/ -#endif - (binaryfunc)0, /*nb_remainder*/ - (binaryfunc)0, /*nb_divmod*/ - (ternaryfunc)0,/*nb_power*/ - (unaryfunc)0, /*nb_negative*/ - (unaryfunc)0, /*nb_positive*/ - (unaryfunc)0, /*nb_absolute*/ - (inquiry)0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ -#if PY_VERSION_HEX < 0x03000000 - 0, /*nb_coerce*/ -#endif - (unaryfunc)SwigPyObject_long, /*nb_int*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_long, /*nb_long*/ -#else - 0, /*nb_reserved*/ -#endif - (unaryfunc)0, /*nb_float*/ -#if PY_VERSION_HEX < 0x03000000 - (unaryfunc)SwigPyObject_oct, /*nb_oct*/ - (unaryfunc)SwigPyObject_hex, /*nb_hex*/ -#endif -#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ -#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ -#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ -#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */ - 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ -#endif - }; - - static PyTypeObject swigpyobject_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp - = { - /* PyObject header changed in Python 3 */ -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(&PyType_Type, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - (char *)"SwigPyObject", /* tp_name */ - sizeof(SwigPyObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyObject_dealloc, /* tp_dealloc */ - (printfunc)SwigPyObject_print, /* tp_print */ -#if PY_VERSION_HEX < 0x02020000 - (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ -#else - (getattrfunc)0, /* tp_getattr */ -#endif - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX >= 0x03000000 - 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ -#else - (cmpfunc)SwigPyObject_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyObject_repr, /* tp_repr */ - &SwigPyObject_as_number, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)SwigPyObject_str, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigobject_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - (richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 - 0, /* tp_iter */ - 0, /* tp_iternext */ - swigobject_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 - 0, /* tp_del */ -#endif -#ifdef COUNT_ALLOCS - 0,0,0,0 /* tp_alloc -> tp_next */ -#endif - }; - swigpyobject_type = tmp; - /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ -#if PY_VERSION_HEX < 0x03000000 - swigpyobject_type.ob_type = &PyType_Type; -#endif - type_init = 1; - } - return &swigpyobject_type; -} - -SWIGRUNTIME PyObject * -SwigPyObject_New(void *ptr, swig_type_info *ty, int own) -{ - SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); - if (sobj) { - sobj->ptr = ptr; - sobj->ty = ty; - sobj->own = own; - sobj->next = 0; - } - return (PyObject *)sobj; -} - -/* ----------------------------------------------------------------------------- - * Implements a simple Swig Packed type, and use it instead of string - * ----------------------------------------------------------------------------- */ - -typedef struct { - PyObject_HEAD - void *pack; - swig_type_info *ty; - size_t size; -} SwigPyPacked; - -SWIGRUNTIME int -SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) -{ - char result[SWIG_BUFFER_SIZE]; - fputs("pack, v->size, 0, sizeof(result))) { - fputs("at ", fp); - fputs(result, fp); - } - fputs(v->ty->name,fp); - fputs(">", fp); - return 0; -} - -SWIGRUNTIME PyObject * -SwigPyPacked_repr(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { - return SWIG_Python_str_FromFormat("", result, v->ty->name); - } else { - return SWIG_Python_str_FromFormat("", v->ty->name); - } -} - -SWIGRUNTIME PyObject * -SwigPyPacked_str(SwigPyPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); - } else { - return SWIG_Python_str_FromChar(v->ty->name); - } -} - -SWIGRUNTIME int -SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) -{ - size_t i = v->size; - size_t j = w->size; - int s = (i < j) ? -1 : ((i > j) ? 1 : 0); - return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); -} - -SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void); - -SWIGRUNTIME PyTypeObject* -SwigPyPacked_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type(); - return type; -} - -SWIGRUNTIMEINLINE int -SwigPyPacked_Check(PyObject *op) { - return ((op)->ob_type == _PySwigPacked_type()) - || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); -} - -SWIGRUNTIME void -SwigPyPacked_dealloc(PyObject *v) -{ - if (SwigPyPacked_Check(v)) { - SwigPyPacked *sobj = (SwigPyPacked *) v; - free(sobj->pack); - } - PyObject_DEL(v); -} - -SWIGRUNTIME PyTypeObject* -_PySwigPacked_type(void) { - static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject swigpypacked_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp - = { - /* PyObject header changed in Python 3 */ -#if PY_VERSION_HEX>=0x03000000 - PyVarObject_HEAD_INIT(&PyType_Type, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif - (char *)"SwigPyPacked", /* tp_name */ - sizeof(SwigPyPacked), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ - (printfunc)SwigPyPacked_print, /* tp_print */ - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ -#if PY_VERSION_HEX>=0x03000000 - 0, /* tp_reserved in 3.0.1 */ -#else - (cmpfunc)SwigPyPacked_compare, /* tp_compare */ -#endif - (reprfunc)SwigPyPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)SwigPyPacked_str, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigpacked_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 - 0, /* tp_del */ -#endif -#ifdef COUNT_ALLOCS - 0,0,0,0 /* tp_alloc -> tp_next */ -#endif - }; - swigpypacked_type = tmp; - /* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */ -#if PY_VERSION_HEX < 0x03000000 - swigpypacked_type.ob_type = &PyType_Type; -#endif - type_init = 1; - } - return &swigpypacked_type; -} - -SWIGRUNTIME PyObject * -SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) -{ - SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); - if (sobj) { - void *pack = malloc(size); - if (pack) { - memcpy(pack, ptr, size); - sobj->pack = pack; - sobj->ty = ty; - sobj->size = size; - } else { - PyObject_DEL((PyObject *) sobj); - sobj = 0; - } - } - return (PyObject *) sobj; -} - -SWIGRUNTIME swig_type_info * -SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) -{ - if (SwigPyPacked_Check(obj)) { - SwigPyPacked *sobj = (SwigPyPacked *)obj; - if (sobj->size != size) return 0; - memcpy(ptr, sobj->pack, size); - return sobj->ty; - } else { - return 0; - } -} - -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -SWIGRUNTIMEINLINE PyObject * -_SWIG_This(void) -{ - return SWIG_Python_str_FromChar("this"); -} - -SWIGRUNTIME PyObject * -SWIG_This(void) -{ - static PyObject *SWIG_STATIC_POINTER(swig_this) = _SWIG_This(); - return swig_this; -} - -/* #define SWIG_PYTHON_SLOW_GETSET_THIS */ - -/* TODO: I don't know how to implement the fast getset in Python 3 right now */ -#if PY_VERSION_HEX>=0x03000000 -#define SWIG_PYTHON_SLOW_GETSET_THIS -#endif - -SWIGRUNTIME SwigPyObject * -SWIG_Python_GetSwigThis(PyObject *pyobj) -{ - if (SwigPyObject_Check(pyobj)) { - return (SwigPyObject *) pyobj; - } else { - PyObject *obj = 0; -#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) - if (PyInstance_Check(pyobj)) { - obj = _PyInstance_Lookup(pyobj, SWIG_This()); - } else { - PyObject **dictptr = _PyObject_GetDictPtr(pyobj); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; - } else { -#ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); - return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; - } -#endif - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } - } - } -#else - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } -#endif - if (obj && !SwigPyObject_Check(obj)) { - /* a PyObject is called 'this', try to get the 'real this' - SwigPyObject from it */ - return SWIG_Python_GetSwigThis(obj); - } - return (SwigPyObject *)obj; - } -} - -/* Acquire a pointer value */ - -SWIGRUNTIME int -SWIG_Python_AcquirePtr(PyObject *obj, int own) { - if (own == SWIG_POINTER_OWN) { - SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); - if (sobj) { - int oldown = sobj->own; - sobj->own = own; - return oldown; - } - } - return 0; -} - -/* Convert a pointer value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { - if (!obj) return SWIG_ERROR; - if (obj == Py_None) { - if (ptr) *ptr = 0; - return SWIG_OK; - } else { - SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); - if (own) - *own = 0; - while (sobj) { - void *vptr = sobj->ptr; - if (ty) { - swig_type_info *to = sobj->ty; - if (to == ty) { - /* no type cast needed */ - if (ptr) *ptr = vptr; - break; - } else { - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) { - sobj = (SwigPyObject *)sobj->next; - } else { - if (ptr) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); - if (own) - *own = *own | SWIG_CAST_NEW_MEMORY; - } - } - break; - } - } - } else { - if (ptr) *ptr = vptr; - break; - } - } - if (sobj) { - if (own) - *own = *own | sobj->own; - if (flags & SWIG_POINTER_DISOWN) { - sobj->own = 0; - } - return SWIG_OK; - } else { - int res = SWIG_ERROR; - if (flags & SWIG_POINTER_IMPLICIT_CONV) { - SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; - if (data && !data->implicitconv) { - PyObject *klass = data->klass; - if (klass) { - PyObject *impconv; - data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ - impconv = SWIG_Python_CallFunctor(klass, obj); - data->implicitconv = 0; - if (PyErr_Occurred()) { - PyErr_Clear(); - impconv = 0; - } - if (impconv) { - SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); - if (iobj) { - void *vptr; - res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); - if (SWIG_IsOK(res)) { - if (ptr) { - *ptr = vptr; - /* transfer the ownership to 'ptr' */ - iobj->own = 0; - res = SWIG_AddCast(res); - res = SWIG_AddNewMask(res); - } else { - res = SWIG_AddCast(res); - } - } - } - Py_DECREF(impconv); - } - } - } - } - return res; - } - } -} - -/* Convert a function ptr value */ - -SWIGRUNTIME int -SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { - if (!PyCFunction_Check(obj)) { - return SWIG_ConvertPtr(obj, ptr, ty, 0); - } else { - void *vptr = 0; - - /* here we get the method pointer for callbacks */ - const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); - const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) - desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) - return SWIG_ERROR; - if (ty) { - swig_cast_info *tc = SWIG_TypeCheck(desc,ty); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - return SWIG_ERROR; - } - } else { - *ptr = vptr; - } - return SWIG_OK; - } -} - -/* Convert a packed value value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -/* ----------------------------------------------------------------------------- - * Create a new pointer object - * ----------------------------------------------------------------------------- */ - -/* - Create a new instance object, without calling __init__, and set the - 'this' attribute. -*/ - -SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) -{ -#if (PY_VERSION_HEX >= 0x02020000) - PyObject *inst = 0; - PyObject *newraw = data->newraw; - if (newraw) { - inst = PyObject_Call(newraw, data->newargs, NULL); - if (inst) { -#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - PyObject **dictptr = _PyObject_GetDictPtr(inst); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - PyDict_SetItem(dict, SWIG_This(), swig_this); - } - } -#else - PyObject *key = SWIG_This(); - PyObject_SetAttr(inst, key, swig_this); -#endif - } - } else { -#if PY_VERSION_HEX >= 0x03000000 - inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); - PyObject_SetAttr(inst, SWIG_This(), swig_this); - Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; -#else - PyObject *dict = PyDict_New(); - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); -#endif - } - return inst; -#else -#if (PY_VERSION_HEX >= 0x02010000) - PyObject *inst; - PyObject *dict = PyDict_New(); - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); - return (PyObject *) inst; -#else - PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); - if (inst == NULL) { - return NULL; - } - inst->in_class = (PyClassObject *)data->newargs; - Py_INCREF(inst->in_class); - inst->in_dict = PyDict_New(); - if (inst->in_dict == NULL) { - Py_DECREF(inst); - return NULL; - } -#ifdef Py_TPFLAGS_HAVE_WEAKREFS - inst->in_weakreflist = NULL; -#endif -#ifdef Py_TPFLAGS_GC - PyObject_GC_Init(inst); -#endif - PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this); - return (PyObject *) inst; -#endif -#endif -} - -SWIGRUNTIME void -SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) -{ - PyObject *dict; -#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - PyObject **dictptr = _PyObject_GetDictPtr(inst); - if (dictptr != NULL) { - dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - } - PyDict_SetItem(dict, SWIG_This(), swig_this); - return; - } -#endif - dict = PyObject_GetAttrString(inst, (char*)"__dict__"); - PyDict_SetItem(dict, SWIG_This(), swig_this); - Py_DECREF(dict); -} - - -SWIGINTERN PyObject * -SWIG_Python_InitShadowInstance(PyObject *args) { - PyObject *obj[2]; - if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) { - return NULL; - } else { - SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); - if (sthis) { - SwigPyObject_append((PyObject*) sthis, obj[1]); - } else { - SWIG_Python_SetSwigThis(obj[0], obj[1]); - } - return SWIG_Py_Void(); - } -} - -/* Create a new pointer object */ - -SWIGRUNTIME PyObject * -SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) { - if (!ptr) { - return SWIG_Py_Void(); - } else { - int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - PyObject *robj = SwigPyObject_New(ptr, type, own); - SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; - if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { - PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); - if (inst) { - Py_DECREF(robj); - robj = inst; - } - } - return robj; - } -} - -/* Create a new packed object */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); -} - -/* -----------------------------------------------------------------------------* - * Get type list - * -----------------------------------------------------------------------------*/ - -#ifdef SWIG_LINK_RUNTIME -void *SWIG_ReturnGlobalTypeList(void *); -#endif - -SWIGRUNTIME swig_module_info * -SWIG_Python_GetModule(void) { - static void *type_pointer = (void *)0; - /* first check if module already created */ - if (!type_pointer) { -#ifdef SWIG_LINK_RUNTIME - type_pointer = SWIG_ReturnGlobalTypeList((void *)0); -#else - type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, - (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); - if (PyErr_Occurred()) { - PyErr_Clear(); - type_pointer = (void *)0; - } -#endif - } - return (swig_module_info *) type_pointer; -} - -#if PY_MAJOR_VERSION < 2 -/* PyModule_AddObject function was introduced in Python 2.0. The following function - is copied out of Python/modsupport.c in python version 2.3.4 */ -SWIGINTERN int -PyModule_AddObject(PyObject *m, char *name, PyObject *o) -{ - PyObject *dict; - if (!PyModule_Check(m)) { - PyErr_SetString(PyExc_TypeError, - "PyModule_AddObject() needs module as first arg"); - return SWIG_ERROR; - } - if (!o) { - PyErr_SetString(PyExc_TypeError, - "PyModule_AddObject() needs non-NULL value"); - return SWIG_ERROR; - } - - dict = PyModule_GetDict(m); - if (dict == NULL) { - /* Internal error -- modules must have a dict! */ - PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", - PyModule_GetName(m)); - return SWIG_ERROR; - } - if (PyDict_SetItemString(dict, name, o)) - return SWIG_ERROR; - Py_DECREF(o); - return SWIG_OK; -} -#endif - -SWIGRUNTIME void -SWIG_Python_DestroyModule(void *vptr) -{ - swig_module_info *swig_module = (swig_module_info *) vptr; - swig_type_info **types = swig_module->types; - size_t i; - for (i =0; i < swig_module->size; ++i) { - swig_type_info *ty = types[i]; - if (ty->owndata) { - SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; - if (data) SwigPyClientData_Del(data); - } - } - Py_DECREF(SWIG_This()); -} - -SWIGRUNTIME void -SWIG_Python_SetModule(swig_module_info *swig_module) { - static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */ - -#if PY_VERSION_HEX >= 0x03000000 - /* Add a dummy module object into sys.modules */ - PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); -#else - PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, - swig_empty_runtime_method_table); -#endif - PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); - if (pointer && module) { - PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); - } else { - Py_XDECREF(pointer); - } -} - -/* The python cached type query */ -SWIGRUNTIME PyObject * -SWIG_Python_TypeCache(void) { - static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New(); - return cache; -} - -SWIGRUNTIME swig_type_info * -SWIG_Python_TypeQuery(const char *type) -{ - PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = SWIG_Python_str_FromChar(type); - PyObject *obj = PyDict_GetItem(cache, key); - swig_type_info *descriptor; - if (obj) { - descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); - } else { - swig_module_info *swig_module = SWIG_Python_GetModule(); - descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); - if (descriptor) { - obj = PyCObject_FromVoidPtr(descriptor, NULL); - PyDict_SetItem(cache, key, obj); - Py_DECREF(obj); - } - } - Py_DECREF(key); - return descriptor; -} - -/* - For backward compatibility only -*/ -#define SWIG_POINTER_EXCEPTION 0 -#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) -#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) - -SWIGRUNTIME int -SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ - if (PyErr_Occurred()) { - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - PyErr_Fetch(&type, &value, &traceback); - if (value) { - char *tmp; - PyObject *old_str = PyObject_Str(value); - Py_XINCREF(type); - PyErr_Clear(); - if (infront) { - PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); - } else { - PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); - } - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(old_str); - } - return 1; - } else { - return 0; - } -} - -SWIGRUNTIME int -SWIG_Python_ArgFail(int argnum) -{ - if (PyErr_Occurred()) { - /* add information about failing argument */ - char mesg[256]; - PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); - return SWIG_Python_AddErrMesg(mesg, 1); - } else { - return 0; - } -} - -SWIGRUNTIMEINLINE const char * -SwigPyObject_GetDesc(PyObject *self) -{ - SwigPyObject *v = (SwigPyObject *)self; - swig_type_info *ty = v ? v->ty : 0; - return ty ? ty->str : (char*)""; -} - -SWIGRUNTIME void -SWIG_Python_TypeError(const char *type, PyObject *obj) -{ - if (type) { -#if defined(SWIG_COBJECT_TYPES) - if (obj && SwigPyObject_Check(obj)) { - const char *otype = (const char *) SwigPyObject_GetDesc(obj); - if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", - type, otype); - return; - } - } else -#endif - { - const char *otype = (obj ? obj->ob_type->tp_name : 0); - if (otype) { - PyObject *str = PyObject_Str(obj); - const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; - if (cstr) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", - type, otype, cstr); - SWIG_Python_str_DelForPy3(cstr); - } else { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", - type, otype); - } - Py_XDECREF(str); - return; - } - } - PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); - } else { - PyErr_Format(PyExc_TypeError, "unexpected type is received"); - } -} - - -/* Convert a pointer value, signal an exception on a type mismatch */ -SWIGRUNTIME void * -SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) { - void *result; - if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { - PyErr_Clear(); -#if SWIG_POINTER_EXCEPTION - if (flags) { - SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); - SWIG_Python_ArgFail(argnum); - } -#endif - } - return result; -} - - -#ifdef __cplusplus -#if 0 -{ /* cc-mode */ -#endif -} -#endif - - - -#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) - -#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else - - - -/* -------- TYPES TABLE (BEGIN) -------- */ - -#define SWIGTYPE_p_char swig_types[0] -#define SWIGTYPE_p_ctb__IOBase swig_types[1] -#define SWIGTYPE_p_ctb__SerialPort swig_types[2] -#define SWIGTYPE_p_ctb__SerialPort_DCS swig_types[3] -#define SWIGTYPE_p_ctb__SerialPort_EINFO swig_types[4] -#define SWIGTYPE_p_ctb__SerialPort_x swig_types[5] -#define SWIGTYPE_p_ctb__Timer swig_types[6] -#define SWIGTYPE_p_ctb__timer_control swig_types[7] -#define SWIGTYPE_p_f_p_void__p_void swig_types[8] -#define SWIGTYPE_p_int swig_types[9] -#define SWIGTYPE_p_p_char swig_types[10] -static swig_type_info *swig_types[12]; -static swig_module_info swig_module = {swig_types, 11, 0, 0, 0, 0}; -#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) -#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) - -/* -------- TYPES TABLE (END) -------- */ - -#if (PY_VERSION_HEX <= 0x02000000) -# if !defined(SWIG_PYTHON_CLASSIC) -# error "This python version requires swig to be run with the '-classic' option" -# endif -#endif -#if (PY_VERSION_HEX <= 0x02020000) -# error "This python version requires swig to be run with the '-nomodern' option" -#endif -#if (PY_VERSION_HEX <= 0x02020000) -# error "This python version requires swig to be run with the '-nomodernargs' option" -#endif - -/*----------------------------------------------- - @(target):= _wxctb.so - ------------------------------------------------*/ -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_init PyInit__wxctb - -#else -# define SWIG_init init_wxctb - -#endif -#define SWIG_name "_wxctb" - -#define SWIGVERSION 0x010340 -#define SWIG_VERSION SWIGVERSION - - -#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) -#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) - - -#include - - -namespace swig { - class SwigPtr_PyObject { - protected: - PyObject *_obj; - - public: - SwigPtr_PyObject() :_obj(0) - { - } - - SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) - { - Py_XINCREF(_obj); - } - - SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) - { - if (initial_ref) { - Py_XINCREF(_obj); - } - } - - SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) - { - Py_XINCREF(item._obj); - Py_XDECREF(_obj); - _obj = item._obj; - return *this; - } - - ~SwigPtr_PyObject() - { - Py_XDECREF(_obj); - } - - operator PyObject *() const - { - return _obj; - } - - PyObject *operator->() const - { - return _obj; - } - }; -} - - -namespace swig { - struct SwigVar_PyObject : SwigPtr_PyObject { - SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } - - SwigVar_PyObject & operator = (PyObject* obj) - { - Py_XDECREF(_obj); - _obj = obj; - return *this; - } - }; -} - - -#include "ctb-0.16/linux/timer.h" - - - static int *new_intp() { - return (new int); - } - - static int *copy_intp(int value) { - return (new int(static_cast< const int& >(value))); - } - - static void delete_intp(int *self) { - if (self) delete self; - } - - static void intp_assign(int *self, int value) { - *self = value; - } - - static int intp_value(int *self) { - return *self; - } - - -#include -#if !defined(SWIG_NO_LLONG_MAX) -# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) -# define LLONG_MAX __LONG_LONG_MAX__ -# define LLONG_MIN (-LLONG_MAX - 1LL) -# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) -# endif -#endif - - -SWIGINTERN int -SWIG_AsVal_double (PyObject *obj, double *val) -{ - int res = SWIG_TypeError; - if (PyFloat_Check(obj)) { - if (val) *val = PyFloat_AsDouble(obj); - return SWIG_OK; - } else if (PyInt_Check(obj)) { - if (val) *val = PyInt_AsLong(obj); - return SWIG_OK; - } else if (PyLong_Check(obj)) { - double v = PyLong_AsDouble(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - double d = PyFloat_AsDouble(obj); - if (!PyErr_Occurred()) { - if (val) *val = d; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - long v = PyLong_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_AddCast(SWIG_OK)); - } else { - PyErr_Clear(); - } - } - } -#endif - return res; -} - - -#include - - -#include - - -SWIGINTERNINLINE int -SWIG_CanCastAsInteger(double *d, double min, double max) { - double x = *d; - if ((min <= x && x <= max)) { - double fx = floor(x); - double cx = ceil(x); - double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ - if ((errno == EDOM) || (errno == ERANGE)) { - errno = 0; - } else { - double summ, reps, diff; - if (rd < x) { - diff = x - rd; - } else if (rd > x) { - diff = rd - x; - } else { - return 1; - } - summ = rd + x; - reps = diff/summ; - if (reps < 8*DBL_EPSILON) { - *d = rd; - return 1; - } - } - } - return 0; -} - - -SWIGINTERN int -SWIG_AsVal_long (PyObject *obj, long* val) -{ - if (PyInt_Check(obj)) { - if (val) *val = PyInt_AsLong(obj); - return SWIG_OK; - } else if (PyLong_Check(obj)) { - long v = PyLong_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - long v = PyInt_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { - if (val) *val = (long)(d); - return res; - } - } - } -#endif - return SWIG_TypeError; -} - - -SWIGINTERN int -SWIG_AsVal_int (PyObject * obj, int *val) -{ - long v; - int res = SWIG_AsVal_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v < INT_MIN || v > INT_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< int >(v); - } - } - return res; -} - - - #define SWIG_From_long PyInt_FromLong - - -SWIGINTERNINLINE PyObject * -SWIG_From_int (int value) -{ - return SWIG_From_long (value); -} - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) -{ - if (PyInt_Check(obj)) { - long v = PyInt_AsLong(obj); - if (v >= 0) { - if (val) *val = v; - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else if (PyLong_Check(obj)) { - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { - if (val) *val = (unsigned long)(d); - return res; - } - } - } -#endif - return SWIG_TypeError; -} - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val) -{ - unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v > UINT_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< unsigned int >(v); - } - } - return res; -} - - -SWIGINTERNINLINE PyObject* -SWIG_From_unsigned_SS_long (unsigned long value) -{ - return (value > LONG_MAX) ? - PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value)); -} - - -SWIGINTERNINLINE PyObject * -SWIG_From_unsigned_SS_int (unsigned int value) -{ - return SWIG_From_unsigned_SS_long (value); -} - - -#include "ctb-0.16/linux/serport.h" - - -#include "ctb-0.16/serportx.h" - - -#include "ctb-0.16/iobase.h" - - -SWIGINTERN swig_type_info* -SWIG_pchar_descriptor(void) -{ - static int init = 0; - static swig_type_info* info = 0; - if (!init) { - info = SWIG_TypeQuery("_p_char"); - init = 1; - } - return info; -} - - -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - return pchar_descriptor ? - SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void(); - } else { -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_FromStringAndSize(carray, static_cast< int >(size)); -#else - return PyString_FromStringAndSize(carray, static_cast< int >(size)); -#endif - } - } else { - return SWIG_Py_Void(); - } -} - - -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtr(const char *cptr) -{ - return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); -} - - -SWIGINTERN int -SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) -{ -#if PY_VERSION_HEX>=0x03000000 - if (PyUnicode_Check(obj)) -#else - if (PyString_Check(obj)) -#endif - { - char *cstr; Py_ssize_t len; -#if PY_VERSION_HEX>=0x03000000 - if (!alloc && cptr) { - /* We can't allow converting without allocation, since the internal - representation of string in Python 3 is UCS-2/UCS-4 but we require - a UTF-8 representation. - TODO(bhy) More detailed explanation */ - return SWIG_RuntimeError; - } - obj = PyUnicode_AsUTF8String(obj); - PyBytes_AsStringAndSize(obj, &cstr, &len); - if(alloc) *alloc = SWIG_NEWOBJ; -#else - PyString_AsStringAndSize(obj, &cstr, &len); -#endif - if (cptr) { - if (alloc) { - /* - In python the user should not be able to modify the inner - string representation. To warranty that, if you define - SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string - buffer is always returned. - - The default behavior is just to return the pointer value, - so, be careful. - */ -#if defined(SWIG_PYTHON_SAFE_CSTRINGS) - if (*alloc != SWIG_OLDOBJ) -#else - if (*alloc == SWIG_NEWOBJ) -#endif - { - *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1))); - *alloc = SWIG_NEWOBJ; - } - else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } else { - #if PY_VERSION_HEX>=0x03000000 - assert(0); /* Should never reach here in Python 3 */ - #endif - *cptr = SWIG_Python_str_AsChar(obj); - } - } - if (psize) *psize = len + 1; -#if PY_VERSION_HEX>=0x03000000 - Py_XDECREF(obj); -#endif - return SWIG_OK; - } else { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *) vptr; - if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} - - - - - -SWIGINTERN int -SWIG_AsCharArray(PyObject * obj, char *val, size_t size) -{ - char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ; - int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc); - if (SWIG_IsOK(res)) { - if ((csize == size + 1) && cptr && !(cptr[csize-1])) --csize; - if (csize <= size) { - if (val) { - if (csize) memcpy(val, cptr, csize*sizeof(char)); - if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char)); - } - if (alloc == SWIG_NEWOBJ) { - delete[] cptr; - res = SWIG_DelNewMask(res); - } - return res; - } - if (alloc == SWIG_NEWOBJ) delete[] cptr; - } - return SWIG_TypeError; -} - - -SWIGINTERN int -SWIG_AsVal_char (PyObject * obj, char *val) -{ - int res = SWIG_AsCharArray(obj, val, 1); - if (!SWIG_IsOK(res)) { - long v; - res = SWIG_AddCast(SWIG_AsVal_long (obj, &v)); - if (SWIG_IsOK(res)) { - if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) { - if (val) *val = static_cast< char >(v); - } else { - res = SWIG_OverflowError; - } - } - } - return res; -} - - -SWIGINTERNINLINE int -SWIG_AsVal_size_t (PyObject * obj, size_t *val) -{ - unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); - if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); - return res; -} - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val) -{ - unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v > UCHAR_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< unsigned char >(v); - } - } - return res; -} - - -SWIGINTERNINLINE PyObject * -SWIG_From_unsigned_SS_char (unsigned char value) -{ - return SWIG_From_unsigned_SS_long (value); -} - - -SWIGINTERN int -SWIG_AsVal_bool (PyObject *obj, bool *val) -{ - int r = PyObject_IsTrue(obj); - if (r == -1) - return SWIG_ERROR; - if (val) *val = r ? true : false; - return SWIG_OK; -} - - -SWIGINTERNINLINE PyObject* - SWIG_From_bool (bool value) -{ - return PyBool_FromLong(value ? 1 : 0); -} - - -#include "ctb-0.16/kbhit.h" - - -SWIGINTERNINLINE PyObject * -SWIG_From_char (char c) -{ - return SWIG_FromCharPtrAndSize(&c,1); -} - -#ifdef __cplusplus -extern "C" { -#endif -SWIGINTERN PyObject *_wrap_new_intp(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int *result = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"new_intp",0,0)) SWIG_fail; - result = (int *)new_intp(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_copy_intp(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - char * kwnames[] = { - (char *) "value", NULL - }; - int *result = 0 ; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:copy_intp",kwnames,&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "copy_intp" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - result = (int *)copy_intp(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_intp(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - int *arg1 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char * kwnames[] = { - (char *) "self", NULL - }; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:delete_intp",kwnames,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_intp" "', argument " "1"" of type '" "int *""'"); - } - arg1 = reinterpret_cast< int * >(argp1); - delete_intp(arg1); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_intp_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - int *arg1 = (int *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "value", NULL - }; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:intp_assign",kwnames,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intp_assign" "', argument " "1"" of type '" "int *""'"); - } - arg1 = reinterpret_cast< int * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "intp_assign" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - intp_assign(arg1,arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_intp_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - int *arg1 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char * kwnames[] = { - (char *) "self", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:intp_value",kwnames,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "intp_value" "', argument " "1"" of type '" "int *""'"); - } - arg1 = reinterpret_cast< int * >(argp1); - result = (int)intp_value(arg1); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_timer_control_usecs_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::timer_control *arg1 = (ctb::timer_control *) 0 ; - unsigned int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"timer_control_usecs_set",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__timer_control, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "timer_control_usecs_set" "', argument " "1"" of type '" "ctb::timer_control *""'"); - } - arg1 = reinterpret_cast< ctb::timer_control * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "timer_control_usecs_set" "', argument " "2"" of type '" "unsigned int""'"); - } - arg2 = static_cast< unsigned int >(val2); - if (arg1) (arg1)->usecs = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_timer_control_usecs_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::timer_control *arg1 = (ctb::timer_control *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - unsigned int result; - - if(!PyArg_UnpackTuple(args,(char *)"timer_control_usecs_get",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__timer_control, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "timer_control_usecs_get" "', argument " "1"" of type '" "ctb::timer_control *""'"); - } - arg1 = reinterpret_cast< ctb::timer_control * >(argp1); - result = (unsigned int) ((arg1)->usecs); - resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_timer_control_exitflag_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::timer_control *arg1 = (ctb::timer_control *) 0 ; - int *arg2 = (int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"timer_control_exitflag_set",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__timer_control, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "timer_control_exitflag_set" "', argument " "1"" of type '" "ctb::timer_control *""'"); - } - arg1 = reinterpret_cast< ctb::timer_control * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "timer_control_exitflag_set" "', argument " "2"" of type '" "int *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - if (arg1) (arg1)->exitflag = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_timer_control_exitflag_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::timer_control *arg1 = (ctb::timer_control *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int *result = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"timer_control_exitflag_get",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__timer_control, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "timer_control_exitflag_get" "', argument " "1"" of type '" "ctb::timer_control *""'"); - } - arg1 = reinterpret_cast< ctb::timer_control * >(argp1); - result = (int *) ((arg1)->exitflag); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_timer_control_exitfnc_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::timer_control *arg1 = (ctb::timer_control *) 0 ; - void *(*arg2)(void *) = (void *(*)(void *)) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"timer_control_exitfnc_set",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__timer_control, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "timer_control_exitfnc_set" "', argument " "1"" of type '" "ctb::timer_control *""'"); - } - arg1 = reinterpret_cast< ctb::timer_control * >(argp1); - { - int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_void__p_void); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in method '" "timer_control_exitfnc_set" "', argument " "2"" of type '" "void *(*)(void *)""'"); - } - } - if (arg1) (arg1)->exitfnc = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_timer_control_exitfnc_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::timer_control *arg1 = (ctb::timer_control *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - void *(*result)(void *) = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"timer_control_exitfnc_get",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__timer_control, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "timer_control_exitfnc_get" "', argument " "1"" of type '" "ctb::timer_control *""'"); - } - arg1 = reinterpret_cast< ctb::timer_control * >(argp1); - result = (void *(*)(void *)) ((arg1)->exitfnc); - resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_void__p_void); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *timer_control_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_ctb__timer_control, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_Timer(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - unsigned int arg1 ; - int *arg2 = (int *) 0 ; - void *(*arg3)(void *) = (void *(*)(void *)) NULL ; - unsigned int val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - char * kwnames[] = { - (char *) "msec",(char *) "exitflag",(char *) "exitfnc", NULL - }; - ctb::Timer *result = 0 ; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:new_Timer",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Timer" "', argument " "1"" of type '" "unsigned int""'"); - } - arg1 = static_cast< unsigned int >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_Timer" "', argument " "2"" of type '" "int *""'"); - } - arg2 = reinterpret_cast< int * >(argp2); - if (obj2) { - { - int res = SWIG_ConvertFunctionPtr(obj2, (void**)(&arg3), SWIGTYPE_p_f_p_void__p_void); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in method '" "new_Timer" "', argument " "3"" of type '" "void *(*)(void *)""'"); - } - } - } - result = (ctb::Timer *)new ctb::Timer(arg1,arg2,arg3); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ctb__Timer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_Timer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::Timer *arg1 = (ctb::Timer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"delete_Timer",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__Timer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Timer" "', argument " "1"" of type '" "ctb::Timer *""'"); - } - arg1 = reinterpret_cast< ctb::Timer * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Timer_start(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::Timer *arg1 = (ctb::Timer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if(!PyArg_UnpackTuple(args,(char *)"Timer_start",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__Timer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Timer_start" "', argument " "1"" of type '" "ctb::Timer *""'"); - } - arg1 = reinterpret_cast< ctb::Timer * >(argp1); - result = (int)(arg1)->start(); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Timer_stop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::Timer *arg1 = (ctb::Timer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if(!PyArg_UnpackTuple(args,(char *)"Timer_stop",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__Timer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Timer_stop" "', argument " "1"" of type '" "ctb::Timer *""'"); - } - arg1 = reinterpret_cast< ctb::Timer * >(argp1); - result = (int)(arg1)->stop(); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Timer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_ctb__Timer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_sleepms(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - unsigned int arg1 ; - unsigned int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - char * kwnames[] = { - (char *) "ms", NULL - }; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:sleepms",kwnames,&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "sleepms" "', argument " "1"" of type '" "unsigned int""'"); - } - arg1 = static_cast< unsigned int >(val1); - ctb::sleepms(arg1); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_IOBase(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"delete_IOBase",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IOBase" "', argument " "1"" of type '" "ctb::IOBase *""'"); - } - arg1 = reinterpret_cast< ctb::IOBase * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOBase_ClassName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"IOBase_ClassName",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_ClassName" "', argument " "1"" of type '" "ctb::IOBase *""'"); - } - arg1 = reinterpret_cast< ctb::IOBase * >(argp1); - result = (char *)(arg1)->ClassName(); - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOBase_Close(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if(!PyArg_UnpackTuple(args,(char *)"IOBase_Close",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_Close" "', argument " "1"" of type '" "ctb::IOBase *""'"); - } - arg1 = reinterpret_cast< ctb::IOBase * >(argp1); - result = (int)(arg1)->Close(); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOBase_Ioctl(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; - int arg2 ; - void *arg3 = (void *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int res3 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "cmd",(char *) "args", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:IOBase_Ioctl",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_Ioctl" "', argument " "1"" of type '" "ctb::IOBase *""'"); - } - arg1 = reinterpret_cast< ctb::IOBase * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IOBase_Ioctl" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IOBase_Ioctl" "', argument " "3"" of type '" "void *""'"); - } - result = (int)(arg1)->Ioctl(arg2,arg3); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOBase_IsOpen(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if(!PyArg_UnpackTuple(args,(char *)"IOBase_IsOpen",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_IsOpen" "', argument " "1"" of type '" "ctb::IOBase *""'"); - } - arg1 = reinterpret_cast< ctb::IOBase * >(argp1); - result = (int)(arg1)->IsOpen(); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOBase_Open(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; - char *arg2 = (char *) 0 ; - void *arg3 = (void *) 0L ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - int res3 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "devname",(char *) "dcs", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:IOBase_Open",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_Open" "', argument " "1"" of type '" "ctb::IOBase *""'"); - } - arg1 = reinterpret_cast< ctb::IOBase * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IOBase_Open" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - if (obj2) { - res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IOBase_Open" "', argument " "3"" of type '" "void *""'"); - } - } - result = (int)(arg1)->Open((char const *)arg2,arg3); - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOBase_PutBack(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; - char arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "ch", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:IOBase_PutBack",kwnames,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_PutBack" "', argument " "1"" of type '" "ctb::IOBase *""'"); - } - arg1 = reinterpret_cast< ctb::IOBase * >(argp1); - ecode2 = SWIG_AsVal_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IOBase_PutBack" "', argument " "2"" of type '" "char""'"); - } - arg2 = static_cast< char >(val2); - result = (int)(arg1)->PutBack(arg2); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOBase_Read(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "buf",(char *) "len", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:IOBase_Read",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_Read" "', argument " "1"" of type '" "ctb::IOBase *""'"); - } - arg1 = reinterpret_cast< ctb::IOBase * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IOBase_Read" "', argument " "2"" of type '" "char *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IOBase_Read" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - result = (int)(arg1)->Read(arg2,arg3); - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOBase_ReadUntilEOS(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; - char **arg2 = 0 ; - size_t *arg3 = (size_t *) 0 ; - char *arg4 = (char *) "\n" ; - long arg5 = (long) 1000L ; - char arg6 = (char) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *tmp2 ; - size_t tmp3 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - long val5 ; - int ecode5 = 0 ; - char val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "readbuf",(char *) "readedBytes",(char *) "eosString",(char *) "timeout_in_ms",(char *) "quota", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|OOO:IOBase_ReadUntilEOS",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_ReadUntilEOS" "', argument " "1"" of type '" "ctb::IOBase *""'"); - } - arg1 = reinterpret_cast< ctb::IOBase * >(argp1); - { - /* dont check for list */ - arg2 = &tmp2; - } - { - /* dont check for list */ - arg3 = &tmp3; - } - if (obj3) { - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IOBase_ReadUntilEOS" "', argument " "4"" of type '" "char *""'"); - } - arg4 = reinterpret_cast< char * >(buf4); - } - if (obj4) { - ecode5 = SWIG_AsVal_long(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "IOBase_ReadUntilEOS" "', argument " "5"" of type '" "long""'"); - } - arg5 = static_cast< long >(val5); - } - if (obj5) { - ecode6 = SWIG_AsVal_char(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "IOBase_ReadUntilEOS" "', argument " "6"" of type '" "char""'"); - } - arg6 = static_cast< char >(val6); - } - result = (int)(arg1)->ReadUntilEOS(*arg2,arg3,arg4,arg5,arg6); - resultobj = SWIG_From_int(static_cast< int >(result)); - { - PyObject * plist = PyList_New(2); - PyList_SetItem(plist, 0, PyString_FromString(*arg2)); - PyList_SetItem(plist, 1, resultobj); - resultobj = plist; - delete *arg2; - } - { - PyList_Append(resultobj, PyInt_FromLong(*arg3)); - } - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - return resultobj; -fail: - if (alloc4 == SWIG_NEWOBJ) delete[] buf4; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOBase_Readv(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - unsigned int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - unsigned int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "buf",(char *) "len",(char *) "timeout_in_ms", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOO:IOBase_Readv",kwnames,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_Readv" "', argument " "1"" of type '" "ctb::IOBase *""'"); - } - arg1 = reinterpret_cast< ctb::IOBase * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IOBase_Readv" "', argument " "2"" of type '" "char *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IOBase_Readv" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_unsigned_SS_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IOBase_Readv" "', argument " "4"" of type '" "unsigned int""'"); - } - arg4 = static_cast< unsigned int >(val4); - result = (int)(arg1)->Readv(arg2,arg3,arg4); - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOBase_Write(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "buf",(char *) "len", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:IOBase_Write",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_Write" "', argument " "1"" of type '" "ctb::IOBase *""'"); - } - arg1 = reinterpret_cast< ctb::IOBase * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IOBase_Write" "', argument " "2"" of type '" "char *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IOBase_Write" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - result = (int)(arg1)->Write(arg2,arg3); - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IOBase_Writev(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::IOBase *arg1 = (ctb::IOBase *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - unsigned int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - unsigned int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "buf",(char *) "len",(char *) "timeout_in_ms", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOO:IOBase_Writev",kwnames,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__IOBase, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IOBase_Writev" "', argument " "1"" of type '" "ctb::IOBase *""'"); - } - arg1 = reinterpret_cast< ctb::IOBase * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IOBase_Writev" "', argument " "2"" of type '" "char *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IOBase_Writev" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - ecode4 = SWIG_AsVal_unsigned_SS_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IOBase_Writev" "', argument " "4"" of type '" "unsigned int""'"); - } - arg4 = static_cast< unsigned int >(val4); - result = (int)(arg1)->Writev(arg2,arg3,arg4); - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *IOBase_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_ctb__IOBase, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_SerialPort_DCS_baud_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_baud_set",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_baud_set" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_DCS_baud_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->baud = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_DCS_baud_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_baud_get",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_baud_get" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); - result = (int) ((arg1)->baud); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_DCS_parity_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; - ctb::Parity arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_parity_set",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_parity_set" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_DCS_parity_set" "', argument " "2"" of type '" "ctb::Parity""'"); - } - arg2 = static_cast< ctb::Parity >(val2); - if (arg1) (arg1)->parity = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_DCS_parity_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - ctb::Parity result; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_parity_get",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_parity_get" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); - result = (ctb::Parity) ((arg1)->parity); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_DCS_wordlen_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; - unsigned char arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_wordlen_set",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_wordlen_set" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_DCS_wordlen_set" "', argument " "2"" of type '" "unsigned char""'"); - } - arg2 = static_cast< unsigned char >(val2); - if (arg1) (arg1)->wordlen = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_DCS_wordlen_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - unsigned char result; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_wordlen_get",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_wordlen_get" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); - result = (unsigned char) ((arg1)->wordlen); - resultobj = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_DCS_stopbits_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; - unsigned char arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_stopbits_set",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_stopbits_set" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_DCS_stopbits_set" "', argument " "2"" of type '" "unsigned char""'"); - } - arg2 = static_cast< unsigned char >(val2); - if (arg1) (arg1)->stopbits = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_DCS_stopbits_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - unsigned char result; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_stopbits_get",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_stopbits_get" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); - result = (unsigned char) ((arg1)->stopbits); - resultobj = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_DCS_rtscts_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_rtscts_set",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_rtscts_set" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_DCS_rtscts_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->rtscts = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_DCS_rtscts_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_rtscts_get",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_rtscts_get" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); - result = (bool) ((arg1)->rtscts); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_DCS_xonxoff_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_xonxoff_set",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_xonxoff_set" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_DCS_xonxoff_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->xonxoff = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_DCS_xonxoff_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - bool result; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_xonxoff_get",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_xonxoff_get" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); - result = (bool) ((arg1)->xonxoff); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_DCS_buf_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; - char *arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - char temp2[16] ; - int res2 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_buf_set",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_buf_set" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); - res2 = SWIG_AsCharArray(obj1, temp2, 16); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SerialPort_DCS_buf_set" "', argument " "2"" of type '" "char [16]""'"); - } - arg2 = reinterpret_cast< char * >(temp2); - if (arg2) memcpy(arg1->buf,arg2,16*sizeof(char)); - else memset(arg1->buf,0,16*sizeof(char)); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_DCS_buf_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_buf_get",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_buf_get" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); - result = (char *)(char *) ((arg1)->buf); - { - size_t size = 16; - - while (size && (result[size - 1] == '\0')) --size; - - resultobj = SWIG_FromCharPtrAndSize(result, size); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_SerialPort_DCS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_DCS *result = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"new_SerialPort_DCS",0,0)) SWIG_fail; - result = (ctb::SerialPort_DCS *)new ctb::SerialPort_DCS(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ctb__SerialPort_DCS, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_SerialPort_DCS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"delete_SerialPort_DCS",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SerialPort_DCS" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_DCS_GetSettings(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_DCS *arg1 = (ctb::SerialPort_DCS *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_DCS_GetSettings",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_DCS, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_DCS_GetSettings" "', argument " "1"" of type '" "ctb::SerialPort_DCS *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_DCS * >(argp1); - result = (char *)(arg1)->GetSettings(); - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *SerialPort_DCS_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_ctb__SerialPort_DCS, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_SerialPort_EINFO_brk_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_EINFO *arg1 = (ctb::SerialPort_EINFO *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_EINFO_brk_set",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_EINFO, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_EINFO_brk_set" "', argument " "1"" of type '" "ctb::SerialPort_EINFO *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_EINFO * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_EINFO_brk_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->brk = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_EINFO_brk_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_EINFO *arg1 = (ctb::SerialPort_EINFO *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_EINFO_brk_get",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_EINFO, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_EINFO_brk_get" "', argument " "1"" of type '" "ctb::SerialPort_EINFO *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_EINFO * >(argp1); - result = (int) ((arg1)->brk); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_EINFO_frame_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_EINFO *arg1 = (ctb::SerialPort_EINFO *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_EINFO_frame_set",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_EINFO, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_EINFO_frame_set" "', argument " "1"" of type '" "ctb::SerialPort_EINFO *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_EINFO * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_EINFO_frame_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->frame = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_EINFO_frame_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_EINFO *arg1 = (ctb::SerialPort_EINFO *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_EINFO_frame_get",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_EINFO, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_EINFO_frame_get" "', argument " "1"" of type '" "ctb::SerialPort_EINFO *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_EINFO * >(argp1); - result = (int) ((arg1)->frame); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_EINFO_overrun_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_EINFO *arg1 = (ctb::SerialPort_EINFO *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_EINFO_overrun_set",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_EINFO, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_EINFO_overrun_set" "', argument " "1"" of type '" "ctb::SerialPort_EINFO *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_EINFO * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_EINFO_overrun_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->overrun = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_EINFO_overrun_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_EINFO *arg1 = (ctb::SerialPort_EINFO *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_EINFO_overrun_get",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_EINFO, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_EINFO_overrun_get" "', argument " "1"" of type '" "ctb::SerialPort_EINFO *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_EINFO * >(argp1); - result = (int) ((arg1)->overrun); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_EINFO_parity_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_EINFO *arg1 = (ctb::SerialPort_EINFO *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_EINFO_parity_set",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_EINFO, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_EINFO_parity_set" "', argument " "1"" of type '" "ctb::SerialPort_EINFO *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_EINFO * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_EINFO_parity_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->parity = arg2; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_EINFO_parity_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_EINFO *arg1 = (ctb::SerialPort_EINFO *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_EINFO_parity_get",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_EINFO, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_EINFO_parity_get" "', argument " "1"" of type '" "ctb::SerialPort_EINFO *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_EINFO * >(argp1); - result = (int) ((arg1)->parity); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_SerialPort_EINFO(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_EINFO *result = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"new_SerialPort_EINFO",0,0)) SWIG_fail; - result = (ctb::SerialPort_EINFO *)new ctb::SerialPort_EINFO(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ctb__SerialPort_EINFO, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_SerialPort_EINFO(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_EINFO *arg1 = (ctb::SerialPort_EINFO *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"delete_SerialPort_EINFO",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_EINFO, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SerialPort_EINFO" "', argument " "1"" of type '" "ctb::SerialPort_EINFO *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_EINFO * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *SerialPort_EINFO_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_ctb__SerialPort_EINFO, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_delete_SerialPort_x(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"delete_SerialPort_x",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SerialPort_x" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_x_ClassName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_x_ClassName",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_ClassName" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); - result = (char *)(arg1)->ClassName(); - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_x_ChangeLineState(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; - ctb::SerialLineState arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "flags", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_x_ChangeLineState",kwnames,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_ChangeLineState" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_x_ChangeLineState" "', argument " "2"" of type '" "ctb::SerialLineState""'"); - } - arg2 = static_cast< ctb::SerialLineState >(val2); - result = (int)(arg1)->ChangeLineState(arg2); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_x_ClrLineState(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; - ctb::SerialLineState arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "flags", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_x_ClrLineState",kwnames,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_ClrLineState" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_x_ClrLineState" "', argument " "2"" of type '" "ctb::SerialLineState""'"); - } - arg2 = static_cast< ctb::SerialLineState >(val2); - result = (int)(arg1)->ClrLineState(arg2); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_x_GetLineState(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_x_GetLineState",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_GetLineState" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); - result = (int)(arg1)->GetLineState(); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_x_GetSettingsAsString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_x_GetSettingsAsString",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_GetSettingsAsString" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); - result = (char *)(arg1)->GetSettingsAsString(); - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_x_Ioctl(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; - int arg2 ; - void *arg3 = (void *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int res3 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "cmd",(char *) "args", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:SerialPort_x_Ioctl",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_Ioctl" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_x_Ioctl" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "SerialPort_x_Ioctl" "', argument " "3"" of type '" "void *""'"); - } - result = (int)(arg1)->Ioctl(arg2,arg3); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_x_SendBreak(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "duration", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_x_SendBreak",kwnames,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_SendBreak" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_x_SendBreak" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (int)(arg1)->SendBreak(arg2); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_x_SetBaudrate(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "baudrate", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_x_SetBaudrate",kwnames,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_SetBaudrate" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_x_SetBaudrate" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (int)(arg1)->SetBaudrate(arg2); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_x_SetLineState(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; - ctb::SerialLineState arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "flags", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_x_SetLineState",kwnames,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_SetLineState" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_x_SetLineState" "', argument " "2"" of type '" "ctb::SerialLineState""'"); - } - arg2 = static_cast< ctb::SerialLineState >(val2); - result = (int)(arg1)->SetLineState(arg2); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_x_SetParityBit(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::SerialPort_x *arg1 = (ctb::SerialPort_x *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "parity", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_x_SetParityBit",kwnames,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort_x, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_x_SetParityBit" "', argument " "1"" of type '" "ctb::SerialPort_x *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort_x * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_x_SetParityBit" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - result = (int)(arg1)->SetParityBit(arg2); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_x_IsStandardRate(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - long arg1 ; - long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - char * kwnames[] = { - (char *) "rate", NULL - }; - bool result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:SerialPort_x_IsStandardRate",kwnames,&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_long(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "SerialPort_x_IsStandardRate" "', argument " "1"" of type '" "long""'"); - } - arg1 = static_cast< long >(val1); - result = (bool)ctb::SerialPort_x::IsStandardRate(arg1); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *SerialPort_x_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_ctb__SerialPort_x, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_SerialPort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort *result = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"new_SerialPort",0,0)) SWIG_fail; - result = (ctb::SerialPort *)new ctb::SerialPort(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ctb__SerialPort, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_SerialPort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if(!PyArg_UnpackTuple(args,(char *)"delete_SerialPort",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SerialPort" "', argument " "1"" of type '" "ctb::SerialPort *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); - delete arg1; - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_ChangeLineState(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; - ctb::SerialLineState arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "flags", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_ChangeLineState",kwnames,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_ChangeLineState" "', argument " "1"" of type '" "ctb::SerialPort *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_ChangeLineState" "', argument " "2"" of type '" "ctb::SerialLineState""'"); - } - arg2 = static_cast< ctb::SerialLineState >(val2); - result = (int)(arg1)->ChangeLineState(arg2); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_ClrLineState(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; - ctb::SerialLineState arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "flags", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_ClrLineState",kwnames,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_ClrLineState" "', argument " "1"" of type '" "ctb::SerialPort *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_ClrLineState" "', argument " "2"" of type '" "ctb::SerialLineState""'"); - } - arg2 = static_cast< ctb::SerialLineState >(val2); - result = (int)(arg1)->ClrLineState(arg2); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_GetLineState(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_GetLineState",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_GetLineState" "', argument " "1"" of type '" "ctb::SerialPort *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); - result = (int)(arg1)->GetLineState(); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_Ioctl(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; - int arg2 ; - void *arg3 = (void *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int res3 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "cmd",(char *) "args", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:SerialPort_Ioctl",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_Ioctl" "', argument " "1"" of type '" "ctb::SerialPort *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_Ioctl" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "SerialPort_Ioctl" "', argument " "3"" of type '" "void *""'"); - } - result = (int)(arg1)->Ioctl(arg2,arg3); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_IsOpen(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; - - if(!PyArg_UnpackTuple(args,(char *)"SerialPort_IsOpen",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_IsOpen" "', argument " "1"" of type '" "ctb::SerialPort *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); - result = (int)(arg1)->IsOpen(); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_Read(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "buf",(char *) "len", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:SerialPort_Read",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_Read" "', argument " "1"" of type '" "ctb::SerialPort *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SerialPort_Read" "', argument " "2"" of type '" "char *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "SerialPort_Read" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - result = (int)(arg1)->Read(arg2,arg3); - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_SendBreak(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "duration", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_SendBreak",kwnames,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_SendBreak" "', argument " "1"" of type '" "ctb::SerialPort *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_SendBreak" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (int)(arg1)->SendBreak(arg2); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_SetBaudrate(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "baudrate", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_SetBaudrate",kwnames,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_SetBaudrate" "', argument " "1"" of type '" "ctb::SerialPort *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_SetBaudrate" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (int)(arg1)->SetBaudrate(arg2); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_SetLineState(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; - ctb::SerialLineState arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "flags", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_SetLineState",kwnames,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_SetLineState" "', argument " "1"" of type '" "ctb::SerialPort *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_SetLineState" "', argument " "2"" of type '" "ctb::SerialLineState""'"); - } - arg2 = static_cast< ctb::SerialLineState >(val2); - result = (int)(arg1)->SetLineState(arg2); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_SetParityBit(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "parity", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SerialPort_SetParityBit",kwnames,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_SetParityBit" "', argument " "1"" of type '" "ctb::SerialPort *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SerialPort_SetParityBit" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - result = (int)(arg1)->SetParityBit(arg2); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SerialPort_Write(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { - PyObject *resultobj = 0; - ctb::SerialPort *arg1 = (ctb::SerialPort *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - char * kwnames[] = { - (char *) "self",(char *) "buf",(char *) "len", NULL - }; - int result; - - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:SerialPort_Write",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ctb__SerialPort, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerialPort_Write" "', argument " "1"" of type '" "ctb::SerialPort *""'"); - } - arg1 = reinterpret_cast< ctb::SerialPort * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SerialPort_Write" "', argument " "2"" of type '" "char *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "SerialPort_Write" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - result = (int)(arg1)->Write(arg2,arg3); - resultobj = SWIG_From_int(static_cast< int >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *SerialPort_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_ctb__SerialPort, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_GetKey(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char result; - - if(!PyArg_UnpackTuple(args,(char *)"GetKey",0,0)) SWIG_fail; - result = (char)ctb::GetKey(); - resultobj = SWIG_From_char(static_cast< char >(result)); - return resultobj; -fail: - return NULL; -} - - -static PyMethodDef SwigMethods[] = { - { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, - { (char *)"new_intp", _wrap_new_intp, METH_VARARGS, NULL}, - { (char *)"copy_intp", (PyCFunction) _wrap_copy_intp, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"delete_intp", (PyCFunction) _wrap_delete_intp, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"intp_assign", (PyCFunction) _wrap_intp_assign, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"intp_value", (PyCFunction) _wrap_intp_value, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"timer_control_usecs_set", _wrap_timer_control_usecs_set, METH_VARARGS, NULL}, - { (char *)"timer_control_usecs_get", _wrap_timer_control_usecs_get, METH_VARARGS, NULL}, - { (char *)"timer_control_exitflag_set", _wrap_timer_control_exitflag_set, METH_VARARGS, NULL}, - { (char *)"timer_control_exitflag_get", _wrap_timer_control_exitflag_get, METH_VARARGS, NULL}, - { (char *)"timer_control_exitfnc_set", _wrap_timer_control_exitfnc_set, METH_VARARGS, NULL}, - { (char *)"timer_control_exitfnc_get", _wrap_timer_control_exitfnc_get, METH_VARARGS, NULL}, - { (char *)"timer_control_swigregister", timer_control_swigregister, METH_VARARGS, NULL}, - { (char *)"new_Timer", (PyCFunction) _wrap_new_Timer, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"delete_Timer", _wrap_delete_Timer, METH_VARARGS, NULL}, - { (char *)"Timer_start", _wrap_Timer_start, METH_VARARGS, NULL}, - { (char *)"Timer_stop", _wrap_Timer_stop, METH_VARARGS, NULL}, - { (char *)"Timer_swigregister", Timer_swigregister, METH_VARARGS, NULL}, - { (char *)"sleepms", (PyCFunction) _wrap_sleepms, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"delete_IOBase", _wrap_delete_IOBase, METH_VARARGS, NULL}, - { (char *)"IOBase_ClassName", _wrap_IOBase_ClassName, METH_VARARGS, NULL}, - { (char *)"IOBase_Close", _wrap_IOBase_Close, METH_VARARGS, NULL}, - { (char *)"IOBase_Ioctl", (PyCFunction) _wrap_IOBase_Ioctl, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"IOBase_IsOpen", _wrap_IOBase_IsOpen, METH_VARARGS, NULL}, - { (char *)"IOBase_Open", (PyCFunction) _wrap_IOBase_Open, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"IOBase_PutBack", (PyCFunction) _wrap_IOBase_PutBack, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"IOBase_Read", (PyCFunction) _wrap_IOBase_Read, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"IOBase_ReadUntilEOS", (PyCFunction) _wrap_IOBase_ReadUntilEOS, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"IOBase_Readv", (PyCFunction) _wrap_IOBase_Readv, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"IOBase_Write", (PyCFunction) _wrap_IOBase_Write, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"IOBase_Writev", (PyCFunction) _wrap_IOBase_Writev, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"IOBase_swigregister", IOBase_swigregister, METH_VARARGS, NULL}, - { (char *)"SerialPort_DCS_baud_set", _wrap_SerialPort_DCS_baud_set, METH_VARARGS, NULL}, - { (char *)"SerialPort_DCS_baud_get", _wrap_SerialPort_DCS_baud_get, METH_VARARGS, NULL}, - { (char *)"SerialPort_DCS_parity_set", _wrap_SerialPort_DCS_parity_set, METH_VARARGS, NULL}, - { (char *)"SerialPort_DCS_parity_get", _wrap_SerialPort_DCS_parity_get, METH_VARARGS, NULL}, - { (char *)"SerialPort_DCS_wordlen_set", _wrap_SerialPort_DCS_wordlen_set, METH_VARARGS, NULL}, - { (char *)"SerialPort_DCS_wordlen_get", _wrap_SerialPort_DCS_wordlen_get, METH_VARARGS, NULL}, - { (char *)"SerialPort_DCS_stopbits_set", _wrap_SerialPort_DCS_stopbits_set, METH_VARARGS, NULL}, - { (char *)"SerialPort_DCS_stopbits_get", _wrap_SerialPort_DCS_stopbits_get, METH_VARARGS, NULL}, - { (char *)"SerialPort_DCS_rtscts_set", _wrap_SerialPort_DCS_rtscts_set, METH_VARARGS, NULL}, - { (char *)"SerialPort_DCS_rtscts_get", _wrap_SerialPort_DCS_rtscts_get, METH_VARARGS, NULL}, - { (char *)"SerialPort_DCS_xonxoff_set", _wrap_SerialPort_DCS_xonxoff_set, METH_VARARGS, NULL}, - { (char *)"SerialPort_DCS_xonxoff_get", _wrap_SerialPort_DCS_xonxoff_get, METH_VARARGS, NULL}, - { (char *)"SerialPort_DCS_buf_set", _wrap_SerialPort_DCS_buf_set, METH_VARARGS, NULL}, - { (char *)"SerialPort_DCS_buf_get", _wrap_SerialPort_DCS_buf_get, METH_VARARGS, NULL}, - { (char *)"new_SerialPort_DCS", _wrap_new_SerialPort_DCS, METH_VARARGS, NULL}, - { (char *)"delete_SerialPort_DCS", _wrap_delete_SerialPort_DCS, METH_VARARGS, NULL}, - { (char *)"SerialPort_DCS_GetSettings", _wrap_SerialPort_DCS_GetSettings, METH_VARARGS, NULL}, - { (char *)"SerialPort_DCS_swigregister", SerialPort_DCS_swigregister, METH_VARARGS, NULL}, - { (char *)"SerialPort_EINFO_brk_set", _wrap_SerialPort_EINFO_brk_set, METH_VARARGS, NULL}, - { (char *)"SerialPort_EINFO_brk_get", _wrap_SerialPort_EINFO_brk_get, METH_VARARGS, NULL}, - { (char *)"SerialPort_EINFO_frame_set", _wrap_SerialPort_EINFO_frame_set, METH_VARARGS, NULL}, - { (char *)"SerialPort_EINFO_frame_get", _wrap_SerialPort_EINFO_frame_get, METH_VARARGS, NULL}, - { (char *)"SerialPort_EINFO_overrun_set", _wrap_SerialPort_EINFO_overrun_set, METH_VARARGS, NULL}, - { (char *)"SerialPort_EINFO_overrun_get", _wrap_SerialPort_EINFO_overrun_get, METH_VARARGS, NULL}, - { (char *)"SerialPort_EINFO_parity_set", _wrap_SerialPort_EINFO_parity_set, METH_VARARGS, NULL}, - { (char *)"SerialPort_EINFO_parity_get", _wrap_SerialPort_EINFO_parity_get, METH_VARARGS, NULL}, - { (char *)"new_SerialPort_EINFO", _wrap_new_SerialPort_EINFO, METH_VARARGS, NULL}, - { (char *)"delete_SerialPort_EINFO", _wrap_delete_SerialPort_EINFO, METH_VARARGS, NULL}, - { (char *)"SerialPort_EINFO_swigregister", SerialPort_EINFO_swigregister, METH_VARARGS, NULL}, - { (char *)"delete_SerialPort_x", _wrap_delete_SerialPort_x, METH_VARARGS, NULL}, - { (char *)"SerialPort_x_ClassName", _wrap_SerialPort_x_ClassName, METH_VARARGS, NULL}, - { (char *)"SerialPort_x_ChangeLineState", (PyCFunction) _wrap_SerialPort_x_ChangeLineState, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SerialPort_x_ClrLineState", (PyCFunction) _wrap_SerialPort_x_ClrLineState, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SerialPort_x_GetLineState", _wrap_SerialPort_x_GetLineState, METH_VARARGS, NULL}, - { (char *)"SerialPort_x_GetSettingsAsString", _wrap_SerialPort_x_GetSettingsAsString, METH_VARARGS, NULL}, - { (char *)"SerialPort_x_Ioctl", (PyCFunction) _wrap_SerialPort_x_Ioctl, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SerialPort_x_SendBreak", (PyCFunction) _wrap_SerialPort_x_SendBreak, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SerialPort_x_SetBaudrate", (PyCFunction) _wrap_SerialPort_x_SetBaudrate, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SerialPort_x_SetLineState", (PyCFunction) _wrap_SerialPort_x_SetLineState, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SerialPort_x_SetParityBit", (PyCFunction) _wrap_SerialPort_x_SetParityBit, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SerialPort_x_IsStandardRate", (PyCFunction) _wrap_SerialPort_x_IsStandardRate, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SerialPort_x_swigregister", SerialPort_x_swigregister, METH_VARARGS, NULL}, - { (char *)"new_SerialPort", _wrap_new_SerialPort, METH_VARARGS, NULL}, - { (char *)"delete_SerialPort", _wrap_delete_SerialPort, METH_VARARGS, NULL}, - { (char *)"SerialPort_ChangeLineState", (PyCFunction) _wrap_SerialPort_ChangeLineState, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SerialPort_ClrLineState", (PyCFunction) _wrap_SerialPort_ClrLineState, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SerialPort_GetLineState", _wrap_SerialPort_GetLineState, METH_VARARGS, NULL}, - { (char *)"SerialPort_Ioctl", (PyCFunction) _wrap_SerialPort_Ioctl, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SerialPort_IsOpen", _wrap_SerialPort_IsOpen, METH_VARARGS, NULL}, - { (char *)"SerialPort_Read", (PyCFunction) _wrap_SerialPort_Read, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SerialPort_SendBreak", (PyCFunction) _wrap_SerialPort_SendBreak, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SerialPort_SetBaudrate", (PyCFunction) _wrap_SerialPort_SetBaudrate, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SerialPort_SetLineState", (PyCFunction) _wrap_SerialPort_SetLineState, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SerialPort_SetParityBit", (PyCFunction) _wrap_SerialPort_SetParityBit, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SerialPort_Write", (PyCFunction) _wrap_SerialPort_Write, METH_VARARGS | METH_KEYWORDS, NULL}, - { (char *)"SerialPort_swigregister", SerialPort_swigregister, METH_VARARGS, NULL}, - { (char *)"GetKey", _wrap_GetKey, METH_VARARGS, NULL}, - { NULL, NULL, 0, NULL } -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ - -static void *_p_ctb__SerialPort_xTo_p_ctb__IOBase(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((ctb::IOBase *) ((ctb::SerialPort_x *) x)); -} -static void *_p_ctb__SerialPortTo_p_ctb__IOBase(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((ctb::IOBase *) (ctb::SerialPort_x *) ((ctb::SerialPort *) x)); -} -static void *_p_ctb__SerialPortTo_p_ctb__SerialPort_x(void *x, int *SWIGUNUSEDPARM(newmemory)) { - return (void *)((ctb::SerialPort_x *) ((ctb::SerialPort *) x)); -} -static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_ctb__IOBase = {"_p_ctb__IOBase", "ctb::IOBase *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_ctb__SerialPort = {"_p_ctb__SerialPort", "ctb::SerialPort *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_ctb__SerialPort_DCS = {"_p_ctb__SerialPort_DCS", "ctb::SerialPort_DCS *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_ctb__SerialPort_EINFO = {"_p_ctb__SerialPort_EINFO", "ctb::SerialPort_EINFO *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_ctb__SerialPort_x = {"_p_ctb__SerialPort_x", "ctb::SerialPort_x *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_ctb__Timer = {"_p_ctb__Timer", "ctb::Timer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_ctb__timer_control = {"_p_ctb__timer_control", "ctb::timer_control *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_f_p_void__p_void = {"_p_f_p_void__p_void", "void *(*)(void *)", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_int = {"_p_int", "int *|size_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0}; - -static swig_type_info *swig_type_initial[] = { - &_swigt__p_char, - &_swigt__p_ctb__IOBase, - &_swigt__p_ctb__SerialPort, - &_swigt__p_ctb__SerialPort_DCS, - &_swigt__p_ctb__SerialPort_EINFO, - &_swigt__p_ctb__SerialPort_x, - &_swigt__p_ctb__Timer, - &_swigt__p_ctb__timer_control, - &_swigt__p_f_p_void__p_void, - &_swigt__p_int, - &_swigt__p_p_char, -}; - -static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_ctb__IOBase[] = { {&_swigt__p_ctb__IOBase, 0, 0, 0}, {&_swigt__p_ctb__SerialPort_x, _p_ctb__SerialPort_xTo_p_ctb__IOBase, 0, 0}, {&_swigt__p_ctb__SerialPort, _p_ctb__SerialPortTo_p_ctb__IOBase, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_ctb__SerialPort[] = { {&_swigt__p_ctb__SerialPort, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_ctb__SerialPort_DCS[] = { {&_swigt__p_ctb__SerialPort_DCS, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_ctb__SerialPort_EINFO[] = { {&_swigt__p_ctb__SerialPort_EINFO, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_ctb__SerialPort_x[] = { {&_swigt__p_ctb__SerialPort_x, 0, 0, 0}, {&_swigt__p_ctb__SerialPort, _p_ctb__SerialPortTo_p_ctb__SerialPort_x, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_ctb__Timer[] = { {&_swigt__p_ctb__Timer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_ctb__timer_control[] = { {&_swigt__p_ctb__timer_control, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_f_p_void__p_void[] = { {&_swigt__p_f_p_void__p_void, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}}; - -static swig_cast_info *swig_cast_initial[] = { - _swigc__p_char, - _swigc__p_ctb__IOBase, - _swigc__p_ctb__SerialPort, - _swigc__p_ctb__SerialPort_DCS, - _swigc__p_ctb__SerialPort_EINFO, - _swigc__p_ctb__SerialPort_x, - _swigc__p_ctb__Timer, - _swigc__p_ctb__timer_control, - _swigc__p_f_p_void__p_void, - _swigc__p_int, - _swigc__p_p_char, -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ - -static swig_const_info swig_const_table[] = { -{0, 0, 0, 0.0, 0, 0}}; - -#ifdef __cplusplus -} -#endif -/* ----------------------------------------------------------------------------- - * Type initialization: - * This problem is tough by the requirement that no dynamic - * memory is used. Also, since swig_type_info structures store pointers to - * swig_cast_info structures and swig_cast_info structures store pointers back - * to swig_type_info structures, we need some lookup code at initialization. - * The idea is that swig generates all the structures that are needed. - * The runtime then collects these partially filled structures. - * The SWIG_InitializeModule function takes these initial arrays out of - * swig_module, and does all the lookup, filling in the swig_module.types - * array with the correct data and linking the correct swig_cast_info - * structures together. - * - * The generated swig_type_info structures are assigned staticly to an initial - * array. We just loop through that array, and handle each type individually. - * First we lookup if this type has been already loaded, and if so, use the - * loaded structure instead of the generated one. Then we have to fill in the - * cast linked list. The cast data is initially stored in something like a - * two-dimensional array. Each row corresponds to a type (there are the same - * number of rows as there are in the swig_type_initial array). Each entry in - * a column is one of the swig_cast_info structures for that type. - * The cast_initial array is actually an array of arrays, because each row has - * a variable number of columns. So to actually build the cast linked list, - * we find the array of casts associated with the type, and loop through it - * adding the casts to the list. The one last trick we need to do is making - * sure the type pointer in the swig_cast_info struct is correct. - * - * First off, we lookup the cast->type name to see if it is already loaded. - * There are three cases to handle: - * 1) If the cast->type has already been loaded AND the type we are adding - * casting info to has not been loaded (it is in this module), THEN we - * replace the cast->type pointer with the type pointer that has already - * been loaded. - * 2) If BOTH types (the one we are adding casting info to, and the - * cast->type) are loaded, THEN the cast info has already been loaded by - * the previous module so we just ignore it. - * 3) Finally, if cast->type has not already been loaded, then we add that - * swig_cast_info to the linked list (because the cast->type) pointer will - * be correct. - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#if 0 -} /* c-mode */ -#endif -#endif - -#if 0 -#define SWIGRUNTIME_DEBUG -#endif - - -SWIGRUNTIME void -SWIG_InitializeModule(void *clientdata) { - size_t i; - swig_module_info *module_head, *iter; - int found, init; - - clientdata = clientdata; - - /* check to see if the circular list has been setup, if not, set it up */ - if (swig_module.next==0) { - /* Initialize the swig_module */ - swig_module.type_initial = swig_type_initial; - swig_module.cast_initial = swig_cast_initial; - swig_module.next = &swig_module; - init = 1; - } else { - init = 0; - } - - /* Try and load any already created modules */ - module_head = SWIG_GetModule(clientdata); - if (!module_head) { - /* This is the first module loaded for this interpreter */ - /* so set the swig module into the interpreter */ - SWIG_SetModule(clientdata, &swig_module); - module_head = &swig_module; - } else { - /* the interpreter has loaded a SWIG module, but has it loaded this one? */ - found=0; - iter=module_head; - do { - if (iter==&swig_module) { - found=1; - break; - } - iter=iter->next; - } while (iter!= module_head); - - /* if the is found in the list, then all is done and we may leave */ - if (found) return; - /* otherwise we must add out module into the list */ - swig_module.next = module_head->next; - module_head->next = &swig_module; - } - - /* When multiple interpeters are used, a module could have already been initialized in - a different interpreter, but not yet have a pointer in this interpreter. - In this case, we do not want to continue adding types... everything should be - set up already */ - if (init == 0) return; - - /* Now work on filling in swig_module.types */ -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: size %d\n", swig_module.size); -#endif - for (i = 0; i < swig_module.size; ++i) { - swig_type_info *type = 0; - swig_type_info *ret; - swig_cast_info *cast; - -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); -#endif - - /* if there is another module already loaded */ - if (swig_module.next != &swig_module) { - type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); - } - if (type) { - /* Overwrite clientdata field */ -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: found type %s\n", type->name); -#endif - if (swig_module.type_initial[i]->clientdata) { - type->clientdata = swig_module.type_initial[i]->clientdata; -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); -#endif - } - } else { - type = swig_module.type_initial[i]; - } - - /* Insert casting types */ - cast = swig_module.cast_initial[i]; - while (cast->type) { - /* Don't need to add information already in the list */ - ret = 0; -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); -#endif - if (swig_module.next != &swig_module) { - ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); -#ifdef SWIGRUNTIME_DEBUG - if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); -#endif - } - if (ret) { - if (type == swig_module.type_initial[i]) { -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: skip old type %s\n", ret->name); -#endif - cast->type = ret; - ret = 0; - } else { - /* Check for casting already in the list */ - swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); -#ifdef SWIGRUNTIME_DEBUG - if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); -#endif - if (!ocast) ret = 0; - } - } - - if (!ret) { -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); -#endif - if (type->cast) { - type->cast->prev = cast; - cast->next = type->cast; - } - type->cast = cast; - } - cast++; - } - /* Set entry in modules->types array equal to the type */ - swig_module.types[i] = type; - } - swig_module.types[i] = 0; - -#ifdef SWIGRUNTIME_DEBUG - printf("**** SWIG_InitializeModule: Cast List ******\n"); - for (i = 0; i < swig_module.size; ++i) { - int j = 0; - swig_cast_info *cast = swig_module.cast_initial[i]; - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); - while (cast->type) { - printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); - cast++; - ++j; - } - printf("---- Total casts: %d\n",j); - } - printf("**** SWIG_InitializeModule: Cast List ******\n"); -#endif -} - -/* This function will propagate the clientdata field of type to -* any new swig_type_info structures that have been added into the list -* of equivalent types. It is like calling -* SWIG_TypeClientData(type, clientdata) a second time. -*/ -SWIGRUNTIME void -SWIG_PropagateClientData(void) { - size_t i; - swig_cast_info *equiv; - static int init_run = 0; - - if (init_run) return; - init_run = 1; - - for (i = 0; i < swig_module.size; i++) { - if (swig_module.types[i]->clientdata) { - equiv = swig_module.types[i]->cast; - while (equiv) { - if (!equiv->converter) { - if (equiv->type && !equiv->type->clientdata) - SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); - } - equiv = equiv->next; - } - } - } -} - -#ifdef __cplusplus -#if 0 -{ - /* c-mode */ -#endif -} -#endif - - - -#ifdef __cplusplus -extern "C" { -#endif - - /* Python-specific SWIG API */ -#define SWIG_newvarlink() SWIG_Python_newvarlink() -#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) -#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) - - /* ----------------------------------------------------------------------------- - * global variable support code. - * ----------------------------------------------------------------------------- */ - - typedef struct swig_globalvar { - char *name; /* Name of global variable */ - PyObject *(*get_attr)(void); /* Return the current value */ - int (*set_attr)(PyObject *); /* Set the value */ - struct swig_globalvar *next; - } swig_globalvar; - - typedef struct swig_varlinkobject { - PyObject_HEAD - swig_globalvar *vars; - } swig_varlinkobject; - - SWIGINTERN PyObject * - swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { -#if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_InternFromString(""); -#else - return PyString_FromString(""); -#endif - } - - SWIGINTERN PyObject * - swig_varlink_str(swig_varlinkobject *v) { -#if PY_VERSION_HEX >= 0x03000000 - PyObject *str = PyUnicode_InternFromString("("); - PyObject *tail; - PyObject *joined; - swig_globalvar *var; - for (var = v->vars; var; var=var->next) { - tail = PyUnicode_FromString(var->name); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; - if (var->next) { - tail = PyUnicode_InternFromString(", "); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; - } - } - tail = PyUnicode_InternFromString(")"); - joined = PyUnicode_Concat(str, tail); - Py_DecRef(str); - Py_DecRef(tail); - str = joined; -#else - PyObject *str = PyString_FromString("("); - swig_globalvar *var; - for (var = v->vars; var; var=var->next) { - PyString_ConcatAndDel(&str,PyString_FromString(var->name)); - if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); - } - PyString_ConcatAndDel(&str,PyString_FromString(")")); -#endif - return str; - } - - SWIGINTERN int - swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { - char *tmp; - PyObject *str = swig_varlink_str(v); - fprintf(fp,"Swig global variables "); - fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(str); - return 0; - } - - SWIGINTERN void - swig_varlink_dealloc(swig_varlinkobject *v) { - swig_globalvar *var = v->vars; - while (var) { - swig_globalvar *n = var->next; - free(var->name); - free(var); - var = n; - } - } - - SWIGINTERN PyObject * - swig_varlink_getattr(swig_varlinkobject *v, char *n) { - PyObject *res = NULL; - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - res = (*var->get_attr)(); - break; - } - var = var->next; - } - if (res == NULL && !PyErr_Occurred()) { - PyErr_SetString(PyExc_NameError,"Unknown C global variable"); - } - return res; - } - - SWIGINTERN int - swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { - int res = 1; - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - res = (*var->set_attr)(p); - break; - } - var = var->next; - } - if (res == 1 && !PyErr_Occurred()) { - PyErr_SetString(PyExc_NameError,"Unknown C global variable"); - } - return res; - } - - SWIGINTERN PyTypeObject* - swig_varlink_type(void) { - static char varlink__doc__[] = "Swig var link object"; - static PyTypeObject varlink_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp - = { - /* PyObject header changed in Python 3 */ -#if PY_VERSION_HEX >= 0x03000000 - PyVarObject_HEAD_INIT(&PyType_Type, 0) -#else - PyObject_HEAD_INIT(NULL) - 0, /* Number of items in variable part (ob_size) */ -#endif - (char *)"swigvarlink", /* Type name (tp_name) */ - sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ - 0, /* Itemsize (tp_itemsize) */ - (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ - (printfunc) swig_varlink_print, /* Print (tp_print) */ - (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ - (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ - 0, /* tp_compare */ - (reprfunc) swig_varlink_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc) swig_varlink_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - 0, /* tp_flags */ - varlink__doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 - 0, /* tp_del */ -#endif -#ifdef COUNT_ALLOCS - 0,0,0,0 /* tp_alloc -> tp_next */ -#endif - }; - varlink_type = tmp; - /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ -#if PY_VERSION_HEX < 0x03000000 - varlink_type.ob_type = &PyType_Type; -#endif - type_init = 1; - } - return &varlink_type; - } - - /* Create a variable linking object for use later */ - SWIGINTERN PyObject * - SWIG_Python_newvarlink(void) { - swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); - if (result) { - result->vars = 0; - } - return ((PyObject*) result); - } - - SWIGINTERN void - SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { - swig_varlinkobject *v = (swig_varlinkobject *) p; - swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); - if (gv) { - size_t size = strlen(name)+1; - gv->name = (char *)malloc(size); - if (gv->name) { - strncpy(gv->name,name,size); - gv->get_attr = get_attr; - gv->set_attr = set_attr; - gv->next = v->vars; - } - } - v->vars = gv; - } - - SWIGINTERN PyObject * - SWIG_globals(void) { - static PyObject *_SWIG_globals = 0; - if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); - return _SWIG_globals; - } - - /* ----------------------------------------------------------------------------- - * constants/methods manipulation - * ----------------------------------------------------------------------------- */ - - /* Install Constants */ - SWIGINTERN void - SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { - PyObject *obj = 0; - size_t i; - for (i = 0; constants[i].type; ++i) { - switch(constants[i].type) { - case SWIG_PY_POINTER: - obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); - break; - case SWIG_PY_BINARY: - obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); - break; - default: - obj = 0; - break; - } - if (obj) { - PyDict_SetItemString(d, constants[i].name, obj); - Py_DECREF(obj); - } - } - } - - /* -----------------------------------------------------------------------------*/ - /* Fix SwigMethods to carry the callback ptrs when needed */ - /* -----------------------------------------------------------------------------*/ - - SWIGINTERN void - SWIG_Python_FixMethods(PyMethodDef *methods, - swig_const_info *const_table, - swig_type_info **types, - swig_type_info **types_initial) { - size_t i; - for (i = 0; methods[i].ml_name; ++i) { - const char *c = methods[i].ml_doc; - if (c && (c = strstr(c, "swig_ptr: "))) { - int j; - swig_const_info *ci = 0; - const char *name = c + 10; - for (j = 0; const_table[j].type; ++j) { - if (strncmp(const_table[j].name, name, - strlen(const_table[j].name)) == 0) { - ci = &(const_table[j]); - break; - } - } - if (ci) { - size_t shift = (ci->ptype) - types; - swig_type_info *ty = types_initial[shift]; - size_t ldoc = (c - methods[i].ml_doc); - size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; - char *ndoc = (char*)malloc(ldoc + lptr + 10); - if (ndoc) { - char *buff = ndoc; - void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; - if (ptr) { - strncpy(buff, methods[i].ml_doc, ldoc); - buff += ldoc; - strncpy(buff, "swig_ptr: ", 10); - buff += 10; - SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); - methods[i].ml_doc = ndoc; - } - } - } - } - } - } - -#ifdef __cplusplus -} -#endif - -/* -----------------------------------------------------------------------------* - * Partial Init method - * -----------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" -#endif - -SWIGEXPORT -#if PY_VERSION_HEX >= 0x03000000 -PyObject* -#else -void -#endif -SWIG_init(void) { - PyObject *m, *d; -#if PY_VERSION_HEX >= 0x03000000 - static struct PyModuleDef SWIG_module = { - PyModuleDef_HEAD_INIT, - (char *) SWIG_name, - NULL, - -1, - SwigMethods, - NULL, - NULL, - NULL, - NULL - }; -#endif - - /* Fix SwigMethods to carry the callback ptrs when needed */ - SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); - -#if PY_VERSION_HEX >= 0x03000000 - m = PyModule_Create(&SWIG_module); -#else - m = Py_InitModule((char *) SWIG_name, SwigMethods); -#endif - d = PyModule_GetDict(m); - - SWIG_InitializeModule(0); - SWIG_InstallConstants(d,swig_const_table); - - - SWIG_Python_SetConstant(d, "CTB_RESET",SWIG_From_int(static_cast< int >(ctb::CTB_RESET))); - SWIG_Python_SetConstant(d, "ParityNone",SWIG_From_int(static_cast< int >(ctb::ParityNone))); - SWIG_Python_SetConstant(d, "ParityOdd",SWIG_From_int(static_cast< int >(ctb::ParityOdd))); - SWIG_Python_SetConstant(d, "ParityEven",SWIG_From_int(static_cast< int >(ctb::ParityEven))); - SWIG_Python_SetConstant(d, "ParityMark",SWIG_From_int(static_cast< int >(ctb::ParityMark))); - SWIG_Python_SetConstant(d, "ParitySpace",SWIG_From_int(static_cast< int >(ctb::ParitySpace))); - SWIG_Python_SetConstant(d, "LinestateDcd",SWIG_From_int(static_cast< int >(ctb::LinestateDcd))); - SWIG_Python_SetConstant(d, "LinestateCts",SWIG_From_int(static_cast< int >(ctb::LinestateCts))); - SWIG_Python_SetConstant(d, "LinestateDsr",SWIG_From_int(static_cast< int >(ctb::LinestateDsr))); - SWIG_Python_SetConstant(d, "LinestateDtr",SWIG_From_int(static_cast< int >(ctb::LinestateDtr))); - SWIG_Python_SetConstant(d, "LinestateRing",SWIG_From_int(static_cast< int >(ctb::LinestateRing))); - SWIG_Python_SetConstant(d, "LinestateRts",SWIG_From_int(static_cast< int >(ctb::LinestateRts))); - SWIG_Python_SetConstant(d, "LinestateNull",SWIG_From_int(static_cast< int >(ctb::LinestateNull))); - SWIG_Python_SetConstant(d, "CTB_SER_GETEINFO",SWIG_From_int(static_cast< int >(ctb::CTB_SER_GETEINFO))); - SWIG_Python_SetConstant(d, "CTB_SER_GETBRK",SWIG_From_int(static_cast< int >(ctb::CTB_SER_GETBRK))); - SWIG_Python_SetConstant(d, "CTB_SER_GETFRM",SWIG_From_int(static_cast< int >(ctb::CTB_SER_GETFRM))); - SWIG_Python_SetConstant(d, "CTB_SER_GETOVR",SWIG_From_int(static_cast< int >(ctb::CTB_SER_GETOVR))); - SWIG_Python_SetConstant(d, "CTB_SER_GETPAR",SWIG_From_int(static_cast< int >(ctb::CTB_SER_GETPAR))); - SWIG_Python_SetConstant(d, "CTB_SER_GETINQUE",SWIG_From_int(static_cast< int >(ctb::CTB_SER_GETINQUE))); - SWIG_Python_SetConstant(d, "CTB_SER_SETPAR",SWIG_From_int(static_cast< int >(ctb::CTB_SER_SETPAR))); -#if PY_VERSION_HEX >= 0x03000000 - return m; -#else - return; -#endif -} - diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/serportx.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/serportx.i deleted file mode 100644 index 083daddab4..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/serportx.i +++ /dev/null @@ -1,84 +0,0 @@ -%{ -#include "ctb-0.16/serportx.h" -%} - -%include iobase.i - -namespace ctb { - -enum Parity -{ - ParityNone, - ParityOdd, - ParityEven, - ParityMark, - ParitySpace -}; - -enum SerialLineState -{ - LinestateDcd = 0x040, - LinestateCts = 0x020, - LinestateDsr = 0x100, - LinestateDtr = 0x002, - LinestateRing = 0x080, - LinestateRts = 0x004, - LinestateNull = 0x000 -}; - -struct SerialPort_DCS -{ - int baud; - Parity parity; - unsigned char wordlen; - unsigned char stopbits; - bool rtscts; - bool xonxoff; - char buf[16]; - SerialPort_DCS(); - ~SerialPort_DCS(); - char* GetSettings(); -}; - -struct SerialPort_EINFO -{ - int brk; - int frame; - int overrun; - int parity; - SerialPort_EINFO(); - ~SerialPort_EINFO(); -}; - -enum { - CTB_SER_GETEINFO = CTB_SERIAL, - CTB_SER_GETBRK, - CTB_SER_GETFRM, - CTB_SER_GETOVR, - CTB_SER_GETPAR, - CTB_SER_GETINQUE, - CTB_SER_SETPAR, -}; - -class SerialPort_x : public IOBase -{ -protected: - SerialPort_DCS m_dcs; - char m_devname[SERIALPORT_NAME_LEN]; -public: - SerialPort_x(); - virtual ~SerialPort_x(); - const char* ClassName(); - virtual int ChangeLineState(SerialLineState flags) = 0; - virtual int ClrLineState(SerialLineState flags) = 0; - virtual int GetLineState() = 0; - virtual char* GetSettingsAsString(); - virtual int Ioctl(int cmd,void* args); - virtual int SendBreak(int duration) = 0; - virtual int SetBaudrate(int baudrate) = 0; - virtual int SetLineState(SerialLineState flags) = 0; - virtual int SetParityBit( bool parity ) = 0; - static bool IsStandardRate( long rate ); -}; - -}; diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/makepy.bat b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/makepy.bat deleted file mode 100644 index 8320cb9e57..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/makepy.bat +++ /dev/null @@ -1,65 +0,0 @@ -@ECHO OFF - -REM ################################################################## -REM # set the path/settings of your compiler enviroment and remove the -REM # comment command (REM) -REM # (you don't need this, if you set it always in your system -REM # enviroment) -REM ################################################################## -REM CALL "c:\Programme\Microsoft Visual C++ Toolkit 2003\vcvars32.bat" - -REM ################################################################## -REM # set the path to your python24 (or python23) library, for example -REM # works for me with C:\Program Files\Python2.4\libs\python24.lib -REM ################################################################## -SET PYTHON_LIB="C:\Program Files\Python2.4\libs\python24.lib" - -REM ################################################################## -REM # set the include path of your python24 (python23) deleveloper -REM # header files. For me, it's on C:\Program Files -REM ################################################################## -SET PYTHON_INCLUDE="C:\Program Files\Python2.4\include" - -REM ################################################################## -REM # after installing swig, set the path, so the script can find it -REM ################################################################## -SET SWIG="C:\Program Files\swigwin-1.3.40\swig" - -REM ################################################################## -REM # DON'T CHANGE ANYMORE AT THE FOLLOWING LINES!!! -REM ################################################################## - -SET GPIB_LIB= -SET GPIB_SRC= - -ECHO // This file is created automatically, don't change it! > wxctb.i -ECHO %%module wxctb >> wxctb.i -ECHO typedef int size_t; >> wxctb.i -ECHO %%include timer.i >> wxctb.i -ECHO %%include serport.i >> wxctb.i -ECHO %%include ../kbhit.i >> wxctb.i - -IF NOT [%1]==[USE_GPIB] GOTO nogpib -SET GPIB_LIB=../../../lib/gpib32.lib -SET GPIB_SRC=../../../src/gpib.cpp -ECHO %%include ../gpib.i >> wxctb.i - -:nogpib - - -DEL *.obj wxctb_wrap.cxx *.lib *.dll *.exp - -ECHO "swig generates python wrapper files..." -%SWIG% -c++ -Wall -nodefault -python -keyword -new_repr -modern wxctb.i - -ECHO "create shared library wxctb for python 2.4..." -cl /LD /D WIN32 /I %PYTHON_INCLUDE% /I ../../../include wxctb_wrap.cxx ../../../src/win32/serport.cpp ../../../src/serportx.cpp ../../../src/win32/timer.cpp ../../../src/kbhit.cpp ../../../src/iobase.cpp %GPIB_SRC% ../../../src/fifo.cpp /link %PYTHON_LIB% winmm.lib %GPIB_LIB% - -MOVE wxctb_wrap.dll _wxctb.dll - -ECHO "copy ctb.py, wxctb.py and _wxctb.so to the module/win32 folder..." -MKDIR ..\..\module\win32 -COPY ..\ctb.py ..\..\module\win32 -COPY wxctb.py ..\..\module\win32 -COPY _wxctb.dll ..\..\module\win32 - diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/serport.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/serport.i deleted file mode 100644 index 84cb69887c..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/serport.i +++ /dev/null @@ -1,57 +0,0 @@ -%{ -#include "ctb-0.16/win32/serport.h" -%} - -%include ../serportx.i - -namespace ctb { - -%pythoncode { -COM1 = "com1" -COM2 = "com2" -COM3 = "com3" -COM4 = "com4" -COM5 = "com5" -COM6 = "com6" -COM7 = "com7" -COM8 = "com8" -COM9 = "com9" -COM10 = "\\\\.\\com10" -COM11 = "\\\\.\\com11" -COM12 = "\\\\.\\com12" -COM13 = "\\\\.\\com13" -COM14 = "\\\\.\\com14" -COM15 = "\\\\.\\com15" -COM16 = "\\\\.\\com16" -COM17 = "\\\\.\\com17" -COM18 = "\\\\.\\com18" -COM19 = "\\\\.\\com19" -}; - -class SerialPort : public SerialPort_x -{ -protected: - HANDLE fd; - OVERLAPPED ov; - SerialPort_EINFO einfo; - - int CloseDevice(); - int OpenDevice(const char* devname, void* dcs); -public: - SerialPort(); - ~SerialPort(); - - int ChangeLineState(SerialLineState flags); - int ClrLineState(SerialLineState flags); - int GetLineState(); - int Ioctl(int cmd,void* args); - int IsOpen(); - int Read(char* buf,size_t len); - int SendBreak(int duration); - int SetBaudrate(int baudrate); - int SetLineState(SerialLineState flags); - int SetParityBit( bool parity ); - int Write(char* buf,size_t len); -}; - -}; diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/timer.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/timer.i deleted file mode 100644 index b95f26a0d4..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/timer.i +++ /dev/null @@ -1,39 +0,0 @@ -%{ -#include "ctb-0.16/win32/timer.h" -%} - -%include cpointer.i - -// lets create new fuctions for pointer handling in python (for int *exitflag) -%pointer_functions(int, intp); - -namespace ctb { - -// perhaps we doesn''t need timer_control to export -// but we need if we want to inherit from timer in python -struct timer_control -{ - unsigned int msecs; - int *exitflag; - MMRESULT stop; - void* (*exitfnc)(void*); -}; - -class Timer -{ -protected: - - DWORD id; - MMRESULT h; - timer_control control; - unsigned int timer_secs; -public: - Timer(unsigned int msec,int* exitflag,void*(*exitfnc)(void*)=NULL); - ~Timer(); - int start(); - int stop(); -}; - -void sleepms(unsigned int ms); - -}; diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/wxctb.i b/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/wxctb.i deleted file mode 100644 index d00350fb03..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/python/src/win32/wxctb.i +++ /dev/null @@ -1,6 +0,0 @@ -// This file is created automatically, don't change it! -%module wxctb -typedef int size_t; -%include timer.i -%include serport.i -%include ../kbhit.i diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/samples/ctbtest.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/samples/ctbtest.cpp deleted file mode 100644 index bf84e20ed7..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/samples/ctbtest.cpp +++ /dev/null @@ -1,181 +0,0 @@ -#include "ctb-0.16/ctb.h" - -#include -#include -#include - -#include -#include - -using namespace std; - -// ----------------- options ------------------------------- -const char* options="a:b:d:e:hlp:t:"; - -const char* helpMessage = -{ - "A simple serial port class test\n" - "ctbtest [options]\n" - "available options are:\n" - "-a : address (only GPIB)\n" - "-b : baudrate [any value], default is 38400\n" - "-d : connected device, default is COM1\n" - "-e : eos\n" - "-h : print this\n" - "-l : list all available serial ports\n" - "-p : protocol like 8N1\n" - "-t : communication timeout in ms (default is 100ms)\n" -}; - -int main(int argc,char* argv[]) -{ - int address = 15; - - int baudrate = 19200; - - string devname = ctb::COM1; - - string eos = "\r\n"; - - string protocol = "8N1"; - - int timeout = 100; - - bool showAvailablePorts = false; - - int quit = 0; - - int val; - - while ( ( val=getopt( argc, argv, (char*)options ) ) != EOF ) { - switch ( val ) { - case 'a' : address = strtol( optarg, NULL, 10 ); break; - case 'b' : baudrate = strtol( optarg, NULL, 10 ); break; - case 'd' : devname = optarg; break; - case 'h' : cerr << helpMessage << endl; exit( 0 ); - case 'l' : showAvailablePorts = true; break; - case 'p' : protocol = optarg; break; - case 't' : timeout = strtol( optarg, NULL, 10 ); break; - } - } - - ctb::IOBase* device = NULL; - - std::vector ports; - - if( ctb::GetAvailablePorts( ports ) && showAvailablePorts ) { - - for( int i = 0; i < ports.size(); - std::cout << ports[ i++ ] << endl ) {}; - - return 0; - - } - - -#if ( GPIB ) - if( ( devname == ctb::GPIB1 ) || ( devname == ctb::GPIB2 ) ) { - - ctb::GpibDevice* gpibDevice = new ctb::GpibDevice(); - - if( gpibDevice->Open( devname.c_str(), address ) >= 0 ) { - - device = gpibDevice; - - } - - } - else { -#endif - - ctb::SerialPort* serialPort = new ctb::SerialPort(); - - if( serialPort->Open( devname.c_str(), baudrate, - protocol.c_str(), - ctb::SerialPort::NoFlowControl ) >= 0 ) { - - device = serialPort; - - } - -#if ( GPIB ) - } -#endif - - if( ! device ) { - - cout << "Cannot open " << devname.c_str() << endl; - - return -1; - - } - - // up to know you don't have to worry any longer about the kind of - // the connected device. As long as you do nothing something device - // specific (like toggle some modem control lines), the access is - // the same for each device. - - string line; - - char receiveBuf[ 128 ]; - - cout << "Enter your command or just press Enter without any\n" - "input for exit!"; - - while( true ) { - - cout << endl << "Your input >"; - - // read the string to send - getline( cin, line ); - - // add some defined EOS (end of string sequence or character) - if( line.empty() ) { - - break; - - } - - line += eos; - - // send data throughout the connected device independent of the typ - if( device->Writev( (char*)line.c_str(), - line.size(), - timeout ) != line.size() ) { - - cerr << "Incomplete data transmission" << endl; - - } - - int readed = 0; - - do { - - // in case of an event driven GUI you better use a non blocking - // Read(...) in your idle function. Here we have to wait for the - // response before we send another user command... - readed = device->Readv( receiveBuf, - sizeof( receiveBuf ) - 1, - timeout); - - // something received? - if( readed > 0 ) { - - receiveBuf[ readed ] = 0; - - cout << receiveBuf; - - } - - } while( readed > 0 ); - - cout << endl; - - } // while( true ) - - device->Close(); - - delete device; - - return 0; -} diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/fifo.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/fifo.cpp deleted file mode 100644 index c03e320846..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/fifo.cpp +++ /dev/null @@ -1,130 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: fifo.cpp -// Purpose: -// Author: Joachim Buermann, Michael Hungershausen -// Id: $Id$ -// Copyright: (c) 2006,2007 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "ctb-0.16/fifo.h" - -namespace ctb { - - Fifo::Fifo(size_t size) : - m_size(size) - { - m_begin = new char[size]; - m_end = m_begin + m_size; - m_rdptr = m_wrptr = m_begin; - }; - - Fifo::~Fifo() - { - delete m_begin; - }; - - void Fifo::clear() - { - m_rdptr = m_wrptr = m_begin; - }; - - int Fifo::get(char* ch) - { - if(m_rdptr != m_wrptr) { - *ch = *m_rdptr++; - if(m_rdptr >= m_end) { - m_rdptr = m_begin; - } - return 1; - } - return 0; - }; - - size_t Fifo::items() - { - char* tmp_wrptr = m_wrptr; - // the rdptr will only changed by the reader. If we suppose, that - // the caller of the items() method is identical with the reader, - // this should be thread save. - char* tmp_rdptr = m_rdptr; - - // if the write pointer is identical with the read, there are no - // more data in the Fifo - if(tmp_wrptr == tmp_rdptr) { - return 0; - } - // the write pointer is greater as the read pointer, so we just - // can calculate the difference for the remaining data - if(tmp_wrptr > tmp_rdptr) { - return (tmp_wrptr - tmp_rdptr); - } - // the write pointer has circulate and stands against the read - // pointer - else { - return (m_size - (tmp_rdptr - tmp_wrptr)); - } - }; - - int Fifo::put(char ch) - { - // for a thread safe operation, the write of a data byte must be - // atomic. So we first assign the current position of the write - // pointer to a temporary pointer. - // Increment it for the comparison with the end of the internal - // buffer and the read pointer - char* tmp_wrptr = m_wrptr + 1; - if(tmp_wrptr >= m_end) { - tmp_wrptr = m_begin; - } - if(tmp_wrptr == m_rdptr) { - return 0; - } - // this don't changes the write pointer! - *m_wrptr = ch; - // that's the trick! The following assignment is atomic and cannot - // interrupted within a read access by the read thread - m_wrptr = tmp_wrptr; - return 1; - }; - - int Fifo::read(char* data,int n) - { - int nresult = 0; - while(n--) { - // the same as get() - if(m_rdptr != m_wrptr) { - *data = *m_rdptr++; - if(m_rdptr >= m_end) { - m_rdptr = m_begin; - } - } - else { - break; - } - nresult++; - data++; - } - return nresult; - }; - - int Fifo::write(char* data,int n) - { - int nresult = 0; - while(n--) { - // the same as put() - char* tmp_wrptr = m_wrptr + 1; - if(tmp_wrptr >= m_end) { - tmp_wrptr = m_begin; - } - if(tmp_wrptr == m_rdptr) { - break; - } - *m_wrptr = *data++; - m_wrptr = tmp_wrptr; - nresult++; - } - return nresult; - }; - -} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/getopt.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/getopt.cpp deleted file mode 100644 index 69afb2e7b7..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/getopt.cpp +++ /dev/null @@ -1,14 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: getopt.cpp -// Purpose: simple wrapper file -// Author: Joachim Buermann -// Id: $Id: timer.h,v 1.1.1.1 2004/11/24 10:30:11 jb Exp $ -// Copyright: (c) 2001 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#if defined (WIN32) -# include "win32/getopt.cpp" -#endif - - diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/gpib.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/gpib.cpp deleted file mode 100644 index e2f577de64..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/gpib.cpp +++ /dev/null @@ -1,340 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: gpibx.cpp -// Purpose: -// Author: Joachim Buermann -// Id: $Id: gpibx.cpp,v 1.1.1.1 2004/11/24 10:30:11 jb Exp $ -// Copyright: (c) 2001,2004 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "ctb-0.16/gpib.h" -#include "ctb-0.16/timer.h" -#include -#include -#ifdef WIN32 -# include "ctb-0.16/win32/gpib-32.h" -#if _MSC_VER < 1900 -# define snprintf _snprintf -#endif -#elif __GNUG__ -# include -#endif - -namespace ctb { - - const char* GPIB1 = "gpib1"; - const char* GPIB2 = "gpib2"; - - struct gpibErr_t { - int m_errno; - const char* m_notation; - const char* m_description; - }; - - static gpibErr_t gpibErrors[] = { - {0,"EDVR","DOS Error"}, - {1,"ECIC","Specified GPIB Interface Board is Not Active Controller"}, - {2,"ENOL","No present listing device"}, - {3,"EADR","GPIB Board has not been addressed properly"}, - {4,"EARG","Invalid argument"}, - {5,"ESAC","Specified GPIB Interface Board is not System Controller"}, - {6,"EABO","I/O operation aborted (time-out)"}, - {7,"ENEB","Non-existent GPIB board"}, - {10,"EOIP","Routine not allowed during asynchronous I/O operation"}, - {11,"ECAP","No capability for operation"}, - {12,"EFSO","File System Error"}, - {14,"EBUS","Command byte transfer error"}, - {15,"ESTB","Serial poll status byte lost"}, - {16,"ESQR","SRQ stuck in ON position"}, - {20,"ETAB","Table problem"}, - {247,"EINT","No interrupt configured on board"}, - {248,"EWMD","Windows is not in Enhanced mode"}, - {249,"EVDD","GPIB driver is not installed"}, - {250,"EOVR","Buffer Overflow"}, - {251,"ESML","Two library calls running simultaneously"}, - {252,"ECFG","Board type does not match GPIB.CFG"}, - {253,"ETMR","No Windows timers available"}, - {254,"ESLC","No Windows selectors available"}, - {255,"EBRK","Control-Break pressed"} - }; - - char* Gpib_DCS::GetSettings() - { - const char* to[] = { - "None","10us","30us","100us","300us","1ms","3ms","10ms","30ms", - "100ms","300ms","1s","3s","10s","30s","100s","300s","1000s" - }; - memset(m_buf,0,sizeof(m_buf)); - snprintf(m_buf,sizeof(m_buf)-1,"Adr: (%i,%i) to:%s", - m_address1, - m_address2, - to[m_timeout]); - return m_buf; - }; - - int GpibDevice::CloseDevice() - { - if(m_hd != -1) { - // goto local... - ibloc(m_hd); - // ...and switch device offline - ibonl(m_hd,0); - m_hd = -1; - m_board = -1; - } - return 0; - }; - - const char* GpibDevice::GetErrorString(int error,bool detailed) - { - for(size_t i=0;i<(sizeof(gpibErrors)/sizeof(gpibErr_t));i++) { - if(gpibErrors[i].m_errno == error) { - if(detailed) { - return gpibErrors[i].m_description; - } - else { - return gpibErrors[i].m_notation; - } - } - } - return 0; - }; - -// This is only for internal usage - int GpibDevice::Ibrd(char* buf,size_t len) - { - return ibrd(m_hd,buf,len); - }; - -// This is only for internal usage - int GpibDevice::Ibwrt(char* buf,size_t len) - { - return ibwrt(m_hd,buf,len); - }; - - int GpibDevice::Ioctl(int cmd,void* args) - { - switch(cmd) { - case CTB_RESET: - if(m_hd >= 0) { - ibclr(m_hd); - return 0; - } - return -1; - case CTB_GPIB_GETRSP: { - char spr = 0; - if(m_hd >= 0) { - ibrsp(m_hd,&spr); - *(int*)args = (int)spr; - return 0; - } - return 1; } - case CTB_GPIB_GETSTA: - *(int*)args = m_state; - return 0; - case CTB_GPIB_GETERR: - *(int*)args = m_error; - return 0; - case CTB_GPIB_GETLINES: { - short state = 0; - if(m_hd >= 0) { - iblines(m_board,&state); - *(int*)args = (int)state; - return 0; - } - return -1; } - case CTB_GPIB_SETTIMEOUT: { - if(m_hd >= 0) { - GpibTimeout timeout; - unsigned long to = *(unsigned long*)args; - // convert the timeout in ms (given by args) into the - // traditional NI-488.2 timeout period - if(to > 1000000) timeout = GpibTimeout1000s; - else if(to >= 300000) timeout = GpibTimeout300s; - else if(to >= 100000) timeout = GpibTimeout100s; - else if(to >= 30000) timeout = GpibTimeout30s; - else if(to >= 10000) timeout = GpibTimeout10s; - else if(to >= 3000) timeout = GpibTimeout3s; - else if(to >= 1000) timeout = GpibTimeout1s; - else if(to >= 300) timeout = GpibTimeout300ms; - else if(to >= 100) timeout = GpibTimeout100ms; - else if(to >= 30) timeout = GpibTimeout30ms; - else if(to >= 10) timeout = GpibTimeout10ms; - else if(to >= 3) timeout = GpibTimeout3ms; - else if(to >= 1) timeout = GpibTimeout1ms; - else timeout = GpibTimeoutNone; - ibtmo(m_hd,timeout); - return 0; - } - return -1; } - case CTB_GPIB_GTL: - // Forces the specified device to go to local program mode - if(m_hd >= 0) { - ibloc(m_hd); - return 0; - } - return -1; - case CTB_GPIB_REN: - // This routine can only be used if the specified GPIB - // Interface Board is the System Controller. - // Remember that even though the REN line is asserted, - // the device(s) will not be put into remote state until is - // addressed to listen by the Active Controller - if(m_hd) { - char adr = (char)m_dcs.m_address1; - ibsre(m_board,1); - ibcmd(m_board,&adr,1); - return 0; - } - return -1; - case CTB_GPIB_RESET_BUS: - ibsic(m_board); - return 0; - case CTB_GPIB_GET_EOS_CHAR: - if( m_hd ) { - *(int*)args = (int)m_dcs.m_eosChar; - return 0; - } - return -1; - case CTB_GPIB_SET_EOS_CHAR: -#ifdef __GNUG__ - // FIXME! - // Doesn't work with linux-gpib-3.2.08. All EOS beside 0x00 - // are blocking during sending data to the device. (Look at - // function my_ibwrt in linux-gpib-3.2.08/lib/ibWrt.c - if( m_hd ) { - m_dcs.m_eosChar = (char)*(int*)args; - ibeos(m_hd,(m_dcs.m_eosMode << 8) | m_dcs.m_eosChar); - return 0; - } -#endif - return -1; - case CTB_GPIB_GET_EOS_MODE: - if( m_hd ) { - *(int*)args = (int)m_dcs.m_eosMode; - return 0; - } - return -1; - case CTB_GPIB_SET_EOS_MODE: - if( m_hd ) { - m_dcs.m_eosMode = (char)*(int*)args; - ibeos(m_hd,(m_dcs.m_eosMode << 8) | m_dcs.m_eosChar); - return 0; - } - return -1; - } - // error or unknown command - return -1; - }; - - int GpibDevice::FindListeners(int board) - { - int listeners = 0; - if((unsigned int)board > 1) { - return -1; - } - // reset the GPIB, otherwise no connected device is found (linux) - SendIFC(board); - // list of primary addresses to searching for. Must be terminated - // with NOADDR. - Addr4882_t addrlist[31]; - // The range of valid addresses is 1...30, 0 is reservated by the - // controller, 31 is not valid - for(int i = 0;i < 30; i++) addrlist[i] = (Addr4882_t) i + 1; - addrlist[30] = NOADDR; - // place to store the results - Addr4882_t results[31]; - memset(results,0,sizeof(results)); - FindLstn(board, addrlist, results, 31); - if(ibsta & ERR) { - return -1; - } - for(int i=0;i<=30;i++) { - if(results[i]) { - listeners |= 1 << results[i]; - } - } - return listeners; - }; - - int GpibDevice::Open( const char* devname, int address ) - { - m_dcs.m_address1 = address; - - return OpenDevice( devname, &m_dcs ); - } - - - int GpibDevice::OpenDevice(const char* devname, void* dcs) - { - // if dcs isn't NULL, type cast - if(dcs) m_dcs = *(Gpib_DCS*)dcs; - - if(strncmp(devname,"gpib1",5) == 0) m_board = 0; - else if(strncmp(devname,"gpib2",5) == 0) m_board = 1; - if(m_board < 0) { - return -1; - } - // check for a valid timeout - if((unsigned int)m_dcs.m_timeout > GpibTimeout1000s) { - m_dcs.m_timeout = GpibTimeout10us; - } - - m_hd = ibdev(m_board, - m_dcs.m_address1, - m_dcs.m_address2, - m_dcs.m_timeout, - m_dcs.m_eot, -#ifdef __GNUG__ - // FIXME! - // linux-gpib-3.2.08 doesn't work with any EOS (blocks). - // Because we always has to add an EOS on the message - // (independent of the m_eosChar setting), we can ignore it! - 0 -#else - (m_dcs.m_eosMode << 8) | m_dcs.m_eosChar -#endif - ); - if(m_hd < 0) { - // no gpib controller installed (not found) - return -2; - } - // test for a connected listener (device with given address) - short int listen = 0; - ibln(m_board,m_dcs.m_address1,NO_SAD,&listen); - if(!listen) { - // no listener at the given address - CloseDevice(); - return -3; - } - // reset device - ibclr(m_hd); - // save state, error and count - m_state = ThreadIbsta(); - m_count = ThreadIbcnt(); - m_error = ThreadIberr(); - // no error - return 0; - }; - - int GpibDevice::Read(char* buf,size_t len) - { - // if something is in the fifo, first read that - if(m_fifo->items() > 0) { - return m_fifo->read(buf,len); - } - m_state = ibrd(m_hd,buf,len); - m_error = ThreadIberr(); - m_count = ThreadIbcnt(); - return m_count; - }; - - int GpibDevice::Write(char* buf,size_t len) - { - m_state = ibwrt(m_hd,buf,len); - m_error = ThreadIberr(); - m_count = ThreadIbcnt(); - return m_count; - }; - -} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/iobase.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/iobase.cpp deleted file mode 100644 index b92ba4f2d6..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/iobase.cpp +++ /dev/null @@ -1,211 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: iobase.cpp -// Purpose: -// Author: Joachim Buermann -// Id: $Id: iobase.cpp,v 1.1.1.1 2004/11/24 10:30:11 jb Exp $ -// Copyright: (c) 2001 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include -#include -#include "ctb-0.16/iobase.h" -#include "ctb-0.16/timer.h" - -namespace ctb { - -#define DELTA_BUFSIZE 512 - - int IOBase::Readv(char* buf,size_t len,unsigned int timeout_in_ms) - { - char *cp = buf; - int n = 0; - int timeout = 0; - size_t toread = len; - - Timer t(timeout_in_ms,&timeout,NULL); - if(timeout_in_ms != 0xFFFFFFFF) { - t.start(); - } - - while(!timeout && (toread > 0)) { - if((n = Read(cp,toread)) < 0) { - break; - } - if(!n) { - sleepms(1); - } - toread -= n; - cp += n; - } - // ok, all bytes received - return(len - toread); - }; - -/* - Readv() calls the member function Read() repeatedly, til all - demand bytes were received. To avoid an endless loop, you - can refer an integer, which was set unequal zero after a - specific time. (See the timer class) -*/ - int IOBase::Readv(char* buf,size_t len,int* timeout_flag,bool nice) - { - size_t toread = len; - int n = 0; - char *cp = buf; - - while(toread > 0) { - if(timeout_flag && (*timeout_flag > 0)) { - return (len - toread); - } - if((n = Read(cp,toread)) < 0) { - return (len - toread); - } - if(!n && nice) { - sleepms(1); - } - if (n > 0) - { - toread -= n; - cp += n; - } - } - // ok, all bytes received - return(len - toread); - }; - - int IOBase::ReadUntilEOS(char*& readbuf, - size_t* readedBytes, - char* eosString, - long timeout_in_ms, - char quota) - { - int n = 0; - int timeout = 0; - int bufsize = DELTA_BUFSIZE; - int result = 0; - int quoted = 0; - char* buf = new char[bufsize]; - char* des = buf; - char* eos = eosString; - char ch; - - Timer t(timeout_in_ms,&timeout,NULL); - t.start(); - - while(!timeout) { - if(des >= &buf[bufsize]) { - // buffer full, realloc more memory - char* tmp = new char[bufsize + DELTA_BUFSIZE + 1]; - memcpy(tmp,buf,bufsize); - delete[] buf; - buf = tmp; - des = &buf[bufsize]; - bufsize += DELTA_BUFSIZE; - } - // read next byte - n = Read(&ch,1); - if(n < 0) { - // an error occured - result = -1; - break; - } - else if(n == 0) { - // no data available, give up the processor for some time - // to reduce the cpu last - sleepms(10); - continue; - } - // if eos is composed of more than one char, and the current - // byte doesn't match the next eos character, we handle the - // readed byte as a normal char (and not an eos) - if((eos != eosString) && (ch != *eos)) { - // FIXME! - // write all characters, which was matched the eos string - // until now (with the first wrong character all received - // eos characters are invalid and must handled as normal - // characters). - - // This doesn't work right and is only a little workaround - // because the received eos chars are lost - PutBack(ch); - // because we doesn't match the eos string, we must 'reset' - // the eos match - eos = eosString; - continue; - } - else { - if((ch == *eos) && !quoted) { - if(*++eos == 0) { - // the eos string is complete - result = 1; - break; - } - continue; - } - } - if(ch == quota) { - quoted ^= 1; - } - *des++ = ch; - } - *des = 0; - readbuf = buf; - *readedBytes = des - buf; - return result; - }; - - int IOBase::Writev(char* buf,size_t len,unsigned int timeout_in_ms) - { - char *cp = buf; - int n = 0; - int timeout = 0; - size_t towrite = len; - - Timer t(timeout_in_ms,&timeout,NULL); - if(timeout_in_ms != 0xFFFFFFFF) { - t.start(); - } - - while(!timeout && (towrite > 0)) { - if((n = Write(cp,towrite)) < 0) { - // an error occurs - break; - } - if(!n) { - sleepms(1); - } - towrite -= n; - cp += n; - } - return (len - towrite); - }; - -/* - Similar to Readv(). Writev() calls Write() repeatedly till - all bytes are written. -*/ - int IOBase::Writev(char* buf,size_t len,int* timeout_flag,bool nice) - { - size_t towrite = len; - int n = 0; - char *cp = buf; - - while(towrite > 0) { - if(timeout_flag && (*timeout_flag > 0)) { - return (len - towrite); - } - if((n = Write(cp,towrite)) < 0) { - // an error occurs - return (len - towrite); - } - if(!n && nice) { - sleepms(1); - } - towrite -= n; - cp += n; - } - return(len); - }; - -} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/kbhit.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/kbhit.cpp deleted file mode 100644 index 4a244ea251..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/kbhit.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#if defined ( WIN32 ) -# include -#else -# include -# include -#endif - -namespace ctb { - - char GetKey() - { -#if defined ( WIN32 ) - if(_kbhit()) { - return _getch(); - } - return '\0'; -#else - int ch; - static struct termios t, save_t; - tcgetattr(0,&t); - save_t = t; - t.c_lflag &= ~(ICANON); - t.c_cc[VMIN] = 0; - t.c_cc[VTIME] = 0; - tcsetattr(0,TCSANOW,&t); - - ch = fgetc(stdin); - - tcsetattr(0,TCSANOW,&save_t); - if(ch != EOF) { - return ch; - } - return '\0'; -#endif - } - -} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/linux/serport.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/linux/serport.cpp deleted file mode 100644 index a369abc5e7..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/linux/serport.cpp +++ /dev/null @@ -1,443 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: linux/serport.cpp -// Purpose: -// Author: Joachim Buermann -// Id: $Id: serport.cpp,v 1.1.1.1 2004/11/24 10:30:11 jb Exp $ -// Copyright: (c) 2001 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "ctb-0.16/linux/serport.h" - -#include -#include -#include -#include -#include -#include -#include - -#define CMSPAR 010000000000 /* mark or space (stick) parity */ - -namespace ctb { - - const char* COM1 = "/dev/ttyS0"; - const char* COM2 = "/dev/ttyS1"; - const char* COM3 = "/dev/ttyS2"; - const char* COM4 = "/dev/ttyS3"; - const char* COM5 = "/dev/ttyS4"; - const char* COM6 = "/dev/ttyS5"; - const char* COM7 = "/dev/ttyS6"; - const char* COM8 = "/dev/ttyS7"; - const char* COM9 = "/dev/ttyS8"; - const char* COM10 = "/dev/ttyS9"; - const char* COM11= "/dev/ttyS10"; - const char* COM12= "/dev/ttyS11"; - const char* COM13 = "/dev/ttyS12"; - const char* COM14 = "/dev/ttyS13"; - const char* COM15 = "/dev/ttyS14"; - const char* COM16 = "/dev/ttyS15"; - const char* COM17 = "/dev/ttyS16"; - const char* COM18 = "/dev/ttyS17"; - const char* COM19 = "/dev/ttyS18"; - const char* COM20 = "/dev/ttyS19"; - - SerialPort::SerialPort() : - SerialPort_x() - { - fd = -1; - }; - - SerialPort::~SerialPort() - { - Close(); - }; - - speed_t SerialPort::AdaptBaudrate( int baud ) - { - switch(baud) { - case 150: return B150; - case 300: return B300; - case 600: return B600; - case 1200: return B1200; - case 2400: return B2400; - case 4800: return B4800; - case 9600: return B9600; - case 19200: return B19200; - case 57600: return B57600; - case 115200: return B115200; - case 230400: return B230400; - case 460800: return B460800; - case 921600: return B921600; - - // NOTE! The speed of 38400 is required, if you want to set - // an non-standard baudrate. See below! - default: return B38400; - } - }; - - int SerialPort::CloseDevice() - { - int err = 0; - // only close an open file handle - if(fd < 0) return EBADF; - // With some systems, it is recommended to flush the serial port's - // Output before closing it, in order to avoid a possible hang of - // the process... - // Thanks to Germain (I couldn't answer you, because your email - // address was invalid) - tcflush(fd, TCOFLUSH); - - // Don't recover the orgin settings while the device is open. This - // implicate a mismatched data output! - // Just close device - err = close( fd ); - - fd = -1; - - return err; - }; - - int SerialPort::ChangeLineState( SerialLineState flags ) - { - int state; - ioctl(fd,TIOCMGET,&state); - state ^= flags; - return ioctl(fd,TIOCMSET,&state); - }; - - int SerialPort::ClrLineState( SerialLineState flags ) - { - return ioctl(fd,TIOCMBIC,&flags); - }; - - int SerialPort::GetLineState() - { - SerialLineState flags = LinestateNull; - - if( ioctl( fd, TIOCMGET, &flags ) < 0 ) { - - return -1; - - } - return (int)( flags & 0x1FF ); - }; - -// -// included from /usr/include/linux/serial.h -// -// struct serial_icounter_struct { -// int cts, dsr, rng, dcd; -// int rx, tx; -// int frame, overrun, parity, brk; -// int buf_overrun; -// int reserved[9]; -// }; -// - int SerialPort::Ioctl(int cmd, void* args) - { - int count = 0; - int err = 0; - struct serial_icounter_struct info; - SerialPort_EINFO einfo; - - switch(cmd) { - case CTB_RESET: - return SendBreak(0); - case CTB_SER_GETEINFO: - err = ioctl(fd,TIOCGICOUNT,&info); - if(err) return err; - einfo.brk = info.brk - save_info.brk; - einfo.frame = info.frame - save_info.frame; - einfo.overrun = info.overrun - save_info.overrun; - einfo.parity = info.parity - save_info.parity; - *(SerialPort_EINFO*)args = einfo; - break; - case CTB_SER_GETBRK: - err = ioctl(fd,TIOCGICOUNT,&info); - if(err) return err; - if(last_info.brk != info.brk) count = 1; - break; - case CTB_SER_GETFRM: - err = ioctl(fd,TIOCGICOUNT,&info); - if(err) return err; - if(last_info.frame != info.frame) count = 1; - break; - case CTB_SER_GETOVR: - err = ioctl(fd,TIOCGICOUNT,&info); - if(err) return err; - if(last_info.overrun != info.overrun) count = 1; - break; - case CTB_SER_GETPAR: - err = ioctl(fd,TIOCGICOUNT,&info); - if(err) return err; - if(last_info.parity != info.parity) count = 1; - break; - case CTB_SER_GETINQUE: - err = ioctl(fd,TIOCINQ,&count); - if(err) return err; - *(int*)args = count; - return 0; - case CTB_SER_SETPAR: - return SetParityBit( *(int*)args == 1 ); - default: - return -1; - } - last_info = info; - return 0; - }; - - int SerialPort::IsOpen() - { - return (fd != -1); - }; - - int SerialPort::OpenDevice(const char* devname, void* dcs) - { - // if dcs isn't NULL, type cast - if(dcs) m_dcs = *(SerialPort_DCS*)dcs; - // open serial comport device for reading and writing, - // don't wait (O_NONBLOCK) - fd = open(devname, O_RDWR | O_NOCTTY | O_NONBLOCK); - if(fd >= 0) { - - // exclusive use - int dummy; - - ioctl( fd, TIOCEXCL, &dummy ); - - tcgetattr(fd,&t); - save_t = t; - - // save the device name - strncpy(m_devname,(char*)devname,sizeof(m_devname)); - // we write an eos to avoid a buffer overflow - m_devname[sizeof(m_devname)-1] = '\0'; - - // Fill the internal terios struct. - // If the given baudrate is an non-standard one, the AdaptBaudrate - // call returns the linux specific value B38400 which is a - // condition for the later switch to an unusual baudrate! - cfsetspeed(&t, AdaptBaudrate( m_dcs.baud ) ); - - //cfsetospeed(&t, AdaptBaudrate( m_dcs.baud ) ); - - // parity settings - switch( m_dcs.parity ) { - - case ParityNone: - t.c_cflag &= ~PARENB; break; - - case ParityOdd: - t.c_cflag |= PARENB; - t.c_cflag |= PARODD; - break; - - case ParityEven: - t.c_cflag |= PARENB; - t.c_cflag &= ~PARODD; - break; - - case ParityMark: - t.c_cflag |= PARENB | CMSPAR | PARODD; - break; - - case ParitySpace: - t.c_cflag |= PARENB | CMSPAR; - t.c_cflag &= ~PARODD; - break; - } - - // stopbits - if(m_dcs.stopbits == 2) - t.c_cflag |= CSTOPB; - else - t.c_cflag &= ~CSTOPB; - // wordlen - t.c_cflag &= ~CSIZE; - if(m_dcs.wordlen == 7) t.c_cflag |= CS7; - else if(m_dcs.wordlen == 6) t.c_cflag |= CS6; - else if(m_dcs.wordlen == 5) t.c_cflag |= CS5; - // this is the default - else t.c_cflag |= CS8; - // rts/cts - if(m_dcs.rtscts == false) - t.c_cflag &= ~CRTSCTS; - else - t.c_cflag |= CRTSCTS; - - t.c_lflag &= ~(ICANON | ECHO | ISIG | IEXTEN); - t.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON | IXOFF | IXANY); - t.c_iflag |= IGNPAR; - t.c_oflag &= ~OPOST; - - if(m_dcs.xonxoff == true) { - t.c_iflag |= (IXON | IXOFF); - } - - // look out! - // MIN = 1 means, in TIME (1/10 secs) defined timeout - // will be started AFTER receiving the first byte - // so we must set MIN = 0. (timeout starts immediately, abort - // also without readed byte) - t.c_cc[VMIN] = 0; - // timeout in 1/10 secs - // no timeout for non blocked transfer - t.c_cc[VTIME] = 0; - // write the settings - tcsetattr(fd,TCSANOW,&t); - // it's careless, but in the moment we don't test - // the return of tcsetattr (normally there is no error) - - // request the actual numbers of breaks, framing, overrun - // and parity errors (because Linux summing all of them during - // system lifetime, not only while serial port is open. - ioctl(fd,TIOCGICOUNT,&save_info); - // it's also careless, but we assume, that there was no error - last_info = save_info; - - // in case of a non-standard rate, the termios struct have to set - // with the B38400 rate, see above! - if( ! IsStandardRate( m_dcs.baud ) ) { - - SetBaudrateAny( m_dcs.baud ); - - } - } - return fd; - }; - - int SerialPort::Read(char* buf,size_t len) - { - if(m_fifo->items() > 0) { - return m_fifo->read(buf,len); - } - // Read() (using read() ) will return an 'error' EAGAIN as it is - // set to non-blocking. This is not a true error within the - // functionality of Read, and thus should be handled by the caller. - int n = read(fd,buf,len); - if((n < 0) && (errno == EAGAIN)) return 0; - return n; - }; - - int SerialPort::SendBreak(int duration) - { - // the parameter is equal with linux - return tcsendbreak(fd,duration); - }; - - /* - Note: The following hints are copied from the ftdi_sio.c sources of - the kernel modul for the USB to RS232 converter using an FTDI - chipset (FT232BM or similar). Thanks to all those people - contribute code and above all helpful comments to this modul. - */ - - /* - * The logic involved in setting the baudrate can be cleanly split in 3 steps. - * Obtaining the actual baud rate is a little tricky since unix traditionally - * somehow ignored the possibility to set non-standard baud rates. - * 1. Standard baud rates are set in tty->termios->c_cflag - * 2. If these are not enough, you can set any speed using alt_speed as - * follows: - * - set tty->termios->c_cflag speed to B38400 - * - set your real speed in tty->alt_speed; it gets ignored when - * alt_speed==0, (or) - * - call TIOCSSERIAL ioctl with (struct serial_struct) set as follows: - * flags & ASYNC_SPD_MASK == ASYNC_SPD_[HI, VHI, SHI, WARP], this just - * sets alt_speed to (HI: 57600, VHI: 115200, SHI: 230400, WARP: 460800) - * ** Steps 1, 2 are done courtesy of tty_get_baud_rate - * 3. You can also set baud rate by setting custom divisor as follows - * - set tty->termios->c_cflag speed to B38400 - * - call TIOCSSERIAL ioctl with (struct serial_struct) set as follows: - * o flags & ASYNC_SPD_MASK == ASYNC_SPD_CUST - * o custom_divisor set to baud_base / your_new_baudrate - * ** Step 3 is done courtesy of code borrowed from serial.c - I should really - * spend some time and separate+move this common code to serial.c, it is - * replicated in nearly every serial driver you see. - */ - - int SerialPort::SetBaudrateAny( int baudrate ) - { - struct serial_struct ser_info; - - int result = ioctl( fd, TIOCGSERIAL, &ser_info ); - - ser_info.flags = ASYNC_SPD_CUST | ASYNC_LOW_LATENCY; - - ser_info.custom_divisor = ser_info.baud_base / baudrate; - - result = ioctl( fd, TIOCSSERIAL, &ser_info ); - - return result; - } - - int SerialPort::SetBaudrateStandard( int baudrate ) - { - speed_t baud = AdaptBaudrate( baudrate ); - // setting the input baudrate - if(cfsetspeed(&t,baud) < 0) { - return -1; - } - // take over - m_dcs.baud = baudrate; - - tcsetattr(fd,TCSANOW,&t); - - return tcgetattr( fd, &t ); - - }; - - int SerialPort::SetBaudrate( int baudrate ) - { - return IsStandardRate( baudrate ) ? - SetBaudrateStandard( baudrate ) : - SetBaudrateAny( baudrate ); - - } - - int SerialPort::SetLineState( SerialLineState flags ) - { - return ioctl(fd,TIOCMBIS,&flags); - }; - - int SerialPort::SetParityBit( bool parity ) - { - // waits until all output has been transmitted - tcdrain( fd ); - - // now read the current termios settings and manipulate - // the parity - tcgetattr( fd, &t ); - - if( parity ) { - - t.c_cflag |= PARENB | CMSPAR | PARODD; - - } - else { - - t.c_cflag |= PARENB | CMSPAR; - - t.c_cflag &= ~PARODD; - - } - - tcsetattr( fd,TCSANOW, &t ); - - tcgetattr( fd, &t ); - - return 0; - } - - int SerialPort::Write(char* buf,size_t len) - { - // Write() (using write() ) will return an 'error' EAGAIN as it is - // set to non-blocking. This is not a true error within the - // functionality of Write, and thus should be handled by the caller. - int n = write(fd,buf,len); - if((n < 0) && (errno == EAGAIN)) return 0; - return n; - }; - -} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/linux/timer.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/linux/timer.cpp deleted file mode 100644 index f1c50f613b..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/linux/timer.cpp +++ /dev/null @@ -1,97 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: linux/timer.cpp -// Purpose: -// Author: Joachim Buermann -// Id: $Id: timer.cpp,v 1.1.1.1 2004/11/24 10:30:11 jb Exp $ -// Copyright: (c) 2001 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -#include "ctb-0.16/timer.h" -#include - -namespace ctb { - -// a dummy function, see below - static void timer_exit(void* arg) - { - }; - - static void* timer_fnc(void* arg) - { - // the timer thread should be canceled every time - // (asyncronously) - pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS,NULL); - // this is tricky, but absolutly necessarily to avoid segfaults - // if the destructor finished a running thread - pthread_cleanup_push(timer_exit,NULL); - timer_control *tc = (timer_control*)arg; - // linux allows a real sleep, means the timer thread will - // be sleeping (no reduce of the system performance) - usleep(tc->usecs); - // time is over, system reawake the thread. - // if there is an exit function, calling it - if(tc->exitfnc) tc->exitfnc(NULL); - // set the exit flag - if(tc->exitflag) *tc->exitflag = 1; - // deallocate the system resources (thread) - pthread_cleanup_pop(1); - return NULL; - }; - - // the constructor initiate the internal control struct - Timer::Timer( unsigned int msecs, int* exitflag, void*( *exitfnc )(void*) ) - { - control.usecs = msecs * 1000; - control.exitflag = exitflag; - control.exitfnc = exitfnc; - stopped = 1; - }; - - // if a timer instance leave it's valid range, it automaticaly will - // be finished - Timer::~Timer() - { - if(!stopped) { - // only a running thread may be canceled - stop(); - } - }; - - // starts the timer thread - int Timer::start() - { - stopped = 0; - if(pthread_create(&tid, // result parameter, covers the id - // of the new threads - NULL, // thread attribute object, NULL means - // the defaults - timer_fnc, // start function of the thread - &control // start function parameter, must refer - // as void* - ) == -1) { - return -1; // there was something going wrong - } - pthread_detach(tid); // thread status must be "detach". In the other - // case, the destructor call of a running - // thread throws a segfault - return 0; - }; - - // stop the timer thread - int Timer::stop() - { - if(control.exitflag && (*control.exitflag == 0)) { - pthread_cancel(tid); - } - stopped = 1; - return 0; - }; - - void sleepms(unsigned int ms) - { - usleep(ms * 1000); - }; - -} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/portscan.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/portscan.cpp deleted file mode 100644 index f13766e9fa..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/portscan.cpp +++ /dev/null @@ -1,109 +0,0 @@ -#include "ctb-0.16/ctb.h" -#include "ctb-0.16/portscan.h" - -#include - -#ifndef _WIN32 -# include -#endif - -namespace ctb { - - bool GetAvailablePorts( std::vector& result, - bool checkInUse ) - { -#ifdef _WIN32 - - std::stringstream devname; - - for( int i = 1; i < 100; i++ ) { - - devname.clear(); devname.str( "" ); - - // some systems like WinCE doesn't like the extended port numbering... - i < 10 ? devname << "com" << i : devname << "\\\\.\\com" << i; - - COMMCONFIG cc; - - DWORD dwSize = sizeof( cc ); - - if ( ::GetDefaultCommConfig( devname.str().c_str(), &cc, &dwSize ) ) { - - if( cc.dwProviderSubType == PST_RS232 ) { - - ctb::SerialPort com; - - if( com.Open( devname.str().c_str() ) < 0 ) { - - continue; - - } - - result.push_back( devname.str().c_str() ); - - } - } - } - -#else - glob_t globbuf; - - // search for standard serial ports - int res = glob( "/dev/ttyS*", GLOB_ERR, NULL, &globbuf ); - - if( res == 0 ) { - - // no error, glob was successful - for( int i = 0; i < globbuf.gl_pathc; i++ ) { - - if( checkInUse ) { - - ctb::SerialPort com; - - if( com.Open( globbuf.gl_pathv[ i ] ) < 0 ) { - - continue; - - } - - result.push_back( std::string( globbuf.gl_pathv[ i ] ) ); - - } - } - - } - globfree( &globbuf ); - - // search for USB to RS232 converters - res = glob( "/dev/ttyUSB*", GLOB_ERR, NULL, &globbuf ); - - if( res == 0 ) { - - // no error, glob was successful - for( int i = 0; i < globbuf.gl_pathc; i++ ) { - - if( checkInUse ) { - - ctb::SerialPort com; - - if( com.Open( globbuf.gl_pathv[ i ] ) < 0 ) { - - continue; - - } - - result.push_back( std::string( globbuf.gl_pathv[ i ] ) ); - - } - } - - } - - globfree( &globbuf ); -#endif - - return result.size(); - - } - -} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/serportx.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/serportx.cpp deleted file mode 100644 index c59bcc002f..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/serportx.cpp +++ /dev/null @@ -1,104 +0,0 @@ -#include "ctb-0.16/serportx.h" - -#include - -namespace ctb { - - int SerialPort_x::Open( const char* portname, int baudrate, - const char* protocol, - FlowControl flowControl ) - { - SerialPort_DCS dcs; - - dcs.baud = baudrate; - - // default wordlen is 8 - if( ( protocol[ 0 ] >= '5' ) && ( protocol[ 0 ] <= '8' )) { - - dcs.wordlen = protocol[ 0 ] - '0'; - - } - else { - - return -1; - - } - - // protocol is given as a string like "8N1", the first - // character specifies the data bits (5...8), the second - // the parity (None,Odd,Even,Mark,Space). - // The third character defines the stopbit (1...2). - switch( protocol[ 1 ] ) { - case 'N': case 'n': dcs.parity = ParityNone; break; - case 'O': case 'o': dcs.parity = ParityOdd; break; - case 'E': case 'e': dcs.parity = ParityEven; break; - case 'M': case 'm': dcs.parity = ParityMark; break; - case 'S': case 's': dcs.parity = ParitySpace; break; - // all other parameters cause an error! - default: return -1; - } - // default stopbits is 1 - if( ( protocol[ 2 ] >= '1' ) && ( protocol[ 2 ] <= '2' )) { - - dcs.stopbits = protocol[ 2 ] - '0'; - - } - else { - - return -1; - - } - // default flow control is disabled - dcs.rtscts = ( flowControl == RtsCtsFlowControl ); - - dcs.xonxoff = ( flowControl == XonXoffFlowControl ); - - // save the settings in the internal dcs for later use - m_dcs = dcs; - - return OpenDevice( portname, &m_dcs ); - - } - - int SerialPort_x::Open( const int portnumber, int baudrate, - const char* protocol, - FlowControl flowControl ) - { - // portnumbers start with 1 - if( portnumber < 1 ) { - - return -1; - - } - std::stringstream devname; - -#if defined ( WIN32 ) - // some systems like WinCE doesn't like the extended port numbering... - portnumber < 10 ? devname << "com" << portnumber : - devname << "\\\\.\\com" << portnumber; -#else - devname << "/dev/ttyS" << ( portnumber - 1 ); -#endif - - return Open( devname.str().c_str(), baudrate, protocol, flowControl ); - } - - bool SerialPort_x::IsStandardRate( int rate ) - { - const int rates[] = { - 150, 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, - 115200, 230400, 460800, 921600 - }; - - for( unsigned int i = 0; i < ( sizeof( rates ) / sizeof( int ) ); i++ ) { - - if( rate == rates[ i ] ) { - - return true; - - } - } - return false; - } - -} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/getopt.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/getopt.cpp deleted file mode 100644 index c8454b9bde..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/getopt.cpp +++ /dev/null @@ -1,66 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: win32/getopt.cpp -// Purpose: -// Author: unknown, I found it in the internet -// Id: $Id: getopt.cpp,v 1.1.1.1 2004/11/24 10:30:11 jb Exp $ -// Copyright: (c) 2001 ? -// Licence: (I think Open Source) -///////////////////////////////////////////////////////////////////////////// - -#include -#include - -char *optarg; /* Global argument pointer. */ -int optind = 0; /* Global argv index. */ - -static char *scan = NULL; /* Private scan pointer. */ - -/* found char, or NULL if none */ -static char *index(const char* s,char charwanted) -{ - return(strchr((char*)s, charwanted)); -} - -int getopt(int argc, char* argv[], char* optstring) -{ - register char c; - register char *place; - - optarg = NULL; - - if (scan == NULL || *scan == '\0') { - if (optind == 0) - optind++; - - if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0') - return(EOF); - if (strcmp(argv[optind], "--")==0) { - optind++; - return(EOF); - } - - scan = argv[optind]+1; - optind++; - } - - c = *scan++; - place = index(optstring, c); - - if (place == NULL || c == ':') { - fprintf(stderr, "%s: unknown option -%c\n", argv[0], c); - return('?'); - } - - place++; - if (*place == ':') { - if (*scan != '\0') { - optarg = scan; - scan = NULL; - } else { - optarg = argv[optind]; - optind++; - } - } - - return(c); -} diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/serport.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/serport.cpp deleted file mode 100644 index 23b50ab32b..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/serport.cpp +++ /dev/null @@ -1,452 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: serport.cpp -// Purpose: -// Author: Joachim Buermann -// Id: $Id: serport.cpp,v 1.1.1.1 2004/11/24 10:30:11 jb Exp $ -// Copyright: (c) 2001 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include -#include "ctb-0.16/serport.h" - -#define SERIALPORT_BUFSIZE 4096 - -namespace ctb { - - const char* COM1 = "com1"; - const char* COM2 = "com2"; - const char* COM3 = "com3"; - const char* COM4 = "com4"; - const char* COM5 = "com5"; - const char* COM6 = "com6"; - const char* COM7 = "com7"; - const char* COM8 = "com8"; - const char* COM9 = "com9"; - const char* COM10 = "\\\\.\\com10"; - const char* COM11 = "\\\\.\\com11"; - const char* COM12 = "\\\\.\\com12"; - const char* COM13 = "\\\\.\\com13"; - const char* COM14 = "\\\\.\\com14"; - const char* COM15 = "\\\\.\\com15"; - const char* COM16 = "\\\\.\\com16"; - const char* COM17 = "\\\\.\\com17"; - const char* COM18 = "\\\\.\\com18"; - const char* COM19 = "\\\\.\\com19"; - const char* COM20 = "\\\\.\\com20"; - - SerialPort::SerialPort() - { - memset( &m_ov, 0, sizeof( OVERLAPPED ) ); - fd = INVALID_HANDLE_VALUE; - m_rtsdtr_state = LinestateNull; - }; - - SerialPort::~SerialPort() - { - Close(); - }; - - int SerialPort::CloseDevice() - { - if(fd != INVALID_HANDLE_VALUE) { - CloseHandle(m_ov.hEvent); - CloseHandle(fd); - fd = INVALID_HANDLE_VALUE; - } - return 0; - }; - - int SerialPort::ChangeLineState( SerialLineState flags ) - { - bool ok = false; - if(flags & LinestateDtr) { - if(m_rtsdtr_state & LinestateDtr) { - ok = EscapeCommFunction(fd,CLRDTR); - } - else { - ok = EscapeCommFunction(fd,SETDTR); - } - m_rtsdtr_state ^= LinestateDtr; - } - if(flags & LinestateRts) { - if(m_rtsdtr_state & LinestateRts) { - ok = EscapeCommFunction(fd,CLRRTS); - } - else { - ok = EscapeCommFunction(fd,SETRTS); - } - m_rtsdtr_state ^= LinestateRts; - } - if(!ok) return -1; - return 0; - }; - - int SerialPort::ClrLineState( SerialLineState flags ) - { - BOOL ok = false; - if(flags & LinestateDtr) { - ok = EscapeCommFunction(fd,CLRDTR); - m_rtsdtr_state &= ~LinestateDtr; - } - if(flags & LinestateRts) { - ok = EscapeCommFunction(fd,CLRRTS); - m_rtsdtr_state &= ~LinestateRts; - } - if(!ok) return -1; - return 0; - }; - - int SerialPort::GetLineState() - { - BOOL ok = false; - DWORD stat; - int flags = 0; - if(GetCommModemStatus(fd,&stat)) { - if(stat & MS_CTS_ON) - flags |= LinestateCts; - if(stat & MS_DSR_ON) - flags |= LinestateDsr; - if(stat & MS_RING_ON) - flags |= LinestateRing; - if(stat & MS_RLSD_ON) - flags |= LinestateDcd; - ok = true; - } - if(!ok) return -1; - return flags; - }; - - int SerialPort::Ioctl(int cmd,void* args) - { - COMSTAT comstat; - DWORD errors; - int result = 0; - bool brk; - switch(cmd) { - case CTB_RESET: - return SendBreak(0); - case CTB_SER_GETEINFO: - if(ClearCommError(fd,&errors,&comstat)) { - // actualize the last events - if(errors & CE_BREAK) einfo.brk++; - if(errors & CE_FRAME) einfo.frame++; - if(errors & CE_OVERRUN) einfo.overrun++; - if(errors & CE_RXPARITY) einfo.parity++; - *(SerialPort_EINFO*)args = einfo; - return 0; - } - case CTB_SER_GETBRK: - if(ClearCommError(fd,&errors,&comstat)) { - if(errors & CE_BREAK) result = 1; - einfo.brk += result; - *(int*)args = result; - return 0; - } - break; - case CTB_SER_GETFRM: - if(ClearCommError(fd,&errors,&comstat)) { - if(errors & CE_FRAME) result = 1; - einfo.frame += result; - *(int*)args = result; - return 0; - } - case CTB_SER_GETOVR: - if(ClearCommError(fd,&errors,&comstat)) { - if(errors & CE_OVERRUN) result = 1; - einfo.overrun += result; - *(int*)args = result; - return 0; - } - break; - case CTB_SER_GETPAR: - if(ClearCommError(fd,&errors,&comstat)) { - if(errors & CE_RXPARITY) result = 1; - einfo.parity += result; - *(int*)args = result; - return 0; - } - break; - case CTB_SER_GETINQUE: - if(ClearCommError(fd,&errors,&comstat)) { - *(int*)args = (int)comstat.cbInQue; - return 0; - } - break; - case CTB_SER_SETPAR: - return SetParityBit( *(int*)args == 1 ); - } - // error or unknown command - return -1; - }; - - int SerialPort::IsOpen() - { - return (fd != INVALID_HANDLE_VALUE); - }; - - int SerialPort::OpenDevice(const char* devname, void* dcs) - { - // if dcs isn't NULL, type cast - if(dcs) m_dcs = *(SerialPort_DCS*)dcs; - - fd = CreateFile(devname, // device name - GENERIC_READ | GENERIC_WRITE, // O_RDWR - 0, // not shared - NULL, // default value for object security ?!? - OPEN_EXISTING, // file (device) exists - FILE_FLAG_OVERLAPPED, // asynchron handling - NULL); // no more handle flags - - if(fd == INVALID_HANDLE_VALUE) { - return -1; - } - // save the device name - strncpy(m_devname,(char*)devname,sizeof(m_devname)); - // we write an eos to avoid a buffer overflow - m_devname[sizeof(m_devname)-1] = '\0'; - - // device control block - DCB dcb; - memset(&dcb,0,sizeof(dcb)); - dcb.DCBlength = sizeof(dcb); - dcb.BaudRate = m_dcs.baud; - dcb.fBinary = 1; - - m_rtsdtr_state = LinestateNull; - - // Specifies whether the CTS (clear-to-send) signal is monitored - // for output flow control. If this member is TRUE and CTS is turned - // off, output is suspended until CTS is sent again. - dcb.fOutxCtsFlow = m_dcs.rtscts; - - // Specifies the DTR (data-terminal-ready) flow control. - // This member can be one of the following values: - // DTR_CONTROL_DISABLE Disables the DTR line when the device is - // opened and leaves it disabled. - // DTR_CONTROL_ENABLE Enables the DTR line when the device is - // opened and leaves it on. - // DTR_CONTROL_HANDSHAKE Enables DTR handshaking. If handshaking is - // enabled, it is an error for the application - // to adjust the line by using the - // EscapeCommFunction function. - dcb.fDtrControl = DTR_CONTROL_DISABLE; - m_rtsdtr_state |= LinestateDtr; - // Specifies the RTS flow control. If this value is zero, the - // default is RTS_CONTROL_HANDSHAKE. This member can be one of - // the following values: - // RTS_CONTROL_DISABLE Disables the RTS line when device is - // opened and leaves it disabled. - // RTS_CONTROL_ENABLED Enables the RTS line when device is - // opened and leaves it on. - // RTS_CONTROL_HANDSHAKE Enables RTS handshaking. The driver - // raises the RTS line when the - // "type-ahead" (input)buffer is less than - // one-half full and lowers the RTS line - // when the buffer is more than three-quarters - // full. If handshaking is enabled, it is an - // error for the application to adjust the - // line by using the EscapeCommFunction function. - // RTS_CONTROL_TOGGLE Specifies that the RTS line will be high if - // bytes are available for transmission. After - // all buffered bytes have been send, the RTS - // line will be low. - if(m_dcs.rtscts) dcb.fRtsControl = RTS_CONTROL_HANDSHAKE; - else { - dcb.fRtsControl = RTS_CONTROL_DISABLE; - m_rtsdtr_state |= LinestateRts; - } - // Specifies the XON/XOFF flow control. - // If fOutX is true (the default is false), transmission stops when the - // XOFF character is received and starts again, when the XON character - // is received. - dcb.fOutX = m_dcs.xonxoff; - // If fInX is true (default is false), the XOFF character is sent when - // the input buffer comes within XoffLim bytes of being full, and the - // XON character is sent, when the input buffer comes within XonLim - // bytes of being empty. - dcb.fInX = m_dcs.xonxoff; - // default character for XOFF is 0x13 (hex 13) - dcb.XoffChar = 0x13; - // default character for XON is 0x11 (hex 11) - dcb.XonChar = 0x11; - // set the minimum number of bytes allowed in the input buffer before - // the XON character is sent (3/4 of full size) - dcb.XonLim = (SERIALPORT_BUFSIZE >> 2) * 3; - // set the maximum number of free bytes in the input buffer, before the - // XOFF character is sent (3/4 of full size) - dcb.XoffLim = (SERIALPORT_BUFSIZE >> 2) * 3; - - // parity - switch( m_dcs.parity ) { - - case ParityOdd: dcb.Parity = ODDPARITY; break; - case ParityEven: dcb.Parity = EVENPARITY; break; - case ParityMark: dcb.Parity = MARKPARITY; break; - case ParitySpace: dcb.Parity = SPACEPARITY; break; - default: dcb.Parity = NOPARITY; - - } - // stopbits - if(m_dcs.stopbits == 2) dcb.StopBits = TWOSTOPBITS; - else dcb.StopBits = ONESTOPBIT; - // wordlen, valid values are 5,6,7,8 - dcb.ByteSize = m_dcs.wordlen; - - if(!SetCommState(fd,&dcb)) - return -2; - - // create event for overlapped I/O - // we need a event object, which inform us about the - // end of an operation (here reading device) - m_ov.hEvent = CreateEvent(NULL,// LPSECURITY_ATTRIBUTES lpsa - TRUE, // BOOL fManualReset - TRUE, // BOOL fInitialState - NULL); // LPTSTR lpszEventName - if(m_ov.hEvent == INVALID_HANDLE_VALUE) { - return -3; - } - - /* THIS IS OBSOLETE!!! - // event should be triggered, if there are some received data - if(!SetCommMask(fd,EV_RXCHAR)) - return -4; - */ - - COMMTIMEOUTS cto = {MAXDWORD,0,0,0,0}; - if(!SetCommTimeouts(fd,&cto)) - return -5; - - // for a better performance with win95/98 I increased the internal - // buffer to SERIALPORT_BUFSIZE (normal size is 1024, but this can - // be a little bit to small, if you use a higher baudrate like 115200) - if(!SetupComm(fd,SERIALPORT_BUFSIZE,SERIALPORT_BUFSIZE)) - return -6; - - // clear the internal error struct - memset(&einfo,0,sizeof(einfo)); - return 0; - }; - - int SerialPort::Read(char* buf,size_t len) - { - DWORD read; - int m = m_fifo->items(); - while(len) { - if(m_fifo->get(buf) == 1) { - len--; - buf++; - } - else { - break; - } - } - if(!ReadFile(fd,buf,len,&read,&m_ov)) { - // if we use a asynchrone reading, ReadFile gives always - // FALSE - // ERROR_IO_PENDING means ok, other values show an error - if(GetLastError() != ERROR_IO_PENDING) { - // oops..., error in communication - return -1; - } - } - else { - // ok, we have read all wanted bytes - return (int)read + m; - } - return 0; - }; - - int SerialPort::SendBreak(int duration) - { - if(duration <= 0) duration = 1; - if(!SetCommBreak(fd)) return -1; - // win32 Sleep parameter is ms - Sleep(duration * 250); - if(!ClearCommBreak(fd)) return -1; - // no error - return 0; - }; - -/* - FIXME! : We need some additional code to check the success of the - baudrate modulation (non-standard rates depend on the used - UART chipset). -*/ - int SerialPort::SetBaudrate( int baudrate ) - { - DCB dcb; - - // get the current dcb... - if(!GetCommState(fd,&dcb)) { - return -1; - } - dcb.BaudRate = baudrate; - // and write it back - if(!SetCommState(fd,&dcb)) { - return -1; - } - m_dcs.baud = baudrate; - return 0; - } - - int SerialPort::SetLineState( SerialLineState flags ) - { - BOOL ok = false; - if(flags & LinestateDtr) { - ok = EscapeCommFunction(fd,SETDTR); - // save the new state - m_rtsdtr_state |= LinestateDtr; - } - if(flags & LinestateRts) { - ok = EscapeCommFunction(fd,SETRTS); - // save the new state - m_rtsdtr_state |= LinestateRts; - } - if(!ok) return -1; - return 0; - }; - - int SerialPort::SetParityBit( bool parity ) - { - DCB dcb; - - if( ! GetCommState( fd, &dcb ) ) { - - return -1; - - } - - parity ? dcb.Parity = MARKPARITY : dcb.Parity = SPACEPARITY; - - if( ! SetCommState( fd, &dcb ) ) { - - return -2; - - } - return 0; - } - - int SerialPort::Write(char* buf,size_t len) - { - DWORD write; - if(!WriteFile(fd,buf,len,&write,&m_ov)) { - if(GetLastError() != ERROR_IO_PENDING) { - return -1; - } - else { - // VERY IMPORTANT to flush the data out of the internal - // buffer - FlushFileBuffers(fd); - // first you must call GetOverlappedResult, then you - // get the REALLY transmitted count of bytes - if(!GetOverlappedResult(fd,&m_ov,&write,TRUE)) { - // ooops... something is going wrong - return (int)write; - } - } - } - return write; - }; - -} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/timer.cpp b/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/timer.cpp deleted file mode 100644 index 617aa5b5ad..0000000000 --- a/src/mod/endpoints/mod_gsmopen/libctb-0.16/src/win32/timer.cpp +++ /dev/null @@ -1,85 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: win32/timer.cpp -// Purpose: -// Author: Joachim Buermann -// Id: $Id: timer.cpp,v 1.2 2004/11/30 12:39:17 jb Exp $ -// Copyright: (c) 2001 Joachim Buermann -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include -#include - -#ifdef WIN32 -#include -# ifndef DWORD_PTR -# define DWORD_PTR DWORD* -# endif -#endif - -#include "ctb-0.16/timer.h" - -namespace ctb { - - static void WINAPI timer_fnc(UINT uTimerID, - UINT uMsg, - DWORD_PTR dwUser, - DWORD_PTR dw1, - DWORD_PTR dw2) - { - timer_control *tc = (timer_control*)dwUser; - - if(tc->exitfnc) tc->exitfnc(NULL); - if(tc->exitflag) *tc->exitflag = 1; - tc->stop = 0; - }; - - Timer::Timer(unsigned int msecs,int* exitflag,void*(*exitfnc)(void*)) - { - control.msecs = msecs; - if(!control.msecs) control.msecs = 1; - control.exitflag = exitflag; - control.exitfnc = exitfnc; - control.stop = 0; - }; - - Timer::~Timer() - { - stop(); // stop the thread - }; - - int Timer::start() - { - stop(); - control.stop = timeSetEvent(control.msecs, - (control.msecs > 10) ? 5 : 1, - (LPTIMECALLBACK) timer_fnc, - (DWORD) &control, - TIME_ONESHOT | TIME_CALLBACK_FUNCTION); - return 0; - }; - - int Timer::stop() - { - if (control.stop) - timeKillEvent(control.stop); - control.stop = 0; - return 0; - }; - - void kill_all_timer() - { - }; - - void sleepms(unsigned int ms) - { - // set the granularity of Sleep() for the application, that - // calls it so Sleep(1) will truly sleep for just a millisecond, - // rather than the default 10! - // See: http://www.geisswerks.com/ryan/FAQS/timing.html - timeBeginPeriod(1); - SleepEx(ms,false); - timeEndPeriod(1); - }; - -} // namespace ctb diff --git a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.2017.vcxproj b/src/mod/endpoints/mod_gsmopen/mod_gsmopen.2017.vcxproj deleted file mode 100644 index 2904f57a85..0000000000 --- a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.2017.vcxproj +++ /dev/null @@ -1,172 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - mod_gsmopen - {74B120FF-6935-4DFE-A142-CDB6BEA99C90} - mod_skypiax - Win32Proj - - - - DynamicLibrary - MultiByte - $(DefaultPlatformToolset) - - - DynamicLibrary - MultiByte - $(DefaultPlatformToolset) - - - DynamicLibrary - MultiByte - $(DefaultPlatformToolset) - - - DynamicLibrary - MultiByte - $(DefaultPlatformToolset) - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - false - - - - gsmlib\gsmlib-1.10-patched-13ubuntu;libctb-0.16\include;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories) - NO_ALSA;%(PreprocessorDefinitions) - - - Level4 - false - 4554;4324;4389;4244;4267;6340;6246;6011;6387;%(DisableSpecificWarnings) - false - - - false - - - %(AdditionalDependencies) - - - - - gsmlib\gsmlib-1.10-patched-13ubuntu;libctb-0.16\include;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories) - - - 4554;4324;4389;4244;4267;6340;6246;6011;6387;%(DisableSpecificWarnings) - - - false - - - %(AdditionalDependencies) - - - - - X64 - - - gsmlib\gsmlib-1.10-patched-13ubuntu;libctb-0.16\include;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories) - NO_ALSA;%(PreprocessorDefinitions) - - - Level4 - false - 4554;4324;4389;4244;4267;6340;6246;6011;6387;%(DisableSpecificWarnings) - - - false - - - MachineX64 - %(AdditionalDependencies) - - - - - X64 - - - gsmlib\gsmlib-1.10-patched-13ubuntu;libctb-0.16\include;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories) - - - 4554;4324;4389;4244;4267;6340;6246;6011;6387;%(DisableSpecificWarnings) - - - false - - - %(AdditionalDependencies) - MachineX64 - - - - - - - - - - - - {1cbb0077-18c5-455f-801c-0a0ce7b0bbf5} - - - {77bc1dd2-c9a1-44d7-bffa-1320370cacb9} - - - {202d7a4e-760d-4d0e-afa1-d7459ced30ff} - false - - - {26c82fce-e0cf-4d10-a00c-d8e582ffeb53} - - - - - - \ No newline at end of file diff --git a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp b/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp deleted file mode 100644 index 20697adda4..0000000000 --- a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp +++ /dev/null @@ -1,3299 +0,0 @@ -/* - * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2011, Anthony Minessale II - * - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * - * The Initial Developer of the Original Code is - * Anthony Minessale II - * Portions created by the Initial Developer are Copyright (C) - * the Initial Developer. All Rights Reserved. - * - * This module (mod_gsmopen) has been contributed by: - * - * Giovanni Maruzzelli - * - * Maintainer: Giovanni Maruzzelli - * - * mod_gsmopen.cpp -- GSM Modem compatible Endpoint Module - * - */ - -#include "gsmopen.h" - -SWITCH_BEGIN_EXTERN_C SWITCH_MODULE_LOAD_FUNCTION(mod_gsmopen_load); -SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_gsmopen_shutdown); -SWITCH_MODULE_DEFINITION(mod_gsmopen, mod_gsmopen_load, mod_gsmopen_shutdown, NULL); -SWITCH_END_EXTERN_C -#define GSMOPEN_CHAT_PROTO "sms" -SWITCH_STANDARD_API(gsm_function); -#define GSM_SYNTAX "list [full] || console || AT_command || remove < interface_name | interface_id > || reload" -SWITCH_STANDARD_API(gsmopen_function); -#define GSMOPEN_SYNTAX "interface_name AT_command" - -SWITCH_STANDARD_API(gsmopen_boost_audio_function); -#define GSMOPEN_BOOST_AUDIO_SYNTAX "interface_name [ ]" -SWITCH_STANDARD_API(sendsms_function); -#define SENDSMS_SYNTAX "gsmopen_sendsms interface_name destination_number SMS_text" -SWITCH_STANDARD_API(gsmopen_dump_function); -#define GSMOPEN_DUMP_SYNTAX "gsmopen_dump " -SWITCH_STANDARD_API(gsmopen_ussd_function); -#define USSD_SYNTAX "gsmopen_ussd [nowait]" -#define FULL_RELOAD 0 -#define SOFT_RELOAD 1 - -const char *interface_status[] = { /* should match GSMOPEN_STATE_xxx in gsmopen.h */ - "IDLE", - "DOWN", - "RING", - "DIALING", - "BUSY", - "UP", - "RINGING", - "PRERING", - "DOUBLE", - "SELECTD", - "HANG_RQ", - "PREANSW" -}; - -const char *phone_callflow[] = { /* should match CALLFLOW_XXX in gsmopen.h */ - "CALL_IDLE", - "CALL_DOWN", - "INCOMING_RNG", - "CALL_DIALING", - "CALL_LINEBUSY", - "CALL_ACTIVE", - "INCOMING_HNG", - "CALL_RLEASD", - "CALL_NOCARR", - "CALL_INFLUX", - "CALL_INCOMING", - "CALL_FAILED", - "CALL_NOSRVC", - "CALL_OUTRESTR", - "CALL_SECFAIL", - "CALL_NOANSWER", - "STATUS_FNSHED", - "STATUS_CANCLED", - "STATUS_FAILED", - "STATUS_REFUSED", - "STATUS_RINGING", - "STATUS_INPROGRS", - "STATUS_UNPLACD", - "STATUS_ROUTING", - "STATUS_EARLYMD", - "INCOMING_CLID", - "STATUS_RMTEHOLD" -}; - -static struct { - int debug; - char *ip; - int port; - char *dialplan; - char *destination; - char *context; - char *codec_string; - char *codec_order[SWITCH_MAX_CODECS]; - int codec_order_last; - char *codec_rates_string; - char *codec_rates[SWITCH_MAX_CODECS]; - int codec_rates_last; - unsigned int flags; - int fd; - int calls; - int real_interfaces; - int next_interface; - char hold_music[256]; - private_t GSMOPEN_INTERFACES[GSMOPEN_MAX_INTERFACES]; - switch_mutex_t *mutex; - private_t *gsm_console; -} globals; - -switch_endpoint_interface_t *gsmopen_endpoint_interface; -switch_memory_pool_t *gsmopen_module_pool = NULL; -int running = 0; - -SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan); -SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_context, globals.context); -SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_destination, globals.destination); - -static switch_status_t interface_exists(char *the_interface); -static switch_status_t remove_interface(char *the_interface); - -static switch_status_t channel_on_init(switch_core_session_t *session); -static switch_status_t channel_on_hangup(switch_core_session_t *session); -static switch_status_t channel_on_destroy(switch_core_session_t *session); -static switch_status_t channel_on_routing(switch_core_session_t *session); -static switch_status_t channel_on_exchange_media(switch_core_session_t *session); -static switch_status_t channel_on_consume_media(switch_core_session_t *session); -static switch_status_t channel_on_soft_execute(switch_core_session_t *session); -static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, - switch_event_t *var_event, - switch_caller_profile_t *outbound_profile, - switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, - switch_call_cause_t *cancel_cause); -static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id); -static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id); -static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig); -static switch_status_t gsmopen_tech_init(private_t *tech_pvt, switch_core_session_t *session); - -static switch_status_t gsmopen_codec(private_t *tech_pvt, int sample_rate, int codec_ms) -{ - switch_core_session_t *session = NULL; - - if (switch_core_codec_init - (&tech_pvt->read_codec, "L16", NULL, NULL, sample_rate, codec_ms, 1, - SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, NULL) != SWITCH_STATUS_SUCCESS) { - ERRORA("Can't load codec?\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - } - - if (switch_core_codec_init - (&tech_pvt->write_codec, "L16", NULL, NULL, sample_rate, codec_ms, 1, - SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, NULL) != SWITCH_STATUS_SUCCESS) { - ERRORA("Can't load codec?\n", GSMOPEN_P_LOG); - switch_core_codec_destroy(&tech_pvt->read_codec); - return SWITCH_STATUS_FALSE; - } - - tech_pvt->read_frame.rate = sample_rate; - tech_pvt->read_frame.codec = &tech_pvt->read_codec; - - session = switch_core_session_locate(tech_pvt->session_uuid_str); - - if (session) { - switch_core_session_set_read_codec(session, &tech_pvt->read_codec); - switch_core_session_set_write_codec(session, &tech_pvt->write_codec); - switch_core_session_rwunlock(session); - } else { - ERRORA("no session\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - } - - return SWITCH_STATUS_SUCCESS; - -} - -switch_status_t gsmopen_tech_init(private_t *tech_pvt, switch_core_session_t *session) -{ - - switch_assert(tech_pvt != NULL); - switch_assert(session != NULL); - tech_pvt->read_frame.data = tech_pvt->databuf; - tech_pvt->read_frame.buflen = sizeof(tech_pvt->databuf); - switch_mutex_init(&tech_pvt->mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session)); - switch_mutex_init(&tech_pvt->flag_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session)); - switch_core_session_set_private(session, tech_pvt); - switch_copy_string(tech_pvt->session_uuid_str, switch_core_session_get_uuid(session), sizeof(tech_pvt->session_uuid_str)); - if (!strlen(tech_pvt->session_uuid_str)) { - ERRORA("no tech_pvt->session_uuid_str\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - } - if (gsmopen_codec(tech_pvt, SAMPLERATE_GSMOPEN, 20) != SWITCH_STATUS_SUCCESS) { - ERRORA("gsmopen_codec FAILED\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - } - dtmf_rx_init(&tech_pvt->dtmf_state, NULL, NULL); - dtmf_rx_parms(&tech_pvt->dtmf_state, 0, 10, 10, -99); - -/* - if (tech_pvt->no_sound == 0) { - if (serial_audio_init(tech_pvt)) { - ERRORA("serial_audio_init failed\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - - } - } -*/ - - if (switch_core_timer_init(&tech_pvt->timer_read, "soft", 20, tech_pvt->read_codec.implementation->samples_per_packet, gsmopen_module_pool) != - SWITCH_STATUS_SUCCESS) { - ERRORA("setup timer failed\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - } - - switch_core_timer_sync(&tech_pvt->timer_read); - - if (switch_core_timer_init(&tech_pvt->timer_write, "soft", 20, tech_pvt->write_codec.implementation->samples_per_packet, gsmopen_module_pool) != - SWITCH_STATUS_SUCCESS) { - ERRORA("setup timer failed\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - } - - switch_core_timer_sync(&tech_pvt->timer_write); - - switch_mutex_lock(tech_pvt->flag_mutex); - switch_clear_flag(tech_pvt, TFLAG_HANGUP); - switch_mutex_unlock(tech_pvt->flag_mutex); - DEBUGA_GSMOPEN("gsmopen_codec SUCCESS\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t list_interfaces(const char *line, const char *cursor, switch_console_callback_match_t **matches) -{ - int interface_id; - switch_console_callback_match_t *my_matches = NULL; - switch_status_t status = SWITCH_STATUS_FALSE; - - for (interface_id = 0; interface_id < GSMOPEN_MAX_INTERFACES; interface_id++) { - if (globals.GSMOPEN_INTERFACES[interface_id].running) { - switch_console_push_match(&my_matches, (const char *) globals.GSMOPEN_INTERFACES[interface_id].name); - } - } - - if (my_matches) { - *matches = my_matches; - status = SWITCH_STATUS_SUCCESS; - } - - return status; -} - -static switch_status_t interface_exists(char *the_interface) -{ - int i; - int interface_id; - - if (*the_interface == '#') { /* look by interface id or interface name */ - the_interface++; - switch_assert(the_interface); - interface_id = atoi(the_interface); - - /* take a number as interface id */ - if (interface_id > 0 || (interface_id == 0 && strcmp(the_interface, "0") == 0)) { - if (strlen(globals.GSMOPEN_INTERFACES[interface_id].name)) { - return SWITCH_STATUS_SUCCESS; - } - } else { - /* interface name */ - for (interface_id = 0; interface_id < GSMOPEN_MAX_INTERFACES; interface_id++) { - if (strcmp(globals.GSMOPEN_INTERFACES[interface_id].name, the_interface) == 0) { - return SWITCH_STATUS_SUCCESS; - break; - } - } - } - } else { /* look by gsmopen_user */ - - for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) { - if (strlen(globals.GSMOPEN_INTERFACES[i].gsmopen_user)) { - if (strcmp(globals.GSMOPEN_INTERFACES[i].gsmopen_user, the_interface) == 0) { - return SWITCH_STATUS_SUCCESS; - } - } - } - } - return SWITCH_STATUS_FALSE; -} - -static switch_status_t remove_interface(char *the_interface) -{ - int x = 10; - int fd; -#ifdef WIN32 - switch_size_t howmany = 8; -#else - unsigned int howmany = 8; -#endif - - int interface_id = -1; - private_t *tech_pvt = NULL; - switch_status_t status; - - - switch_assert(the_interface); - interface_id = atoi(the_interface); - - if ((interface_id > 0 && interface_id < GSMOPEN_MAX_INTERFACES) || (interface_id == 0 && strcmp(the_interface, "0") == 0)) { - if (strlen(globals.GSMOPEN_INTERFACES[interface_id].name)) { - /* take a number as interface id */ - tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; - } - } else { - - for (interface_id = 0; interface_id < GSMOPEN_MAX_INTERFACES; interface_id++) { - if (strcmp(globals.GSMOPEN_INTERFACES[interface_id].name, the_interface) == 0) { - tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; - break; - } - } - } - - if (!tech_pvt) { - DEBUGA_GSMOPEN("interface '%s' does not exist\n", GSMOPEN_P_LOG, the_interface); - goto end; - } - - if (strlen(globals.GSMOPEN_INTERFACES[interface_id].session_uuid_str)) { - DEBUGA_GSMOPEN("interface '%s' is busy\n", GSMOPEN_P_LOG, the_interface); - goto end; - } - - LOKKA(tech_pvt->controldev_lock); - - globals.GSMOPEN_INTERFACES[interface_id].running = 0; - - if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_signaling_thread) { -#ifdef WIN32 - switch_file_write(tech_pvt->GSMopenHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die -#else /* WIN32 */ - howmany = write(tech_pvt->GSMopenHandles.fdesc[1], "sciutati", howmany); -#endif /* WIN32 */ - DEBUGA_GSMOPEN("HERE will shutdown gsmopen_signaling_thread of '%s'\n", GSMOPEN_P_LOG, the_interface); - } - - if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread) { - DEBUGA_GSMOPEN("HERE will shutdown gsmopen_api_thread of '%s'\n", GSMOPEN_P_LOG, the_interface); - } - - while (x) { - x--; - switch_yield(50000); - } - - if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_signaling_thread) { - switch_thread_join(&status, globals.GSMOPEN_INTERFACES[interface_id].gsmopen_signaling_thread); - } - - if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread) { - switch_thread_join(&status, globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread); - } - - fd = tech_pvt->controldevfd; - if (fd) { - tech_pvt->controldevfd = -1; - DEBUGA_GSMOPEN("SHUTDOWN tech_pvt->controldevfd=%d\n", GSMOPEN_P_LOG, tech_pvt->controldevfd); - } - - serial_audio_shutdown(tech_pvt); - - int res; - res = tech_pvt->serialPort_serial_control->Close(); - DEBUGA_GSMOPEN("serial_shutdown res=%d (controldevfd is %d)\n", GSMOPEN_P_LOG, res, tech_pvt->controldevfd); - -#ifndef WIN32 - shutdown(tech_pvt->audiogsmopenpipe[0], 2); - close(tech_pvt->audiogsmopenpipe[0]); - shutdown(tech_pvt->audiogsmopenpipe[1], 2); - close(tech_pvt->audiogsmopenpipe[1]); - shutdown(tech_pvt->audiopipe[0], 2); - close(tech_pvt->audiopipe[0]); - shutdown(tech_pvt->audiopipe[1], 2); - close(tech_pvt->audiopipe[1]); - shutdown(tech_pvt->GSMopenHandles.fdesc[0], 2); - close(tech_pvt->GSMopenHandles.fdesc[0]); - shutdown(tech_pvt->GSMopenHandles.fdesc[1], 2); - close(tech_pvt->GSMopenHandles.fdesc[1]); -#endif /* WIN32 */ - - UNLOCKA(tech_pvt->controldev_lock); - switch_mutex_lock(globals.mutex); - if (globals.gsm_console == &globals.GSMOPEN_INTERFACES[interface_id]) { - DEBUGA_GSMOPEN("interface '%s' no more console\n", GSMOPEN_P_LOG, the_interface); - globals.gsm_console = NULL; - } else { - DEBUGA_GSMOPEN("interface '%s' STILL console\n", GSMOPEN_P_LOG, the_interface); - } - memset(&globals.GSMOPEN_INTERFACES[interface_id], '\0', sizeof(private_t)); - globals.real_interfaces--; - switch_mutex_unlock(globals.mutex); - - DEBUGA_GSMOPEN("interface '%s' deleted successfully\n", GSMOPEN_P_LOG, the_interface); - - end: - return SWITCH_STATUS_SUCCESS; -} - -/* - State methods that get called when the state changes to the specific state - returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next - so if you fully implement the state you can return SWITCH_STATUS_FALSE to skip it. -*/ -static switch_status_t channel_on_init(switch_core_session_t *session) -{ - switch_channel_t *channel; - private_t *tech_pvt = NULL; - - tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - memset(tech_pvt->buffer2, 0, sizeof(tech_pvt->buffer2)); - - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - switch_mutex_lock(tech_pvt->flag_mutex); - switch_set_flag(tech_pvt, TFLAG_IO); - switch_mutex_unlock(tech_pvt->flag_mutex); - - switch_mutex_lock(globals.mutex); - globals.calls++; - - switch_mutex_unlock(globals.mutex); - DEBUGA_GSMOPEN("%s CHANNEL INIT %s\n", GSMOPEN_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session)); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_on_destroy(switch_core_session_t *session) -{ - private_t *tech_pvt = NULL; - - tech_pvt = (private_t *) switch_core_session_get_private(session); - - if (tech_pvt) { - DEBUGA_GSMOPEN("%s CHANNEL DESTROY %s\n", GSMOPEN_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session)); - - if (switch_core_codec_ready(&tech_pvt->read_codec)) { - switch_core_codec_destroy(&tech_pvt->read_codec); - } - - if (switch_core_codec_ready(&tech_pvt->write_codec)) { - switch_core_codec_destroy(&tech_pvt->write_codec); - } - - switch_core_timer_destroy(&tech_pvt->timer_read); - switch_core_timer_destroy(&tech_pvt->timer_write); - - if (tech_pvt->no_sound == 0) { - serial_audio_shutdown(tech_pvt); - } - - *tech_pvt->session_uuid_str = '\0'; - tech_pvt->interface_state = GSMOPEN_STATE_IDLE; - if (tech_pvt->phone_callflow == CALLFLOW_STATUS_FINISHED) { - tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; - } - memset(tech_pvt->buffer2, 0, sizeof(tech_pvt->buffer2)); - switch_core_session_set_private(session, NULL); - } else { - DEBUGA_GSMOPEN("!!!!!!NO tech_pvt!!!! CHANNEL DESTROY %s\n", GSMOPEN_P_LOG, switch_core_session_get_uuid(session)); - } - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_on_hangup(switch_core_session_t *session) -{ - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; - - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - - tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - tech_pvt->phone_callflow = CALLFLOW_CALL_HANGUP_REQUESTED; - - if (!switch_channel_test_flag(channel, CF_ANSWERED)) { - if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) { - tech_pvt->ob_failed_calls++; - } else { - tech_pvt->ib_failed_calls++; - } - } - - DEBUGA_GSMOPEN("%s CHANNEL HANGUP\n", GSMOPEN_P_LOG, tech_pvt->name); - switch_mutex_lock(tech_pvt->flag_mutex); - switch_clear_flag(tech_pvt, TFLAG_IO); - switch_clear_flag(tech_pvt, TFLAG_VOICE); - switch_set_flag(tech_pvt, TFLAG_HANGUP); - switch_mutex_unlock(tech_pvt->flag_mutex); - - gsmopen_hangup(tech_pvt); - - //memset(tech_pvt->session_uuid_str, '\0', sizeof(tech_pvt->session_uuid_str)); - //*tech_pvt->session_uuid_str = '\0'; - DEBUGA_GSMOPEN("%s CHANNEL HANGUP\n", GSMOPEN_P_LOG, tech_pvt->name); - switch_mutex_lock(globals.mutex); - globals.calls--; - if (globals.calls < 0) { - globals.calls = 0; - } - - tech_pvt->interface_state = GSMOPEN_STATE_IDLE; - tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; - switch_mutex_unlock(globals.mutex); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_on_routing(switch_core_session_t *session) -{ - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; - - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - - tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - DEBUGA_GSMOPEN("%s CHANNEL ROUTING\n", GSMOPEN_P_LOG, tech_pvt->name); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_on_execute(switch_core_session_t *session) -{ - - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; - - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - - tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - DEBUGA_GSMOPEN("%s CHANNEL EXECUTE\n", GSMOPEN_P_LOG, tech_pvt->name); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig) -{ - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; - - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - - tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - DEBUGA_GSMOPEN("%s CHANNEL KILL_CHANNEL\n", GSMOPEN_P_LOG, tech_pvt->name); - switch (sig) { - case SWITCH_SIG_KILL: - DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_SIG_KILL\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); - switch_mutex_lock(tech_pvt->flag_mutex); - switch_clear_flag(tech_pvt, TFLAG_IO); - switch_clear_flag(tech_pvt, TFLAG_VOICE); - switch_set_flag(tech_pvt, TFLAG_HANGUP); - switch_mutex_unlock(tech_pvt->flag_mutex); - break; - case SWITCH_SIG_BREAK: - DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_SIG_BREAK\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); - switch_mutex_lock(tech_pvt->flag_mutex); - switch_set_flag(tech_pvt, TFLAG_BREAK); - switch_mutex_unlock(tech_pvt->flag_mutex); - break; - default: - break; - } - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_on_consume_media(switch_core_session_t *session) -{ - private_t *tech_pvt = NULL; - - tech_pvt = (private_t *) switch_core_session_get_private(session); - - if (tech_pvt) { - DEBUGA_GSMOPEN("%s CHANNEL CONSUME_MEDIA\n", GSMOPEN_P_LOG, tech_pvt->name); - } - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_on_exchange_media(switch_core_session_t *session) -{ - private_t *tech_pvt = NULL; - tech_pvt = (private_t *) switch_core_session_get_private(session); - if (tech_pvt) { - DEBUGA_GSMOPEN("%s CHANNEL EXCHANGE_MEDIA\n", GSMOPEN_P_LOG, tech_pvt->name); - } - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_on_soft_execute(switch_core_session_t *session) -{ - private_t *tech_pvt = NULL; - tech_pvt = (private_t *) switch_core_session_get_private(session); - if (tech_pvt) { - DEBUGA_GSMOPEN("%s CHANNEL SOFT_EXECUTE\n", GSMOPEN_P_LOG, tech_pvt->name); - } - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_send_dtmf(switch_core_session_t *session, const switch_dtmf_t *dtmf) -{ - private_t *tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - DEBUGA_GSMOPEN("%s CHANNEL SEND_DTMF\n", GSMOPEN_P_LOG, tech_pvt->name); - DEBUGA_GSMOPEN("DTMF: %c\n", GSMOPEN_P_LOG, dtmf->digit); - - gsmopen_senddigit(tech_pvt, dtmf->digit); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id) -{ - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; - switch_byte_t *data; - - int samples; - char digit_str[256]; - char buffer2[640]; - - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - - tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - if (!switch_channel_ready(channel) || !switch_test_flag(tech_pvt, TFLAG_IO)) { - ERRORA("channel not ready \n", GSMOPEN_P_LOG); - //TODO: kill the bastard - return SWITCH_STATUS_FALSE; - } - - tech_pvt->read_frame.flags = SFF_NONE; - *frame = NULL; - - if (switch_test_flag(tech_pvt, TFLAG_HANGUP)) { - return SWITCH_STATUS_FALSE; - } - - switch_core_timer_next(&tech_pvt->timer_read); - - if (tech_pvt->no_sound) { - goto cng; - } - memset(buffer2, 0, sizeof(buffer2)); - samples = tech_pvt->serialPort_serial_audio->Read(buffer2, 640); - - if (samples >= 320) { - tech_pvt->buffer2_full = 0; - - if (samples >= 640) { - DEBUGA_GSMOPEN("read more than 320, samples=%d\n", GSMOPEN_P_LOG, samples); - memcpy(tech_pvt->buffer2, buffer2 + 320, 320); - tech_pvt->buffer2_full = 1; - } - samples = 320; - memcpy(tech_pvt->read_frame.data, buffer2, 320); - } else { - if (samples != 0) { - DEBUGA_GSMOPEN("read less than 320, samples=%d\n", GSMOPEN_P_LOG, samples); - } - if (tech_pvt->buffer2_full) { - memcpy(tech_pvt->read_frame.data, tech_pvt->buffer2, 320); - tech_pvt->buffer2_full = 0; - samples = 320; - DEBUGA_GSMOPEN("samples=%d FROM BUFFER\n", GSMOPEN_P_LOG, samples); - memset(tech_pvt->buffer2, 0, sizeof(tech_pvt->buffer2)); - } - - } - - tech_pvt->read_frame.datalen = samples; - tech_pvt->read_frame.samples = samples / 2; - tech_pvt->read_frame.timestamp = tech_pvt->timer_read.samplecount; - - *frame = &tech_pvt->read_frame; - - switch_mutex_lock(tech_pvt->flag_mutex); - switch_set_flag(tech_pvt, TFLAG_VOICE); - switch_mutex_unlock(tech_pvt->flag_mutex); - - if (samples != 320) { - memset(tech_pvt->buffer2, 0, sizeof(tech_pvt->buffer2)); - if (samples != 0) { - DEBUGA_GSMOPEN("samples=%d, goto cng\n", GSMOPEN_P_LOG, samples); - } - goto cng; - } - - memset(digit_str, 0, sizeof(digit_str)); - dtmf_rx(&tech_pvt->dtmf_state, (int16_t *) tech_pvt->read_frame.data, tech_pvt->read_frame.samples); - dtmf_rx_get(&tech_pvt->dtmf_state, digit_str, sizeof(digit_str)); - - gsmopen_sound_boost(tech_pvt->read_frame.data, tech_pvt->read_frame.samples, tech_pvt->capture_boost); - - if (digit_str[0]) { - switch_time_t new_dtmf_timestamp = switch_time_now(); - if ((new_dtmf_timestamp - tech_pvt->old_dtmf_timestamp) > 350000) { //FIXME: make it configurable - char *p = digit_str; - - while (p && *p) { - switch_dtmf_t dtmf = { 0 }; - dtmf.digit = *p; - dtmf.duration = SWITCH_DEFAULT_DTMF_DURATION; - switch_channel_queue_dtmf(channel, &dtmf); - p++; - } - DEBUGA_GSMOPEN("DTMF DETECTED: [%s] new_dtmf_timestamp: %u, delta_t: %u\n", GSMOPEN_P_LOG, digit_str, (unsigned int) new_dtmf_timestamp, - (unsigned int) (new_dtmf_timestamp - tech_pvt->old_dtmf_timestamp)); - tech_pvt->old_dtmf_timestamp = new_dtmf_timestamp; - } - } - while (switch_test_flag(tech_pvt, TFLAG_IO)) { - if (switch_test_flag(tech_pvt, TFLAG_BREAK)) { - switch_mutex_lock(tech_pvt->flag_mutex); - switch_clear_flag(tech_pvt, TFLAG_BREAK); - switch_mutex_unlock(tech_pvt->flag_mutex); - DEBUGA_GSMOPEN("BREAK: CHANNEL READ FRAME goto CNG\n", GSMOPEN_P_LOG); - goto cng; - } - - if (!switch_test_flag(tech_pvt, TFLAG_IO)) { - DEBUGA_GSMOPEN("CHANNEL READ FRAME not IO\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - } - - if (switch_test_flag(tech_pvt, TFLAG_IO) && switch_test_flag(tech_pvt, TFLAG_VOICE)) { - switch_mutex_lock(tech_pvt->flag_mutex); - switch_clear_flag(tech_pvt, TFLAG_VOICE); - switch_mutex_unlock(tech_pvt->flag_mutex); - if (!tech_pvt->read_frame.datalen) { - DEBUGA_GSMOPEN("CHANNEL READ CONTINUE\n", GSMOPEN_P_LOG); - continue; - } - *frame = &tech_pvt->read_frame; -#ifdef BIGENDIAN - if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { - switch_swap_linear((int16_t *) (*frame)->data, (int) (*frame)->datalen / 2); - } -#endif - return SWITCH_STATUS_SUCCESS; - } - - DEBUGA_GSMOPEN("CHANNEL READ no TFLAG_VOICE\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - - } - - DEBUGA_GSMOPEN("CHANNEL READ FALSE\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_FALSE; - cng: - data = (switch_byte_t *) tech_pvt->read_frame.data; - data[0] = 65; - data[1] = 0; - tech_pvt->read_frame.datalen = 2; - tech_pvt->read_frame.flags = SFF_CNG; - *frame = &tech_pvt->read_frame; - return SWITCH_STATUS_SUCCESS; - -} - -static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id) -{ - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; - - unsigned int sent; - - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - - tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - if (!switch_channel_ready(channel) || !switch_test_flag(tech_pvt, TFLAG_IO)) { - ERRORA("channel not ready \n", GSMOPEN_P_LOG); - //TODO: kill the bastard - return SWITCH_STATUS_FALSE; - } -#ifdef BIGENDIAN - if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { -#ifdef WIN32 - switch_swap_linear((int16_t *) frame->data, (int) frame->datalen / 2); -#else - switch_swap_linear(frame->data, (int) frame->datalen / 2); -#endif //WIN32 - } -#endif - - gsmopen_sound_boost(frame->data, frame->samples, tech_pvt->playback_boost); - if (!tech_pvt->no_sound) { - if (!tech_pvt->serialPort_serial_audio_opened) { - serial_audio_init(tech_pvt); - } - sent = tech_pvt->serialPort_serial_audio->Write((char *) frame->data, (int) (frame->datalen)); - - if (sent && sent != frame->datalen && sent != -1) { - DEBUGA_GSMOPEN("sent %u\n", GSMOPEN_P_LOG, sent); - } - } - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_answer_channel(switch_core_session_t *session) -{ - private_t *tech_pvt; - switch_channel_t *channel = NULL; - - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - - tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - switch_mutex_lock(tech_pvt->flag_mutex); - switch_set_flag(tech_pvt, TFLAG_IO); - switch_mutex_unlock(tech_pvt->flag_mutex); - - gsmopen_serial_answer(tech_pvt); - - switch_mutex_lock(globals.mutex); - globals.calls++; - - switch_mutex_unlock(globals.mutex); - DEBUGA_GSMOPEN("%s CHANNEL ANSWER %s\n", GSMOPEN_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session)); - - - if (channel) { - switch_channel_mark_answered(channel); - } - - DEBUGA_GSMOPEN("ANSWERED! \n", GSMOPEN_P_LOG); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_receive_message(switch_core_session_t *session, switch_core_session_message_t *msg) -{ - switch_channel_t *channel; - private_t *tech_pvt; - - channel = switch_core_session_get_channel(session); - switch_assert(channel != NULL); - - tech_pvt = (private_t *) switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); - - switch (msg->message_id) { - case SWITCH_MESSAGE_INDICATE_ANSWER: - { - DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_MESSAGE_INDICATE_ANSWER\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); - if (tech_pvt->interface_state != GSMOPEN_STATE_UP && tech_pvt->phone_callflow != CALLFLOW_CALL_ACTIVE) { - DEBUGA_GSMOPEN("MSG_ID=%d, TO BE ANSWERED!\n", GSMOPEN_P_LOG, msg->message_id); - channel_answer_channel(session); - } - } - break; - - case SWITCH_MESSAGE_INDICATE_PROGRESS: - { - DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_MESSAGE_INDICATE_PROGRESS\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); - if (tech_pvt->interface_state != GSMOPEN_STATE_UP && tech_pvt->phone_callflow != CALLFLOW_CALL_ACTIVE) { - DEBUGA_GSMOPEN("MSG_ID=%d, TO BE ANSWERED!\n", GSMOPEN_P_LOG, msg->message_id); - channel_answer_channel(session); - } - } - break; - case SWITCH_MESSAGE_INDICATE_AUDIO_SYNC: - - DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_MESSAGE_INDICATE_AUDIO_SYNC\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); - switch_core_timer_sync(&tech_pvt->timer_read); - switch_core_timer_sync(&tech_pvt->timer_write); - - break; - - case SWITCH_MESSAGE_INDICATE_TRANSFER: - DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_MESSAGE_INDICATE_TRANSFER\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); - break; - case SWITCH_MESSAGE_INDICATE_BRIDGE: - DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_MESSAGE_INDICATE_BRIDGE\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); - break; - case SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY: - DEBUGA_GSMOPEN("%s CHANNEL got SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); - break; - default: - { - if (msg->message_id != SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC && msg->message_id != SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC_COMPLETE) { - DEBUGA_GSMOPEN("MSG_ID=%d\n", GSMOPEN_P_LOG, msg->message_id); - } - } - break; - } - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_receive_event(switch_core_session_t *session, switch_event_t *event) -{ - struct private_object *tech_pvt = (struct private_object *) switch_core_session_get_private(session); - char *body = switch_event_get_body(event); - switch_assert(tech_pvt != NULL); - - if (!body) { - body = (char *) ""; - } - - WARNINGA("event: |||%s|||\n", GSMOPEN_P_LOG, body); - - return SWITCH_STATUS_SUCCESS; -} - -switch_state_handler_table_t gsmopen_state_handlers = { - /*.on_init */ channel_on_init, - /*.on_routing */ channel_on_routing, - /*.on_execute */ channel_on_execute, - /*.on_hangup */ channel_on_hangup, - /*.on_exchange_media */ channel_on_exchange_media, - /*.on_soft_execute */ channel_on_soft_execute, - /*.on_consume_media */ channel_on_consume_media, - /*.on_hibernate */ NULL, - /*.on_reset */ NULL, - /*.on_park */ NULL, - /*.on_reporting */ NULL, - /*.on_destroy */ channel_on_destroy -}; - -switch_io_routines_t gsmopen_io_routines = { - /*.outgoing_channel */ channel_outgoing_channel, - /*.read_frame */ channel_read_frame, - /*.write_frame */ channel_write_frame, - /*.kill_channel */ channel_kill_channel, - /*.send_dtmf */ channel_send_dtmf, - /*.receive_message */ channel_receive_message, - /*.receive_event */ channel_receive_event -}; - -static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, - switch_event_t *var_event, - switch_caller_profile_t *outbound_profile, - switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, - switch_call_cause_t *cancel_cause) -{ - private_t *tech_pvt = NULL; - int result; - - if ((*new_session = switch_core_session_request_uuid(gsmopen_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool, switch_event_get_header(var_event, "origination_uuid"))) != 0) { - - switch_channel_t *channel = NULL; - switch_caller_profile_t *caller_profile; - char *rdest; - int found = 0; - char interface_name[256]; - - DEBUGA_GSMOPEN("1 SESSION_REQUEST %s\n", GSMOPEN_P_LOG, switch_core_session_get_uuid(*new_session)); - switch_core_session_add_stream(*new_session, NULL); - - if (!zstr(outbound_profile->destination_number)) { - int i; - char *slash; - - switch_copy_string(interface_name, outbound_profile->destination_number, 255); - slash = strrchr(interface_name, '/'); - *slash = '\0'; - - switch_mutex_lock(globals.mutex); - if (strncmp("ANY", interface_name, strlen(interface_name)) == 0 || strncmp("RR", interface_name, strlen(interface_name)) == 0) { - /* we've been asked for the "ANY" interface, let's find the first idle interface */ - /* Find the first idle interface using Round Robin */ - DEBUGA_GSMOPEN("Finding one available gsmopen interface RR\n", GSMOPEN_P_LOG); - tech_pvt = find_available_gsmopen_interface_rr(NULL); - if (tech_pvt) { - found = 1; - DEBUGA_GSMOPEN("FOUND one available gsmopen interface RR\n", GSMOPEN_P_LOG); - } - } - - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ - if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].name, interface_name, strlen(interface_name)) == 0)) { - if (strlen(globals.GSMOPEN_INTERFACES[i].session_uuid_str)) { - DEBUGA_GSMOPEN - ("globals.GSMOPEN_INTERFACES[%d].name=|||%s||| session_uuid_str=|||%s||| is BUSY\n", - GSMOPEN_P_LOG, i, globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].session_uuid_str); - DEBUGA_GSMOPEN("1 SESSION_DESTROY %s\n", GSMOPEN_P_LOG, switch_core_session_get_uuid(*new_session)); - switch_core_session_destroy(new_session); - switch_mutex_unlock(globals.mutex); - return SWITCH_CAUSE_NORMAL_CIRCUIT_CONGESTION; - } - - DEBUGA_GSMOPEN("globals.GSMOPEN_INTERFACES[%d].name=|||%s|||?\n", GSMOPEN_P_LOG, i, globals.GSMOPEN_INTERFACES[i].name); - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - found = 1; - break; - } - - } - - } else { - ERRORA("Doh! no destination number?\n", GSMOPEN_P_LOG); - switch_core_session_destroy(new_session); - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; - } - - if (!found) { - DEBUGA_GSMOPEN("Doh! no available interface for |||%s|||?\n", GSMOPEN_P_LOG, interface_name); - DEBUGA_GSMOPEN("2 SESSION_DESTROY %s\n", GSMOPEN_P_LOG, switch_core_session_get_uuid(*new_session)); - switch_core_session_destroy(new_session); - switch_mutex_unlock(globals.mutex); - return SWITCH_CAUSE_NORMAL_CIRCUIT_CONGESTION; - } - - channel = switch_core_session_get_channel(*new_session); - if (!channel) { - ERRORA("Doh! no channel?\n", GSMOPEN_P_LOG); - switch_core_session_destroy(new_session); - switch_mutex_unlock(globals.mutex); - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; - } - if (gsmopen_tech_init(tech_pvt, *new_session) != SWITCH_STATUS_SUCCESS) { - ERRORA("Doh! no tech_init?\n", GSMOPEN_P_LOG); - switch_core_session_destroy(new_session); - switch_mutex_unlock(globals.mutex); - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; - } - - if (outbound_profile) { - char name[128]; - - snprintf(name, sizeof(name), "gsmopen/%s", outbound_profile->destination_number); - switch_channel_set_name(channel, name); - caller_profile = switch_caller_profile_clone(*new_session, outbound_profile); - switch_channel_set_caller_profile(channel, caller_profile); - tech_pvt->caller_profile = caller_profile; - } else { - ERRORA("Doh! no caller profile\n", GSMOPEN_P_LOG); - switch_core_session_destroy(new_session); - switch_mutex_unlock(globals.mutex); - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; - } - - tech_pvt->ob_calls++; - - rdest = strchr(caller_profile->destination_number, '/'); - *rdest++ = '\0'; - - - switch_copy_string(tech_pvt->session_uuid_str, switch_core_session_get_uuid(*new_session), sizeof(tech_pvt->session_uuid_str)); - caller_profile = tech_pvt->caller_profile; - caller_profile->destination_number = rdest; - - switch_mutex_lock(tech_pvt->flag_mutex); - switch_set_flag(tech_pvt, TFLAG_OUTBOUND); - switch_mutex_unlock(tech_pvt->flag_mutex); - switch_channel_set_state(channel, CS_INIT); - result=gsmopen_call(tech_pvt, rdest, 30); - switch_mutex_unlock(globals.mutex); - if(result != 0){ - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; - } - return SWITCH_CAUSE_SUCCESS; - } - - ERRORA("Doh! no new_session\n", GSMOPEN_P_LOG); - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; -} - -/*! - * \brief This thread runs during a call, and monitor the interface for signaling, like hangup, caller id, etc most of signaling is handled inside the gsmopen_signaling_read function - * - */ - -static switch_status_t load_config(int reload_type) -{ - const char *cf = "gsmopen.conf"; - switch_xml_t cfg, xml, global_settings, param, interfaces, myinterface; - private_t *tech_pvt = NULL; - -#ifdef WIN32 - DEBUGA_GSMOPEN("Windows CODEPAGE Input =%u\n", GSMOPEN_P_LOG, GetConsoleCP()); - SetConsoleCP(65001); - DEBUGA_GSMOPEN("Windows CODEPAGE Input =%u\n", GSMOPEN_P_LOG, GetConsoleCP()); - DEBUGA_GSMOPEN("Windows CODEPAGE Output =%u\n", GSMOPEN_P_LOG, GetConsoleOutputCP()); - SetConsoleOutputCP(65001); - DEBUGA_GSMOPEN("Windows CODEPAGE Output =%u\n", GSMOPEN_P_LOG, GetConsoleOutputCP()); - //let's hope to have unicode in console now. You need to use Lucida Console or, much better, Courier New font for the command prompt to show unicode -#endif // WIN32 - NOTICA("GSMOPEN Charset Output Test 0 %s\n", GSMOPEN_P_LOG, "èéòàù"); - NOTICA("GSMOPEN Charset Output Test 1 %s\n", GSMOPEN_P_LOG, "ç°§^£"); - NOTICA("GSMOPEN Charset Output Test 2 %s\n", GSMOPEN_P_LOG, "новости"); - NOTICA("GSMOPEN Charset Output Test 3 %s\n", GSMOPEN_P_LOG, "ﺎﻠﺠﻤﻋﺓ"); - NOTICA("GSMOPEN Charset Output Test 4 %s\n", GSMOPEN_P_LOG, "ראת"); - NOTICA("GSMOPEN Charset Output Test 5 %s\n", GSMOPEN_P_LOG, "לק"); - NOTICA("GSMOPEN Charset Output Test 6 %s\n", GSMOPEN_P_LOG, "人大"); - - switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, gsmopen_module_pool); - if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { - ERRORA("open of %s failed\n", GSMOPEN_P_LOG, cf); - running = 0; - switch_xml_free(xml); - return SWITCH_STATUS_TERM; - } - - switch_mutex_lock(globals.mutex); - - set_global_dialplan("XML"); - DEBUGA_GSMOPEN("Default globals.dialplan=%s\n", GSMOPEN_P_LOG, globals.dialplan); - set_global_destination("5000"); - DEBUGA_GSMOPEN("Default globals.destination=%s\n", GSMOPEN_P_LOG, globals.destination); - set_global_context("default"); - DEBUGA_GSMOPEN("Default globals.context=%s\n", GSMOPEN_P_LOG, globals.context); - - if ((global_settings = switch_xml_child(cfg, "global_settings"))) { - for (param = switch_xml_child(global_settings, "param"); param; param = param->next) { - char *var = (char *) switch_xml_attr_soft(param, "name"); - char *val = (char *) switch_xml_attr_soft(param, "value"); - - if (!strcasecmp(var, "debug")) { - DEBUGA_GSMOPEN("globals.debug=%d\n", GSMOPEN_P_LOG, globals.debug); - globals.debug = atoi(val); - DEBUGA_GSMOPEN("globals.debug=%d\n", GSMOPEN_P_LOG, globals.debug); - } else if (!strcasecmp(var, "hold-music")) { - switch_set_string(globals.hold_music, val); - DEBUGA_GSMOPEN("globals.hold_music=%s\n", GSMOPEN_P_LOG, globals.hold_music); - } else if (!strcmp(var, "dialplan")) { - set_global_dialplan(val); - DEBUGA_GSMOPEN("globals.dialplan=%s\n", GSMOPEN_P_LOG, globals.dialplan); - } else if (!strcmp(var, "destination")) { - set_global_destination(val); - DEBUGA_GSMOPEN("globals.destination=%s\n", GSMOPEN_P_LOG, globals.destination); - } else if (!strcmp(var, "context")) { - set_global_context(val); - DEBUGA_GSMOPEN("globals.context=%s\n", GSMOPEN_P_LOG, globals.context); - - } - - } - } - - if ((interfaces = switch_xml_child(cfg, "per_interface_settings"))) { - int i = 0; - - for (myinterface = switch_xml_child(interfaces, "interface"); myinterface; myinterface = myinterface->next) { - char *id = (char *) switch_xml_attr(myinterface, "id"); - char *name = (char *) switch_xml_attr(myinterface, "name"); - const char *context = globals.context; - const char *dialplan = globals.dialplan; - const char *destination = globals.destination; - const char *controldevice_name = "/dev/ttyUSB3"; - const char *controldevice_audio_name = "/dev/ttyUSB2"; - char *digit_timeout = NULL; - char *max_digits = NULL; - char *hotline = NULL; - char *dial_regex = NULL; - char *hold_music = globals.hold_music; - char *fail_dial_regex = NULL; - const char *enable_callerid = "true"; - - const char *at_dial_pre_number = "ATD"; - const char *at_dial_post_number = ";"; - const char *at_dial_expect = "OK"; - const char *at_hangup = "ATH"; - const char *at_hangup_expect = "OK"; - const char *at_answer = "ATA"; - const char *at_answer_expect = "OK"; - const char *at_send_dtmf = "AT^DTMF"; - const char *at_preinit_1 = ""; - const char *at_preinit_1_expect = ""; - const char *at_preinit_2 = ""; - const char *at_preinit_2_expect = ""; - const char *at_preinit_3 = ""; - const char *at_preinit_3_expect = ""; - const char *at_preinit_4 = ""; - const char *at_preinit_4_expect = ""; - const char *at_preinit_5 = ""; - const char *at_preinit_5_expect = ""; - const char *at_postinit_1 = "at+cmic=0,9"; - const char *at_postinit_1_expect = "OK"; - const char *at_postinit_2 = "AT+CKPD=\"EEE\""; - const char *at_postinit_2_expect = "OK"; - const char *at_postinit_3 = "AT+CSSN=1,0"; - const char *at_postinit_3_expect = "OK"; - const char *at_postinit_4 = "at+sidet=0"; - const char *at_postinit_4_expect = "OK"; - const char *at_postinit_5 = "at+clvl=3"; - const char *at_postinit_5_expect = "OK"; - const char *at_query_battchg = "AT+CBC"; - const char *at_query_battchg_expect = "OK"; - const char *at_query_signal = "AT+CSQ"; - const char *at_query_signal_expect = "OK"; - const char *at_call_idle = "+MCST: 1"; - const char *at_call_incoming = "RING"; - const char *at_call_active = "^CONN:1,0"; - const char *at_call_failed = "+MCST: 65"; - const char *at_call_calling = "^ORIG:1,0"; - const char *at_indicator_noservice_string = "CIEV: 2;0"; - const char *at_indicator_nosignal_string = "CIEV: 5;0"; - const char *at_indicator_lowsignal_string = "CIEV: 5;1"; - const char *at_indicator_lowbattchg_string = "CIEV: 0;1"; - const char *at_indicator_nobattchg_string = "CIEV: 0;0"; - const char *at_indicator_callactive_string = "CIEV: 3;1"; - const char *at_indicator_nocallactive_string = "CIEV: 3;0"; - const char *at_indicator_nocallsetup_string = "CIEV: 6;0"; - const char *at_indicator_callsetupincoming_string = "CIEV: 6;1"; - const char *at_indicator_callsetupoutgoing_string = "CIEV: 6;2"; - const char *at_indicator_callsetupremoteringing_string = "CIEV: 6;3"; - const char *at_early_audio = "0"; - const char *at_after_preinit_pause = "500000"; - const char *at_initial_pause = "500000"; - const char *at_has_clcc = "0"; - const char *at_has_ecam = "0"; - const char *gsmopen_sound_rate = "8000"; - const char *capture_boost = "0"; - const char *playback_boost = "0"; - const char *no_sound = "0"; - const char *portaudiocindex = "1"; - const char *portaudiopindex = "1"; - const char *speexecho = "1"; - const char *speexpreprocess = "1"; - const char *ussd_request_encoding = "auto"; - const char *ussd_response_encoding = "auto"; - - uint32_t interface_id = 0; - int controldevice_speed = 115200; //FIXME TODO - //int controldevice_audio_speed = 115200; //FIXME TODO - uint32_t controldevprotocol = PROTOCOL_AT; //FIXME TODO - const char *gsmopen_serial_sync_period = "300"; //FIXME TODO - const char *imei = ""; - const char *imsi = ""; - - tech_pvt = NULL; - - for (param = switch_xml_child(myinterface, "param"); param; param = param->next) { - char *var = (char *) switch_xml_attr_soft(param, "name"); - char *val = (char *) switch_xml_attr_soft(param, "value"); - - if (!strcasecmp(var, "id")) { - id = val; - } else if (!strcasecmp(var, "name")) { - name = val; - } else if (!strcasecmp(var, "context")) { - context = val; - } else if (!strcasecmp(var, "dialplan")) { - dialplan = val; - } else if (!strcasecmp(var, "destination")) { - destination = val; - } else if (!strcasecmp(var, "controldevice_name")) { - controldevice_name = val; - } else if (!strcasecmp(var, "controldevice_audio_name")) { - controldevice_audio_name = val; - } else if (!strcasecmp(var, "digit_timeout")) { - digit_timeout = val; - } else if (!strcasecmp(var, "max_digits")) { - max_digits = val; - } else if (!strcasecmp(var, "hotline")) { - hotline = val; - } else if (!strcasecmp(var, "dial_regex")) { - dial_regex = val; - } else if (!strcasecmp(var, SWITCH_HOLD_MUSIC_VARIABLE)) { - hold_music = val; - } else if (!strcasecmp(var, "fail_dial_regex")) { - fail_dial_regex = val; - } else if (!strcasecmp(var, "enable_callerid")) { - enable_callerid = val; - } else if (!strcasecmp(var, "at_dial_pre_number")) { - at_dial_pre_number = val; - } else if (!strcasecmp(var, "at_dial_post_number")) { - at_dial_post_number = val; - } else if (!strcasecmp(var, "at_dial_expect")) { - at_dial_expect = val; - } else if (!strcasecmp(var, "at_hangup")) { - at_hangup = val; - } else if (!strcasecmp(var, "at_hangup_expect")) { - at_hangup_expect = val; - } else if (!strcasecmp(var, "at_answer")) { - at_answer = val; - } else if (!strcasecmp(var, "at_answer_expect")) { - at_answer_expect = val; - } else if (!strcasecmp(var, "at_send_dtmf")) { - at_send_dtmf = val; - } else if (!strcasecmp(var, "at_preinit_1")) { - at_preinit_1 = val; - } else if (!strcasecmp(var, "at_preinit_1_expect")) { - at_preinit_1_expect = val; - } else if (!strcasecmp(var, "at_preinit_2")) { - at_preinit_2 = val; - } else if (!strcasecmp(var, "at_preinit_2_expect")) { - at_preinit_2_expect = val; - } else if (!strcasecmp(var, "at_preinit_3")) { - at_preinit_3 = val; - } else if (!strcasecmp(var, "at_preinit_3_expect")) { - at_preinit_3_expect = val; - } else if (!strcasecmp(var, "at_preinit_4")) { - at_preinit_4 = val; - } else if (!strcasecmp(var, "at_preinit_4_expect")) { - at_preinit_4_expect = val; - } else if (!strcasecmp(var, "at_preinit_5")) { - at_preinit_5 = val; - } else if (!strcasecmp(var, "at_preinit_5_expect")) { - at_preinit_5_expect = val; - } else if (!strcasecmp(var, "at_postinit_1")) { - at_postinit_1 = val; - } else if (!strcasecmp(var, "at_postinit_1_expect")) { - at_postinit_1_expect = val; - } else if (!strcasecmp(var, "at_postinit_2")) { - at_postinit_2 = val; - } else if (!strcasecmp(var, "at_postinit_2_expect")) { - at_postinit_2_expect = val; - } else if (!strcasecmp(var, "at_postinit_3")) { - at_postinit_3 = val; - } else if (!strcasecmp(var, "at_postinit_3_expect")) { - at_postinit_3_expect = val; - } else if (!strcasecmp(var, "at_postinit_4")) { - at_postinit_4 = val; - } else if (!strcasecmp(var, "at_postinit_4_expect")) { - at_postinit_4_expect = val; - } else if (!strcasecmp(var, "at_postinit_5")) { - at_postinit_5 = val; - } else if (!strcasecmp(var, "at_postinit_5_expect")) { - at_postinit_5_expect = val; - } else if (!strcasecmp(var, "at_query_battchg")) { - at_query_battchg = val; - } else if (!strcasecmp(var, "at_query_battchg_expect")) { - at_query_battchg_expect = val; - } else if (!strcasecmp(var, "at_query_signal")) { - at_query_signal = val; - } else if (!strcasecmp(var, "at_query_signal_expect")) { - at_query_signal_expect = val; - } else if (!strcasecmp(var, "at_call_idle")) { - at_call_idle = val; - } else if (!strcasecmp(var, "at_call_incoming")) { - at_call_incoming = val; - } else if (!strcasecmp(var, "at_call_active")) { - at_call_active = val; - } else if (!strcasecmp(var, "at_call_failed")) { - at_call_failed = val; - } else if (!strcasecmp(var, "at_call_calling")) { - at_call_calling = val; - } else if (!strcasecmp(var, "at_indicator_noservice_string")) { - at_indicator_noservice_string = val; - } else if (!strcasecmp(var, "at_indicator_nosignal_string")) { - at_indicator_nosignal_string = val; - } else if (!strcasecmp(var, "at_indicator_lowsignal_string")) { - at_indicator_lowsignal_string = val; - } else if (!strcasecmp(var, "at_indicator_lowbattchg_string")) { - at_indicator_lowbattchg_string = val; - } else if (!strcasecmp(var, "at_indicator_nobattchg_string")) { - at_indicator_nobattchg_string = val; - } else if (!strcasecmp(var, "at_indicator_callactive_string")) { - at_indicator_callactive_string = val; - } else if (!strcasecmp(var, "at_indicator_nocallactive_string")) { - at_indicator_nocallactive_string = val; - } else if (!strcasecmp(var, "at_indicator_nocallsetup_string")) { - at_indicator_nocallsetup_string = val; - } else if (!strcasecmp(var, "at_indicator_callsetupincoming_string")) { - at_indicator_callsetupincoming_string = val; - } else if (!strcasecmp(var, "at_indicator_callsetupoutgoing_string")) { - at_indicator_callsetupoutgoing_string = val; - } else if (!strcasecmp(var, "at_indicator_callsetupremoteringing_string")) { - at_indicator_callsetupremoteringing_string = val; - } else if (!strcasecmp(var, "portaudiocindex")) { - portaudiocindex = val; - } else if (!strcasecmp(var, "portaudiopindex")) { - portaudiopindex = val; - } else if (!strcasecmp(var, "speexecho")) { - speexecho = val; - } else if (!strcasecmp(var, "speexpreprocess")) { - speexpreprocess = val; - } else if (!strcasecmp(var, "at_early_audio")) { - at_early_audio = val; - } else if (!strcasecmp(var, "at_after_preinit_pause")) { - at_after_preinit_pause = val; - } else if (!strcasecmp(var, "at_initial_pause")) { - at_initial_pause = val; - } else if (!strcasecmp(var, "at_has_clcc")) { - at_has_clcc = val; - } else if (!strcasecmp(var, "at_has_ecam")) { - at_has_ecam = val; - } else if (!strcasecmp(var, "gsmopen_sound_rate")) { - gsmopen_sound_rate = val; - } else if (!strcasecmp(var, "capture_boost")) { - capture_boost = val; - } else if (!strcasecmp(var, "playback_boost")) { - playback_boost = val; - } else if (!strcasecmp(var, "no_sound")) { - no_sound = val; - } else if (!strcasecmp(var, "imsi")) { - imsi = val; - } else if (!strcasecmp(var, "imei")) { - imei = val; - } else if (!strcasecmp(var, "gsmopen_serial_sync_period")) { - gsmopen_serial_sync_period = val; - } else if (!strcasecmp(var, "ussd_request_encoding")) { - ussd_request_encoding = val; - } else if (!strcasecmp(var, "ussd_response_encoding")) { - ussd_response_encoding = val; - } - - } - - if (reload_type == SOFT_RELOAD) { - char the_interface[256]; - sprintf(the_interface, "#%s", name); - - if (interface_exists(the_interface) == SWITCH_STATUS_SUCCESS) { - continue; - } - } - - if (!id) { - ERRORA("interface missing REQUIRED param 'id'\n", GSMOPEN_P_LOG); - continue; - } - - if (switch_is_number(id)) { - interface_id = atoi(id); - } else { - ERRORA("interface param 'id' MUST be a number, now id='%s'\n", GSMOPEN_P_LOG, id); - continue; - } - - if (!switch_is_number(at_early_audio)) { - ERRORA("interface param 'at_early_audio' MUST be a number, now at_early_audio='%s'\n", GSMOPEN_P_LOG, at_early_audio); - continue; - } - if (!switch_is_number(at_after_preinit_pause)) { - ERRORA("interface param 'at_after_preinit_pause' MUST be a number, now at_after_preinit_pause='%s'\n", GSMOPEN_P_LOG, - at_after_preinit_pause); - continue; - } - if (!switch_is_number(at_initial_pause)) { - ERRORA("interface param 'at_initial_pause' MUST be a number, now at_initial_pause='%s'\n", GSMOPEN_P_LOG, at_initial_pause); - continue; - } - if (!switch_is_number(at_has_clcc)) { - ERRORA("interface param 'at_has_clcc' MUST be a number, now at_has_clcc='%s'\n", GSMOPEN_P_LOG, at_has_clcc); - continue; - } - if (!switch_is_number(at_has_ecam)) { - ERRORA("interface param 'at_has_ecam' MUST be a number, now at_has_ecam='%s'\n", GSMOPEN_P_LOG, at_has_ecam); - continue; - } - if (!switch_is_number(gsmopen_sound_rate)) { - ERRORA("interface param 'gsmopen_sound_rate' MUST be a number, now gsmopen_sound_rate='%s'\n", GSMOPEN_P_LOG, gsmopen_sound_rate); - continue; - } - if (!switch_is_number(capture_boost)) { - ERRORA("interface param 'capture_boost' MUST be a number, now capture_boost='%s'\n", GSMOPEN_P_LOG, capture_boost); - continue; - } - if (!switch_is_number(playback_boost)) { - ERRORA("interface param 'playback_boost' MUST be a number, now playback_boost='%s'\n", GSMOPEN_P_LOG, playback_boost); - continue; - } - if (!switch_is_number(no_sound)) { - ERRORA("interface param 'no_sound' MUST be a number, now no_sound='%s'\n", GSMOPEN_P_LOG, no_sound); - continue; - } - if (!switch_is_number(gsmopen_serial_sync_period)) { - ERRORA("interface param 'gsmopen_serial_sync_period' MUST be a number, now gsmopen_serial_sync_period='%s'\n", GSMOPEN_P_LOG, - gsmopen_serial_sync_period); - continue; - } - - if (interface_id && interface_id < GSMOPEN_MAX_INTERFACES) { - private_t newconf; - //int res = 0; - - memset(&newconf, '\0', sizeof(newconf)); - globals.GSMOPEN_INTERFACES[interface_id] = newconf; - - switch_mutex_init(&globals.GSMOPEN_INTERFACES[interface_id].controldev_lock, SWITCH_MUTEX_NESTED, gsmopen_module_pool); - switch_mutex_init(&globals.GSMOPEN_INTERFACES[interface_id].controldev_audio_lock, SWITCH_MUTEX_NESTED, gsmopen_module_pool); - - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].id, id); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].name, name); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].context, context); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].dialplan, dialplan); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].destination, destination); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].controldevice_name, controldevice_name); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].controldevice_audio_name, controldevice_audio_name); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].dial_regex, dial_regex); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].hold_music, hold_music); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].fail_dial_regex, fail_dial_regex); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_dial_pre_number, at_dial_pre_number); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_dial_post_number, at_dial_post_number); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_dial_expect, at_dial_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_hangup, at_hangup); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_hangup_expect, at_hangup_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_answer, at_answer); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_answer_expect, at_answer_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_send_dtmf, at_send_dtmf); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_1, at_preinit_1); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_1_expect, at_preinit_1_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_2, at_preinit_2); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_2_expect, at_preinit_2_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_3, at_preinit_3); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_3_expect, at_preinit_3_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_4, at_preinit_4); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_4_expect, at_preinit_4_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_5, at_preinit_5); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_preinit_5_expect, at_preinit_5_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_1, at_postinit_1); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_1_expect, at_postinit_1_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_2, at_postinit_2); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_2_expect, at_postinit_2_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_3, at_postinit_3); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_3_expect, at_postinit_3_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_4, at_postinit_4); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_4_expect, at_postinit_4_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_5, at_postinit_5); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_postinit_5_expect, at_postinit_5_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_query_battchg, at_query_battchg); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_query_battchg_expect, at_query_battchg_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_query_signal, at_query_signal); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_query_signal_expect, at_query_signal_expect); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_call_idle, at_call_idle); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_call_incoming, at_call_incoming); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_call_active, at_call_active); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_call_failed, at_call_failed); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_call_calling, at_call_calling); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_noservice_string, at_indicator_noservice_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_nosignal_string, at_indicator_nosignal_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_lowsignal_string, at_indicator_lowsignal_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_lowbattchg_string, at_indicator_lowbattchg_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_nobattchg_string, at_indicator_nobattchg_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_callactive_string, at_indicator_callactive_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_nocallactive_string, at_indicator_nocallactive_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_nocallsetup_string, at_indicator_nocallsetup_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_callsetupincoming_string, at_indicator_callsetupincoming_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_callsetupoutgoing_string, at_indicator_callsetupoutgoing_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_callsetupremoteringing_string, - at_indicator_callsetupremoteringing_string); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].imsi, imsi); - switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].imei, imei); - globals.GSMOPEN_INTERFACES[interface_id].at_early_audio = atoi(at_early_audio); - globals.GSMOPEN_INTERFACES[interface_id].at_after_preinit_pause = atoi(at_after_preinit_pause); - globals.GSMOPEN_INTERFACES[interface_id].at_initial_pause = atoi(at_initial_pause); - globals.GSMOPEN_INTERFACES[interface_id].at_has_clcc = atoi(at_has_clcc); - globals.GSMOPEN_INTERFACES[interface_id].at_has_ecam = atoi(at_has_ecam); - globals.GSMOPEN_INTERFACES[interface_id].capture_boost = atoi(capture_boost); - globals.GSMOPEN_INTERFACES[interface_id].playback_boost = atoi(playback_boost); - globals.GSMOPEN_INTERFACES[interface_id].no_sound = atoi(no_sound); - globals.GSMOPEN_INTERFACES[interface_id].gsmopen_serial_sync_period = atoi(gsmopen_serial_sync_period); - - globals.GSMOPEN_INTERFACES[interface_id].ussd_request_encoding = - strcasecmp(ussd_request_encoding, "plain") == 0 ? USSD_ENCODING_PLAIN : - strcasecmp(ussd_request_encoding, "hex7") == 0 ? USSD_ENCODING_HEX_7BIT : - strcasecmp(ussd_request_encoding, "hex8") == 0 ? USSD_ENCODING_HEX_8BIT : - strcasecmp(ussd_request_encoding, "ucs2") == 0 ? USSD_ENCODING_UCS2 : USSD_ENCODING_AUTO; - - globals.GSMOPEN_INTERFACES[interface_id].ussd_response_encoding = - strcasecmp(ussd_response_encoding, "plain") == 0 ? USSD_ENCODING_PLAIN : - strcasecmp(ussd_response_encoding, "hex7") == 0 ? USSD_ENCODING_HEX_7BIT : - strcasecmp(ussd_response_encoding, "hex8") == 0 ? USSD_ENCODING_HEX_8BIT : - strcasecmp(ussd_response_encoding, "ucs2") == 0 ? USSD_ENCODING_UCS2 : USSD_ENCODING_AUTO; - - globals.GSMOPEN_INTERFACES[interface_id].controldevice_speed = controldevice_speed; //FIXME - globals.GSMOPEN_INTERFACES[interface_id].controldevprotocol = controldevprotocol; //FIXME - globals.GSMOPEN_INTERFACES[interface_id].running = 1; //FIXME - - - gsmopen_store_boost((char *) capture_boost, &globals.GSMOPEN_INTERFACES[interface_id].capture_boost); //FIXME - gsmopen_store_boost((char *) playback_boost, &globals.GSMOPEN_INTERFACES[interface_id].playback_boost); //FIXME - - } else { - ERRORA("interface id %u is higher than GSMOPEN_MAX_INTERFACES (%d)\n", GSMOPEN_P_LOG, interface_id, GSMOPEN_MAX_INTERFACES); - alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "interface id is higher than GSMOPEN_MAX_INTERFACES"); - continue; - } - - } - -#ifndef WIN32 - find_ttyusb_devices(NULL, "/sys/devices"); -#endif// WIN32 - - for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) { - - switch_threadattr_t *gsmopen_api_thread_attr = NULL; - int res = 0; - int interface_id = i; - - tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; - - if (strlen(globals.GSMOPEN_INTERFACES[i].name) && !globals.GSMOPEN_INTERFACES[i].active) { - - WARNINGA("STARTING interface_id=%u\n", GSMOPEN_P_LOG, interface_id); - DEBUGA_GSMOPEN("id=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].id); - DEBUGA_GSMOPEN("name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].name); - DEBUGA_GSMOPEN("hold-music=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].hold_music); - DEBUGA_GSMOPEN("context=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].context); - DEBUGA_GSMOPEN("dialplan=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].dialplan); - DEBUGA_GSMOPEN("destination=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].destination); - DEBUGA_GSMOPEN("imei=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].imei); - DEBUGA_GSMOPEN("imsi=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].imsi); - DEBUGA_GSMOPEN("controldevice_name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].controldevice_name); - DEBUGA_GSMOPEN("controldevice_audio_name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].controldevice_audio_name); - DEBUGA_GSMOPEN("gsmopen_serial_sync_period=%d\n", GSMOPEN_P_LOG, - (int) globals.GSMOPEN_INTERFACES[interface_id].gsmopen_serial_sync_period); - - /* init the serial port */ - if (globals.GSMOPEN_INTERFACES[interface_id].controldevprotocol != PROTOCOL_NO_SERIAL) { - globals.GSMOPEN_INTERFACES[interface_id].controldevfd = - gsmopen_serial_init(&globals.GSMOPEN_INTERFACES[interface_id], globals.GSMOPEN_INTERFACES[interface_id].controldevice_speed); - if (globals.GSMOPEN_INTERFACES[interface_id].controldevfd == -1) { - ERRORA("STARTING interface_id=%u FAILED: gsmopen_serial_init failed\n", GSMOPEN_P_LOG, interface_id); - globals.GSMOPEN_INTERFACES[interface_id].running = 0; - alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "gsmopen_serial_init failed"); - globals.GSMOPEN_INTERFACES[interface_id].active = 0; - globals.GSMOPEN_INTERFACES[interface_id].name[0] = '\0'; - continue; - } - } - - /* config the phone/modem on the serial port */ - if (globals.GSMOPEN_INTERFACES[interface_id].controldevprotocol != PROTOCOL_NO_SERIAL) { - res = gsmopen_serial_config(&globals.GSMOPEN_INTERFACES[interface_id]); - if (res) { - int count = 0; - ERRORA("gsmopen_serial_config failed, let's try again\n", GSMOPEN_P_LOG); - while (res && count < 5) { - switch_sleep(100000); //0.1 seconds - res = gsmopen_serial_config(&globals.GSMOPEN_INTERFACES[interface_id]); - count++; - if (res) { - ERRORA("%d: gsmopen_serial_config failed, let's try again\n", GSMOPEN_P_LOG, count); - } - } - if (res) { - ERRORA("STARTING interface_id=%u FAILED\n", GSMOPEN_P_LOG, interface_id); - globals.GSMOPEN_INTERFACES[interface_id].running = 0; - alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "gsmopen_serial_config failed"); - globals.GSMOPEN_INTERFACES[interface_id].active = 0; - globals.GSMOPEN_INTERFACES[interface_id].name[0] = '\0'; - continue; - } - } - } - - if (globals.GSMOPEN_INTERFACES[interface_id].no_sound == 0) { - if (serial_audio_init(&globals.GSMOPEN_INTERFACES[interface_id])) { - ERRORA("serial_audio_init failed\n", GSMOPEN_P_LOG); - ERRORA("STARTING interface_id=%u FAILED\n", GSMOPEN_P_LOG, interface_id); - globals.GSMOPEN_INTERFACES[interface_id].running = 0; - alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "serial_audio_init failed"); - globals.GSMOPEN_INTERFACES[interface_id].active = 0; - globals.GSMOPEN_INTERFACES[interface_id].name[0] = '\0'; - continue; - - } - - if (serial_audio_shutdown(&globals.GSMOPEN_INTERFACES[interface_id])) { - ERRORA("serial_audio_shutdown failed\n", GSMOPEN_P_LOG); - ERRORA("STARTING interface_id=%u FAILED\n", GSMOPEN_P_LOG, interface_id); - globals.GSMOPEN_INTERFACES[interface_id].running = 0; - alarm_event(&globals.GSMOPEN_INTERFACES[interface_id], ALARM_FAILED_INTERFACE, "serial_audio_shutdown failed"); - globals.GSMOPEN_INTERFACES[interface_id].active = 0; - globals.GSMOPEN_INTERFACES[interface_id].name[0] = '\0'; - continue; - - } - - } - - globals.GSMOPEN_INTERFACES[interface_id].active = 1; - - //gsmopen_store_boost((char *) capture_boost, &globals.GSMOPEN_INTERFACES[interface_id].capture_boost); //FIXME - //gsmopen_store_boost((char *) playback_boost, &globals.GSMOPEN_INTERFACES[interface_id].playback_boost); //FIXME - - switch_sleep(100000); - switch_threadattr_create(&gsmopen_api_thread_attr, gsmopen_module_pool); - switch_threadattr_stacksize_set(gsmopen_api_thread_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread, gsmopen_api_thread_attr, gsmopen_do_gsmopenapi_thread, - &globals.GSMOPEN_INTERFACES[interface_id], gsmopen_module_pool); - - switch_sleep(100000); - WARNINGA("STARTED interface_id=%u\n", GSMOPEN_P_LOG, interface_id); - - /* How many real intterfaces */ - globals.real_interfaces++; - - } - } - - - for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) { - if (strlen(globals.GSMOPEN_INTERFACES[i].name)) { - - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - - DEBUGA_GSMOPEN("id=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].id); - DEBUGA_GSMOPEN("name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].name); - DEBUGA_GSMOPEN("context=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].context); - DEBUGA_GSMOPEN("hold-music=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].hold_music); - DEBUGA_GSMOPEN("dialplan=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].dialplan); - DEBUGA_GSMOPEN("destination=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].destination); - DEBUGA_GSMOPEN("imei=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].imei); - DEBUGA_GSMOPEN("imsi=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].imsi); - DEBUGA_GSMOPEN("controldevice_name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].controldevice_name); - DEBUGA_GSMOPEN("gsmopen_serial_sync_period=%d\n", GSMOPEN_P_LOG, (int) globals.GSMOPEN_INTERFACES[i].gsmopen_serial_sync_period); - DEBUGA_GSMOPEN("controldevice_audio_name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].controldevice_audio_name); - } - } - } - - switch_mutex_unlock(globals.mutex); - switch_xml_free(xml); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t chat_send(switch_event_t *message_event) -{ - char *user = NULL, *host, *f_user = NULL, *f_host = NULL, *f_resource = NULL; - private_t *tech_pvt = NULL; - int i = 0, found = 0; - - const char *proto; - const char *from; - const char *to; - const char *subject; - const char *body; - 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); - hint = switch_event_get_header(message_event, "hint"); - - switch_assert(proto != NULL); - - DEBUGA_GSMOPEN("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, hint=%s)\n", GSMOPEN_P_LOG, proto, from, to, subject, body, - hint ? hint : "NULL"); - - if (!to || !strlen(to)) { - ERRORA("Missing To: header.\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_SUCCESS; - } - - if ((!from && !hint) || (!strlen(from) && !strlen(hint))) { - ERRORA("Missing From: AND Hint: headers.\n", GSMOPEN_P_LOG); - return SWITCH_STATUS_SUCCESS; - } - - if (from && (f_user = strdup(from))) { - if ((f_host = strchr(f_user, '@'))) { - *f_host++ = '\0'; - if ((f_resource = strchr(f_host, '/'))) { - *f_resource++ = '\0'; - } - } - } - - if (hint == NULL || !strlen(hint)) { //FIXME FIXME FIXME - hint = from; - } - if (subject == NULL || !strlen(subject)) { //FIXME FIXME FIXME - subject = "SIMPLE MESSAGE"; - } - if (to && (user = strdup(to))) { - if ((host = strchr(user, '@'))) { - *host++ = '\0'; - } - - DEBUGA_GSMOPEN("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, hint=%s)\n", GSMOPEN_P_LOG, proto, from, to, subject, body, - hint ? hint : "NULL"); - if (hint && strlen(hint)) { - //in hint we receive the interface name to use - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].name, hint, strlen(hint)) == 0)) { - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - DEBUGA_GSMOPEN("Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", GSMOPEN_P_LOG, i, - globals.GSMOPEN_INTERFACES[i].name); - found = 1; - break; - } - } - } - if (!found) { - ERRORA("ERROR: A GSMopen interface with name='%s' or one with SIM_number='%s' was not found\n", GSMOPEN_P_LOG, hint ? hint : "NULL", - from ? from : "NULL"); - goto end; - } else { - if (strcasecmp(to, "ussd") == 0) { - gsmopen_ussd(tech_pvt, (char *) body, 0); - } else { - gsmopen_sendsms(tech_pvt, (char *) to, (char *) body); - } - - } - } - end: - switch_safe_free(user); - switch_safe_free(f_user); - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t compat_chat_send(const char *proto, const char *from, const char *to, - const char *subject, const char *body, const char *type, const char *hint) -{ - switch_event_t *message_event; - switch_status_t status; - - if (switch_event_create(&message_event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "proto", proto); - switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "from", from); - switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "to", to); - switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "subject", subject); - switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "type", type); - switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "hint", hint); - - if (body) { - switch_event_add_body(message_event, "%s", body); - } - } else { - abort(); - } - - status = chat_send(message_event); - switch_event_destroy(&message_event); - - return status; - -} - -SWITCH_MODULE_LOAD_FUNCTION(mod_gsmopen_load) -{ - switch_api_interface_t *commands_api_interface; - switch_chat_interface_t *chat_interface; - - gsmopen_module_pool = pool; - memset(&globals, '\0', sizeof(globals)); - - running = 1; - - if (load_config(FULL_RELOAD) != SWITCH_STATUS_SUCCESS) { - running = 0; - return SWITCH_STATUS_FALSE; - } - - if (switch_event_reserve_subclass(MY_EVENT_INCOMING_SMS) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass!\n"); - return SWITCH_STATUS_GENERR; - } - - *module_interface = switch_loadable_module_create_module_interface(pool, modname); - gsmopen_endpoint_interface = (switch_endpoint_interface_t *) switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE); - gsmopen_endpoint_interface->interface_name = "gsmopen"; - gsmopen_endpoint_interface->io_routines = &gsmopen_io_routines; - gsmopen_endpoint_interface->state_handler = &gsmopen_state_handlers; - - if (running) { - - SWITCH_ADD_API(commands_api_interface, "gsm", "gsm console AT_command", gsm_function, GSM_SYNTAX); - SWITCH_ADD_API(commands_api_interface, "gsmopen", "gsmopen interface AT_command", gsmopen_function, GSMOPEN_SYNTAX); - SWITCH_ADD_API(commands_api_interface, "gsmopen_boost_audio", "gsmopen_boost_audio interface AT_command", gsmopen_boost_audio_function, - GSMOPEN_BOOST_AUDIO_SYNTAX); - SWITCH_ADD_API(commands_api_interface, "gsmopen_dump", "gsmopen_dump interface", gsmopen_dump_function, GSMOPEN_DUMP_SYNTAX); - SWITCH_ADD_API(commands_api_interface, "gsmopen_sendsms", "gsmopen_sendsms interface destination_number SMS_text", sendsms_function, - SENDSMS_SYNTAX); - SWITCH_ADD_API(commands_api_interface, "gsmopen_ussd", "gsmopen_ussd interface ussd_code wait_seconds", gsmopen_ussd_function, - SENDSMS_SYNTAX); - SWITCH_ADD_CHAT(chat_interface, GSMOPEN_CHAT_PROTO, chat_send); - - switch_console_set_complete("add gsm list"); - switch_console_set_complete("add gsm list full"); - switch_console_set_complete("add gsm console ::gsm::list_interfaces"); - switch_console_set_complete("add gsm remove ::gsm::list_interfaces"); - switch_console_set_complete("add gsm reload"); - switch_console_set_complete("add gsmopen ::gsm::list_interfaces"); - switch_console_set_complete("add gsmopen_dump list"); - switch_console_set_complete("add gsmopen_dump ::gsm::list_interfaces"); - switch_console_set_complete("add gsmopen_ussd ::gsm::list_interfaces"); - switch_console_set_complete("add gsmopen_sendsms ::gsm::list_interfaces"); - switch_console_set_complete("add gsmopen_boost_audio ::gsm::list_interfaces"); - - switch_console_add_complete_func("::gsm::list_interfaces", list_interfaces); - - /* indicate that the module should continue to be loaded */ - return SWITCH_STATUS_SUCCESS; - } else - return SWITCH_STATUS_FALSE; -} - -SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_gsmopen_shutdown) -{ - int x; - private_t *tech_pvt = NULL; - switch_status_t status; -#ifdef WIN32 - switch_size_t howmany = 8; -#else - unsigned int howmany = 8; -#endif - int interface_id; - int fd; - - running = 0; - - for (interface_id = 0; interface_id < GSMOPEN_MAX_INTERFACES; interface_id++) { - tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; - - if (strlen(globals.GSMOPEN_INTERFACES[interface_id].name)) { - WARNINGA("SHUTDOWN interface_id=%d\n", GSMOPEN_P_LOG, interface_id); - globals.GSMOPEN_INTERFACES[interface_id].running = 0; - if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_signaling_thread) { -#ifdef WIN32 - switch_file_write(tech_pvt->GSMopenHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die -#else /* WIN32 */ - howmany = write(tech_pvt->GSMopenHandles.fdesc[1], "sciutati", howmany); -#endif /* WIN32 */ - } - x = 10; - while (x) { //FIXME 0.5 seconds? - x--; - switch_yield(50000); - } - if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_signaling_thread) { - switch_thread_join(&status, globals.GSMOPEN_INTERFACES[interface_id].gsmopen_signaling_thread); - } - if (globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread) { - switch_thread_join(&status, globals.GSMOPEN_INTERFACES[interface_id].gsmopen_api_thread); - } - - x = 10; - while (x) { //FIXME 0.5 seconds? - x--; - switch_yield(50000); - } - fd = tech_pvt->controldevfd; - if (fd) { - tech_pvt->controldevfd = -1; - DEBUGA_GSMOPEN("SHUTDOWN tech_pvt->controldevfd=%d\n", GSMOPEN_P_LOG, tech_pvt->controldevfd); - } - - if (!globals.GSMOPEN_INTERFACES[interface_id].no_sound) { - serial_audio_shutdown(tech_pvt); - } - - if (tech_pvt->serialPort_serial_control) { - int res; - res = tech_pvt->serialPort_serial_control->Close(); - DEBUGA_GSMOPEN("serial_shutdown res=%d (controldevfd is %d)\n", GSMOPEN_P_LOG, res, tech_pvt->controldevfd); - } - -#ifndef WIN32 - shutdown(tech_pvt->audiogsmopenpipe[0], 2); - close(tech_pvt->audiogsmopenpipe[0]); - shutdown(tech_pvt->audiogsmopenpipe[1], 2); - close(tech_pvt->audiogsmopenpipe[1]); - shutdown(tech_pvt->audiopipe[0], 2); - close(tech_pvt->audiopipe[0]); - shutdown(tech_pvt->audiopipe[1], 2); - close(tech_pvt->audiopipe[1]); - shutdown(tech_pvt->GSMopenHandles.fdesc[0], 2); - close(tech_pvt->GSMopenHandles.fdesc[0]); - shutdown(tech_pvt->GSMopenHandles.fdesc[1], 2); - close(tech_pvt->GSMopenHandles.fdesc[1]); -#endif /* WIN32 */ - } - - } - - switch_event_free_subclass(MY_EVENT_INCOMING_SMS); - - switch_safe_free(globals.dialplan); - switch_safe_free(globals.context); - switch_safe_free(globals.destination); - switch_safe_free(globals.codec_string); - switch_safe_free(globals.codec_rates_string); - - return SWITCH_STATUS_SUCCESS; -} - -void *SWITCH_THREAD_FUNC gsmopen_do_gsmopenapi_thread(switch_thread_t *thread, void *obj) -{ - return gsmopen_do_gsmopenapi_thread_func(obj); -} - -int dtmf_received(private_t *tech_pvt, char *value) -{ - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - session = switch_core_session_locate(tech_pvt->session_uuid_str); - channel = switch_core_session_get_channel(session); - - if (channel) { - - if (!switch_channel_test_flag(channel, CF_BRIDGED)) { - - switch_dtmf_t dtmf = { (char) value[0], switch_core_default_dtmf_duration(0) }; - DEBUGA_GSMOPEN("received DTMF %c on channel %s\n", GSMOPEN_P_LOG, dtmf.digit, switch_channel_get_name(channel)); - switch_mutex_lock(tech_pvt->flag_mutex); - //FIXME: why sometimes DTMFs from here do not seems to be get by FS? - switch_channel_queue_dtmf(channel, &dtmf); - switch_set_flag(tech_pvt, TFLAG_DTMF); - switch_mutex_unlock(tech_pvt->flag_mutex); - } else { - DEBUGA_GSMOPEN - ("received a DTMF on channel %s, but we're BRIDGED, so let's NOT relay it out of band\n", GSMOPEN_P_LOG, switch_channel_get_name(channel)); - } - } else { - WARNINGA("received %c DTMF, but no channel?\n", GSMOPEN_P_LOG, value[0]); - } - switch_core_session_rwunlock(session); - - return 0; -} - -int new_inbound_channel(private_t *tech_pvt) -{ - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - switch_assert(tech_pvt != NULL); - tech_pvt->ib_calls++; - if ((session = switch_core_session_request(gsmopen_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, SOF_NONE, NULL)) != 0) { - DEBUGA_GSMOPEN("2 SESSION_REQUEST %s\n", GSMOPEN_P_LOG, switch_core_session_get_uuid(session)); - switch_core_session_add_stream(session, NULL); - channel = switch_core_session_get_channel(session); - if (!channel) { - ERRORA("Doh! no channel?\n", GSMOPEN_P_LOG); - switch_core_session_destroy(&session); - return 0; - } - if (gsmopen_tech_init(tech_pvt, session) != SWITCH_STATUS_SUCCESS) { - ERRORA("Doh! no tech_init?\n", GSMOPEN_P_LOG); - switch_core_session_destroy(&session); - return 0; - } - - if ((tech_pvt->caller_profile = - switch_caller_profile_new(switch_core_session_get_pool(session), "gsmopen", - tech_pvt->dialplan, tech_pvt->callid_name, - tech_pvt->callid_number, NULL, NULL, NULL, NULL, "mod_gsmopen", tech_pvt->context, tech_pvt->destination)) != 0) { - char name[128]; - switch_snprintf(name, sizeof(name), "gsmopen/%s", tech_pvt->name); - switch_channel_set_name(channel, name); - switch_channel_set_caller_profile(channel, tech_pvt->caller_profile); - } - switch_channel_set_state(channel, CS_INIT); - if (switch_core_session_thread_launch(session) != SWITCH_STATUS_SUCCESS) { - ERRORA("Error spawning thread\n", GSMOPEN_P_LOG); - switch_core_session_destroy(&session); - return 0; - } - } - - DEBUGA_GSMOPEN("EXITING new_inbound_channel\n", GSMOPEN_P_LOG); - - return 0; -} - -int remote_party_is_ringing(private_t *tech_pvt) -{ - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - if (!zstr(tech_pvt->session_uuid_str)) { - session = switch_core_session_locate(tech_pvt->session_uuid_str); - } else { - ERRORA("No session???\n", GSMOPEN_P_LOG); - goto done; - } - if (session) { - channel = switch_core_session_get_channel(session); - } else { - ERRORA("No session???\n", GSMOPEN_P_LOG); - goto done; - } - if (channel) { - switch_channel_mark_ring_ready(channel); - DEBUGA_GSMOPEN("gsmopen_call: REMOTE PARTY RINGING\n", GSMOPEN_P_LOG); - } else { - ERRORA("No channel???\n", GSMOPEN_P_LOG); - } - - switch_core_session_rwunlock(session); - - done: - return 0; -} - -int remote_party_is_early_media(private_t *tech_pvt) -{ - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - if (!zstr(tech_pvt->session_uuid_str)) { - session = switch_core_session_locate(tech_pvt->session_uuid_str); - } else { - ERRORA("No session???\n\n\n", GSMOPEN_P_LOG); - //TODO: kill the bastard - goto done; - } - if (session) { - channel = switch_core_session_get_channel(session); - switch_core_session_add_stream(session, NULL); - } else { - ERRORA("No session???\n", GSMOPEN_P_LOG); - //TODO: kill the bastard - goto done; - } - if (channel) { - switch_channel_mark_pre_answered(channel); - DEBUGA_GSMOPEN("gsmopen_call: REMOTE PARTY EARLY MEDIA\n", GSMOPEN_P_LOG); - } else { - ERRORA("No channel???\n", GSMOPEN_P_LOG); - //TODO: kill the bastard - } - - switch_core_session_rwunlock(session); - - done: - return 0; -} - -int outbound_channel_answered(private_t *tech_pvt) -{ - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - - if (!zstr(tech_pvt->session_uuid_str)) { - session = switch_core_session_locate(tech_pvt->session_uuid_str); - } else { - ERRORA("No session???\n", GSMOPEN_P_LOG); - goto done; - } - if (session) { - channel = switch_core_session_get_channel(session); - } else { - ERRORA("No channel???\n", GSMOPEN_P_LOG); - goto done; - } - if (channel) { - switch_channel_mark_answered(channel); - tech_pvt->phone_callflow = GSMOPEN_STATE_UP; - tech_pvt->interface_state = GSMOPEN_STATE_UP; - } else { - ERRORA("No channel???\n", GSMOPEN_P_LOG); - } - - switch_core_session_rwunlock(session); - - done: - DEBUGA_GSMOPEN("outbound_channel_answered!\n", GSMOPEN_P_LOG); - - return 0; -} - -private_t *find_available_gsmopen_interface_rr(private_t *tech_pvt_calling) -{ - private_t *tech_pvt = NULL; - int i; - - switch_mutex_lock(globals.mutex); - - /* Fact is the real interface start from 1 */ - //XXX no, is just a convention, but you can have it start from 0. I do not, for aestetic reasons :-) - - for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) { - int interface_id; - - interface_id = globals.next_interface; - globals.next_interface = interface_id + 1 < GSMOPEN_MAX_INTERFACES ? interface_id + 1 : 0; - - if (strlen(globals.GSMOPEN_INTERFACES[interface_id].name)) { - int gsmopen_state = 0; - - tech_pvt = &globals.GSMOPEN_INTERFACES[interface_id]; - gsmopen_state = tech_pvt->interface_state; - DEBUGA_GSMOPEN("gsmopen interface: %d, name: %s, state: %d\n", GSMOPEN_P_LOG, interface_id, globals.GSMOPEN_INTERFACES[interface_id].name, - gsmopen_state); - if ((tech_pvt_calling ? strcmp(tech_pvt->gsmopen_user, tech_pvt_calling->gsmopen_user) : 1) - && (GSMOPEN_STATE_DOWN == gsmopen_state || 0 == gsmopen_state) && (tech_pvt->phone_callflow == CALLFLOW_STATUS_FINISHED - || 0 == tech_pvt->phone_callflow)) { - DEBUGA_GSMOPEN("returning as available gsmopen interface name: %s, state: %d callflow: %d\n", GSMOPEN_P_LOG, tech_pvt->name, gsmopen_state, - tech_pvt->phone_callflow); - if (tech_pvt_calling == NULL) { - tech_pvt->interface_state = GSMOPEN_STATE_SELECTED; - } - - switch_mutex_unlock(globals.mutex); - return tech_pvt; - } - } - } - - switch_mutex_unlock(globals.mutex); - return NULL; -} - -SWITCH_STANDARD_API(gsm_function) -{ - char *mycmd = NULL, *argv[10] = { 0 }; - int argc = 0; - - if (globals.gsm_console) - stream->write_function(stream, "gsm console is: |||%s|||\n", globals.gsm_console->name); - else - stream->write_function(stream, "gsm console is NOT yet assigned\n"); - - if (!zstr(cmd) && (mycmd = strdup(cmd))) { - argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); - } - - if (!argc || !argv[0]) { - stream->write_function(stream, "%s", GSM_SYNTAX); - goto end; - } - - if (!strcasecmp(argv[0], "list")) { - int i; - unsigned int ib = 0; - unsigned int ib_failed = 0; - unsigned int ob = 0; - unsigned int ob_failed = 0; - char next_flag_char = ' '; - - stream->write_function(stream, "F ID Name Operator IMEI IB (F/T) OB (F/T) State CallFlw UUID\n"); - stream->write_function(stream, "= == ========== ================ =============== ========= ========= ======= =============== ====\n"); - - for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) { - - if (strlen(globals.GSMOPEN_INTERFACES[i].name)) { - next_flag_char = i == globals.next_interface ? '*' : ' '; - ib += globals.GSMOPEN_INTERFACES[i].ib_calls; - ib_failed += globals.GSMOPEN_INTERFACES[i].ib_failed_calls; - ob += globals.GSMOPEN_INTERFACES[i].ob_calls; - ob_failed += globals.GSMOPEN_INTERFACES[i].ob_failed_calls; - - - stream->write_function(stream, - "%c %-2d %-10s %-16.16s %-15s %4u/%-4u %4u/%-4u %-7s %-15s %s\n", - next_flag_char, - i, globals.GSMOPEN_INTERFACES[i].name, - globals.GSMOPEN_INTERFACES[i].operator_name, - globals.GSMOPEN_INTERFACES[i].imei, - globals.GSMOPEN_INTERFACES[i].ib_failed_calls, - globals.GSMOPEN_INTERFACES[i].ib_calls, - globals.GSMOPEN_INTERFACES[i].ob_failed_calls, - globals.GSMOPEN_INTERFACES[i].ob_calls, - interface_status[globals.GSMOPEN_INTERFACES[i].interface_state], - phone_callflow[globals.GSMOPEN_INTERFACES[i].phone_callflow], globals.GSMOPEN_INTERFACES[i].session_uuid_str); - } else if (argc > 1 && !strcasecmp(argv[1], "full")) { - stream->write_function(stream, "%c %d\n", next_flag_char, i); - } - - } - stream->write_function(stream, "\nTotal Interfaces: %d IB Calls(Failed/Total): %u/%u OB Calls(Failed/Total): %u/%u\n", - globals.real_interfaces > 0 ? globals.real_interfaces : 0, ib_failed, ib, ob_failed, ob); - - } else if (!strcasecmp(argv[0], "console")) { - int i; - int found = 0; - - if (argc == 2) { - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ - if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[1], strlen(argv[1])) == 0)) { - globals.gsm_console = &globals.GSMOPEN_INTERFACES[i]; - stream->write_function(stream, "gsm console is now: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", i, - globals.GSMOPEN_INTERFACES[i].name); - stream->write_function(stream, "gsm console is: |||%s|||\n", globals.gsm_console->name); - found = 1; - break; - } - - } - if (!found) - stream->write_function(stream, "ERROR: A GSMopen interface with name='%s' was not found\n", argv[1]); - } else { - - stream->write_function(stream, "-ERR Usage: gsm console interface_name\n"); - goto end; - } - - } else if (!strcasecmp(argv[0], "ciapalino")) { - - } else if (!strcasecmp(argv[0], "reload")) { - if (load_config(SOFT_RELOAD) != SWITCH_STATUS_SUCCESS) { - stream->write_function(stream, "gsm reload failed\n"); - } else { - stream->write_function(stream, "gsm reload success\n"); - } - } else if (!strcasecmp(argv[0], "remove")) { - if (argc == 2) { - if (remove_interface(argv[1]) == SWITCH_STATUS_SUCCESS) { - if (interface_exists(argv[1]) == SWITCH_STATUS_SUCCESS) { - stream->write_function(stream, "gsm remove '%s' failed\n", argv[1]); - } else { - stream->write_function(stream, "gsm remove '%s' success\n", argv[1]); - } - } - } else { - stream->write_function(stream, "-ERR Usage: gsm remove interface_name\n"); - goto end; - } - - } else { - if (globals.gsm_console) - gsmopen_serial_write_AT_noack(globals.gsm_console, (char *) cmd); - else - stream->write_function(stream, "gsm console is NOT yet assigned\n"); - } - end: - switch_safe_free(mycmd); - - return SWITCH_STATUS_SUCCESS; -} - -SWITCH_STANDARD_API(gsmopen_function) -{ - char *mycmd = NULL, *argv[10] = { 0 }; - int argc = 0; - private_t *tech_pvt = NULL; - - if (!zstr(cmd) && (mycmd = strdup(cmd))) { - argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); - } - - if (!argc) { - stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_SYNTAX); - goto end; - } - - if (argc < 2) { - stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_SYNTAX); - goto end; - } - - if (argv[0]) { - int i; - int found = 0; - - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ - if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - stream->write_function(stream, "Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", i, globals.GSMOPEN_INTERFACES[i].name); - found = 1; - break; - } - - } - if (!found) { - stream->write_function(stream, "ERROR: A GSMopen interface with name='%s' was not found\n", argv[0]); - switch_safe_free(mycmd); - - return SWITCH_STATUS_SUCCESS; - } else { - gsmopen_serial_write_AT_noack(tech_pvt, (char *) &cmd[strlen(argv[0]) + 1]); - } - } else { - stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_SYNTAX); - } - end: - switch_safe_free(mycmd); - - return SWITCH_STATUS_SUCCESS; -} -SWITCH_STANDARD_API(gsmopen_dump_function) -{ - char *mycmd = NULL, *argv[10] = { 0 }; - int argc = 0; - private_t *tech_pvt = NULL; - char value[512]; - - if (!zstr(cmd) && (mycmd = strdup(cmd))) { - argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); - } - - if (!argc) { - stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_DUMP_SYNTAX); - goto end; - } - if (argc == 1 && argv[0]) { - int found = 0; - int i = 0; - - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ - if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - found = 1; - break; - } - - } - if (!found && (strcmp("list", argv[0]) == 0)) { - stream->write_function(stream, "gsmopen_dump LIST\n\n"); - for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) { - if (strlen(globals.GSMOPEN_INTERFACES[i].name)) { - stream->write_function(stream, "dumping interface '%s'\n\n", globals.GSMOPEN_INTERFACES[i].name); - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - - stream->write_function(stream, "interface_name = %s\n", tech_pvt->name); - stream->write_function(stream, "interface_id = %s\n", tech_pvt->id); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->active); - stream->write_function(stream, "active = %s\n", value); - if (!tech_pvt->network_creg_not_supported) { - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->not_registered); - stream->write_function(stream, "not_registered = %s\n", value); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->home_network_registered); - stream->write_function(stream, "home_network_registered = %s\n", value); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->roaming_registered); - stream->write_function(stream, "roaming_registered = %s\n", value); - } else { - stream->write_function(stream, "not_registered = %s\n", "N/A"); - stream->write_function(stream, "home_network_registered = %s\n", "N/A"); - stream->write_function(stream, "roaming_registered = %s\n", "N/A"); - } - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->got_signal); - stream->write_function(stream, "got_signal = %s\n", value); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->signal_strength); - stream->write_function(stream, "signal_strength = %s\n", value); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->running); - stream->write_function(stream, "running = %s\n", value); - stream->write_function(stream, "subscriber_number = %s\n", tech_pvt->subscriber_number); - stream->write_function(stream, "device_manufacturer = %s\n", tech_pvt->device_mfg); - stream->write_function(stream, "device_model = %s\n", tech_pvt->device_model); - stream->write_function(stream, "device_firmware = %s\n", tech_pvt->device_firmware); - stream->write_function(stream, "operator = %s\n", tech_pvt->operator_name); - stream->write_function(stream, "imei = %s\n", tech_pvt->imei); - stream->write_function(stream, "imsi = %s\n", tech_pvt->imsi); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->controldev_dead); - stream->write_function(stream, "controldev_dead = %s\n", value); - stream->write_function(stream, "controldevice_name = %s\n", tech_pvt->controldevice_name); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->no_sound); - stream->write_function(stream, "no_sound = %s\n", value); - snprintf(value, sizeof(value) - 1, "%f", tech_pvt->playback_boost); - stream->write_function(stream, "playback_boost = %s\n", value); - snprintf(value, sizeof(value) - 1, "%f", tech_pvt->capture_boost); - stream->write_function(stream, "capture_boost = %s\n", value); - stream->write_function(stream, "dialplan = %s\n", tech_pvt->dialplan); - stream->write_function(stream, "context = %s\n", tech_pvt->context); - stream->write_function(stream, "destination = %s\n", tech_pvt->destination); - snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ib_calls); - stream->write_function(stream, "ib_calls = %s\n", value); - snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ob_calls); - stream->write_function(stream, "ob_calls = %s\n", value); - snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ib_failed_calls); - stream->write_function(stream, "ib_failed_calls = %s\n", value); - snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ob_failed_calls); - stream->write_function(stream, "ob_failed_calls = %s\n", value); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->interface_state); - stream->write_function(stream, "interface_state = %s\n", value); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->phone_callflow); - stream->write_function(stream, "phone_callflow = %s\n", value); - stream->write_function(stream, "session_uuid_str = %s\n", tech_pvt->session_uuid_str); - stream->write_function(stream, "\n"); - - dump_event(tech_pvt); - } - - } - - } else if (found) { - stream->write_function(stream, "dumping interface '%s'\n\n", argv[0]); - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - - stream->write_function(stream, "interface_name = %s\n", tech_pvt->name); - stream->write_function(stream, "interface_id = %s\n", tech_pvt->id); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->active); - stream->write_function(stream, "active = %s\n", value); - if (!tech_pvt->network_creg_not_supported) { - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->not_registered); - stream->write_function(stream, "not_registered = %s\n", value); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->home_network_registered); - stream->write_function(stream, "home_network_registered = %s\n", value); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->roaming_registered); - stream->write_function(stream, "roaming_registered = %s\n", value); - } else { - stream->write_function(stream, "not_registered = %s\n", "N/A"); - stream->write_function(stream, "home_network_registered = %s\n", "N/A"); - stream->write_function(stream, "roaming_registered = %s\n", "N/A"); - } - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->got_signal); - stream->write_function(stream, "got_signal = %s\n", value); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->signal_strength); - stream->write_function(stream, "signal_strength = %s\n", value); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->running); - stream->write_function(stream, "running = %s\n", value); - stream->write_function(stream, "subscriber_number = %s\n", tech_pvt->subscriber_number); - stream->write_function(stream, "device_manufacturer = %s\n", tech_pvt->device_mfg); - stream->write_function(stream, "device_model = %s\n", tech_pvt->device_model); - stream->write_function(stream, "device_firmware = %s\n", tech_pvt->device_firmware); - stream->write_function(stream, "operator = %s\n", tech_pvt->operator_name); - stream->write_function(stream, "imei = %s\n", tech_pvt->imei); - stream->write_function(stream, "imsi = %s\n", tech_pvt->imsi); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->controldev_dead); - stream->write_function(stream, "controldev_dead = %s\n", value); - stream->write_function(stream, "controldevice_name = %s\n", tech_pvt->controldevice_name); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->no_sound); - stream->write_function(stream, "no_sound = %s\n", value); - snprintf(value, sizeof(value) - 1, "%f", tech_pvt->playback_boost); - stream->write_function(stream, "playback_boost = %s\n", value); - snprintf(value, sizeof(value) - 1, "%f", tech_pvt->capture_boost); - stream->write_function(stream, "capture_boost = %s\n", value); - stream->write_function(stream, "dialplan = %s\n", tech_pvt->dialplan); - stream->write_function(stream, "context = %s\n", tech_pvt->context); - stream->write_function(stream, "destination = %s\n", tech_pvt->destination); - snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ib_calls); - stream->write_function(stream, "ib_calls = %s\n", value); - snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ob_calls); - stream->write_function(stream, "ob_calls = %s\n", value); - snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ib_failed_calls); - stream->write_function(stream, "ib_failed_calls = %s\n", value); - snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ob_failed_calls); - stream->write_function(stream, "ob_failed_calls = %s\n", value); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->interface_state); - stream->write_function(stream, "interface_state = %s\n", value); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->phone_callflow); - stream->write_function(stream, "phone_callflow = %s\n", value); - stream->write_function(stream, "session_uuid_str = %s\n", tech_pvt->session_uuid_str); - stream->write_function(stream, "\n"); - - dump_event(tech_pvt); - } else { - stream->write_function(stream, "interface '%s' was not found\n", argv[0]); - } - } else { - stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_DUMP_SYNTAX); - } - end: - switch_safe_free(mycmd); - - return SWITCH_STATUS_SUCCESS; -} - -SWITCH_STANDARD_API(gsmopen_boost_audio_function) -{ - char *mycmd = NULL, *argv[10] = { 0 }; - int argc = 0; - private_t *tech_pvt = NULL; - - if (!zstr(cmd) && (mycmd = strdup(cmd))) { - argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); - } - - if ((argc == 1 || argc == 3) && argv[0]) { - int i; - int found = 0; - - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ - if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - stream->write_function(stream, "Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", i, globals.GSMOPEN_INTERFACES[i].name); - found = 1; - break; - } - - } - if (!found) { - stream->write_function(stream, "ERROR: A GSMopen interface with name='%s' was not found\n", argv[0]); - - } else { - if (argc == 1) { - stream->write_function(stream, "[%s] capture boost is %f\n", globals.GSMOPEN_INTERFACES[i].name, - globals.GSMOPEN_INTERFACES[i].capture_boost); - stream->write_function(stream, "[%s] playback boost is %f\n", globals.GSMOPEN_INTERFACES[i].name, - globals.GSMOPEN_INTERFACES[i].playback_boost); - stream->write_function(stream, "%s usage: %s", argv[0], GSMOPEN_BOOST_AUDIO_SYNTAX); - goto end; - } else if ((strncmp("play", argv[1], strlen(argv[1])) == 0)) { - if (switch_is_number(argv[2])) { - stream->write_function(stream, "[%s] playback boost was %f\n", globals.GSMOPEN_INTERFACES[i].name, - globals.GSMOPEN_INTERFACES[i].playback_boost); - gsmopen_store_boost(argv[2], &globals.GSMOPEN_INTERFACES[i].playback_boost); //FIXME - stream->write_function(stream, "[%s] playback boost is now %f\n", globals.GSMOPEN_INTERFACES[i].name, - globals.GSMOPEN_INTERFACES[i].playback_boost); - } - } else if ((strncmp("capt", argv[1], strlen(argv[1])) == 0)) { - if (switch_is_number(argv[2])) { - stream->write_function(stream, "[%s] capture boost was %f\n", globals.GSMOPEN_INTERFACES[i].name, - globals.GSMOPEN_INTERFACES[i].capture_boost); - gsmopen_store_boost(argv[2], &globals.GSMOPEN_INTERFACES[i].capture_boost); //FIXME - stream->write_function(stream, "[%s] capture boost is now %f\n", globals.GSMOPEN_INTERFACES[i].name, - globals.GSMOPEN_INTERFACES[i].capture_boost); - } - } else { - stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_BOOST_AUDIO_SYNTAX); - } - } - } else { - stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_BOOST_AUDIO_SYNTAX); - } - end: - switch_safe_free(mycmd); - - return SWITCH_STATUS_SUCCESS; -} - -void *gsmopen_do_gsmopenapi_thread_func(void *obj) -{ - - private_t *tech_pvt = (private_t *) obj; - time_t now_timestamp; - - while (running && tech_pvt && tech_pvt->running) { - int res; - res = gsmopen_serial_read(tech_pvt); - if (res == -1) { //manage the graceful interface shutdown - tech_pvt->controldev_dead = 1; - close(tech_pvt->controldevfd); - ERRORA("gsmopen_serial_monitor failed, declaring %s dead\n", GSMOPEN_P_LOG, tech_pvt->controldevice_name); - tech_pvt->running = 0; - alarm_event(tech_pvt, ALARM_FAILED_INTERFACE, "gsmopen_serial_monitor failed, declaring interface dead"); - tech_pvt->active = 0; - tech_pvt->name[0] = '\0'; - switch_sleep(1000000); - } else if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL && tech_pvt->interface_state == GSMOPEN_STATE_RING - && tech_pvt->phone_callflow != CALLFLOW_CALL_HANGUP_REQUESTED) { - - gsmopen_ring(tech_pvt); - - } else if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL && tech_pvt->interface_state == GSMOPEN_STATE_DIALING) { - DEBUGA_GSMOPEN("WE'RE DIALING, let's take the earlymedia\n", GSMOPEN_P_LOG); - tech_pvt->interface_state = CALLFLOW_STATUS_EARLYMEDIA; - remote_party_is_early_media(tech_pvt); - - } else if (tech_pvt->interface_state == CALLFLOW_CALL_REMOTEANSWER) { - DEBUGA_GSMOPEN("REMOTE PARTY ANSWERED\n", GSMOPEN_P_LOG); - outbound_channel_answered(tech_pvt); - } - switch_sleep(100); //give other threads a chance - time(&now_timestamp); - - if ((now_timestamp - tech_pvt->gsmopen_serial_synced_timestamp) > tech_pvt->gsmopen_serial_sync_period) { //TODO find a sensible period. 5min? in config? - gsmopen_serial_sync(tech_pvt); - gsmopen_serial_getstatus_AT(tech_pvt); - } - } - DEBUGA_GSMOPEN("EXIT\n", GSMOPEN_P_LOG); - return NULL; - -} - -SWITCH_STANDARD_API(sendsms_function) -{ - char *mycmd = NULL, *argv[3] = { 0 }; - int argc = 0; - private_t *tech_pvt = NULL; - - if (!zstr(cmd) && (mycmd = strdup(cmd))) { - argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); - } - - if (!argc) { - stream->write_function(stream, "ERROR, usage: %s", SENDSMS_SYNTAX); - goto end; - } - - if (argc < 3) { - stream->write_function(stream, "ERROR, usage: %s", SENDSMS_SYNTAX); - goto end; - } - - if (argv[0]) { - int i; - int found = 0; - - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ - if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - stream->write_function(stream, "Trying to send your SMS: interface=%s, dest=%s, text=%s\n", argv[0], argv[1], argv[2]); - found = 1; - break; - } - - } - if (!found) { - stream->write_function(stream, "ERROR: A GSMopen interface with name='%s' was not found\n", argv[0]); - switch_safe_free(mycmd); - - return SWITCH_STATUS_SUCCESS; - } else { - NOTICA("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=NULL, hint=%s)\n", GSMOPEN_P_LOG, GSMOPEN_CHAT_PROTO, tech_pvt->name, - argv[1], "SIMPLE MESSAGE", switch_str_nil(argv[2]), tech_pvt->name); - - compat_chat_send(GSMOPEN_CHAT_PROTO, tech_pvt->name, argv[1], "SIMPLE MESSAGE", switch_str_nil(argv[2]), NULL, tech_pvt->name); - } - } else { - stream->write_function(stream, "ERROR, usage: %s", SENDSMS_SYNTAX); - } - end: - switch_safe_free(mycmd); - - return SWITCH_STATUS_SUCCESS; -} - -SWITCH_STANDARD_API(gsmopen_ussd_function) -{ - char *mycmd = NULL, *argv[3] = { 0 }; - int argc = 0; - int waittime = 20; - private_t *tech_pvt = NULL; - - if (!zstr(cmd) && (mycmd = strdup(cmd))) { - argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); - } - - if (!argc) { - stream->write_function(stream, "ERROR, usage: %s", USSD_SYNTAX); - goto end; - } - - if (argc < 2) { - stream->write_function(stream, "ERROR, usage: %s", USSD_SYNTAX); - goto end; - } - - if (argc >= 3 && strcasecmp(argv[2], "nowait")==0) { - waittime = 0; - } - - if (argv[0]) { - int i; - int found = 0; - - for (i = 0; !found && i < GSMOPEN_MAX_INTERFACES; i++) { - /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ - if (strlen(globals.GSMOPEN_INTERFACES[i].name) - && (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { - tech_pvt = &globals.GSMOPEN_INTERFACES[i]; - NOTICA("Trying to send USSD request: interface=%s, ussd=%s\n", GSMOPEN_P_LOG, argv[0], argv[1]); - found = 1; - break; - } - - } - if (!found) { - stream->write_function(stream, "ERROR: A GSMopen interface with name='%s' was not found\n", argv[0]); - switch_safe_free(mycmd); - - return SWITCH_STATUS_SUCCESS; - } else { - int err = gsmopen_ussd(tech_pvt, (char *) argv[1], waittime); - if (err == AT_ERROR) { - stream->write_function(stream, "ERROR: command failed\n"); - } else if (!waittime) { - stream->write_function(stream, "USSD request has been sent\n"); - } else if (err) { - stream->write_function(stream, "ERROR: USSD request timeout (%d)\n", err); - } else if (!tech_pvt->ussd_received) { - stream->write_function(stream, "ERROR: no response received\n"); - } else { - stream->write_function(stream, "Status: %d%s\n", tech_pvt->ussd_status, - tech_pvt->ussd_status == 0 ? " - completed" : - tech_pvt->ussd_status == 1 ? " - action required" : - tech_pvt->ussd_status == 2 ? " - error" : ""); - if (strlen(tech_pvt->ussd_message) != 0) - stream->write_function(stream, "Text: %s\n", tech_pvt->ussd_message); - } - } - } else { - stream->write_function(stream, "ERROR, usage: %s", USSD_SYNTAX); - } - end: - switch_safe_free(mycmd); - - return SWITCH_STATUS_SUCCESS; -} - -int dump_event_full(private_t *tech_pvt, int is_alarm, int alarm_code, const char *alarm_message) -{ - switch_event_t *event; - char value[512]; - switch_core_session_t *session = NULL; - switch_channel_t *channel = NULL; - switch_status_t status; - - if (!tech_pvt) { - return -1; - } - session = switch_core_session_locate(tech_pvt->session_uuid_str); - if (session) { - channel = switch_core_session_get_channel(session); - } - - if (is_alarm) { - ERRORA("ALARM on interface %s: \n", GSMOPEN_P_LOG, tech_pvt->name); - status = switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_ALARM); - } else { - DEBUGA_GSMOPEN("DUMP on interface %s: \n", GSMOPEN_P_LOG, tech_pvt->name); - status = switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_DUMP); - } - if (status == SWITCH_STATUS_SUCCESS) { - if (is_alarm) { - snprintf(value, sizeof(value) - 1, "%d", alarm_code); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alarm_code", value); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alarm_message", alarm_message); - } - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface_name", tech_pvt->name); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface_id", tech_pvt->id); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->active); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "active", value); - if (!tech_pvt->network_creg_not_supported) { - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->not_registered); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "not_registered", value); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->home_network_registered); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "home_network_registered", value); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->roaming_registered); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "roaming_registered", value); - } else { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "not_registered", "N/A"); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "home_network_registered", "N/A"); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "roaming_registered", "N/A"); - } - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->got_signal); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "got_signal", value); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->signal_strength); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "signal_strength", value); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->running); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "running", value); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "subscriber_number", tech_pvt->subscriber_number); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "device_manufacturer", tech_pvt->device_mfg); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "device_model", tech_pvt->device_model); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "device_firmware", tech_pvt->device_firmware); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "operator", tech_pvt->operator_name); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "imei", tech_pvt->imei); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "imsi", tech_pvt->imsi); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->controldev_dead); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "controldev_dead", value); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "controldevice_name", tech_pvt->controldevice_name); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->no_sound); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "no_sound", value); - snprintf(value, sizeof(value) - 1, "%f", tech_pvt->playback_boost); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "playback_boost", value); - snprintf(value, sizeof(value) - 1, "%f", tech_pvt->capture_boost); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "capture_boost", value); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialplan", tech_pvt->dialplan); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "context", tech_pvt->context); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "destination", tech_pvt->destination); - snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ib_calls); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ib_calls", value); - snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ob_calls); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ob_calls", value); - snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ib_failed_calls); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ib_failed_calls", value); - snprintf(value, sizeof(value) - 1, "%lu", tech_pvt->ob_failed_calls); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ob_failed_calls", value); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->interface_state); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface_state", value); - snprintf(value, sizeof(value) - 1, "%d", tech_pvt->phone_callflow); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "phone_callflow", value); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "session_uuid_str", tech_pvt->session_uuid_str); - if (strlen(tech_pvt->session_uuid_str)) { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "true"); - } else { //no session - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "false"); - } - if (channel) { - switch_channel_event_set_data(channel, event); - } - switch_event_fire(&event); - } else { - ERRORA("cannot create event on interface %s. WHY?????\n", GSMOPEN_P_LOG, tech_pvt->name); - } - - if (session) { - switch_core_session_rwunlock(session); - } - return 0; -} - -int dump_event(private_t *tech_pvt) -{ - return dump_event_full(tech_pvt, 0, 0, NULL); -} - -int alarm_event(private_t *tech_pvt, int alarm_code, const char *alarm_message) -{ - return dump_event_full(tech_pvt, 1, alarm_code, alarm_message); -} - -int sms_incoming(private_t *tech_pvt) -{ - switch_event_t *event; - - if (!tech_pvt) { - return -1; - } - NOTICA("received SMS on interface %s: DATE=%s, SENDER=%s, BODY=|%s|\n", GSMOPEN_P_LOG, tech_pvt->name, tech_pvt->sms_date, tech_pvt->sms_sender, - tech_pvt->sms_body); - if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", GSMOPEN_CHAT_PROTO); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", tech_pvt->name); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", tech_pvt->sms_sender); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "date", tech_pvt->sms_date); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "userdataheader", tech_pvt->sms_userdataheader); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "datacodingscheme", tech_pvt->sms_datacodingscheme); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "servicecentreaddress", tech_pvt->sms_servicecentreaddress); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "messagetype", "%d", tech_pvt->sms_messagetype); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "subject", "SIMPLE MESSAGE"); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to", tech_pvt->name); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hint", tech_pvt->name); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_proto", GSMOPEN_CHAT_PROTO); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_user", tech_pvt->sms_sender); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_user", tech_pvt->name); - switch_event_add_body(event, "%s\n", tech_pvt->sms_body); - switch_core_chat_send("GLOBAL", event); /* mod_sms */ - } else { - - ERRORA("cannot create event on interface %s. WHY?????\n", GSMOPEN_P_LOG, tech_pvt->name); - } - - memset(tech_pvt->sms_message, '\0', sizeof(tech_pvt->sms_message)); - memset(tech_pvt->sms_sender, '\0', sizeof(tech_pvt->sms_sender)); - memset(tech_pvt->sms_date, '\0', sizeof(tech_pvt->sms_date)); - memset(tech_pvt->sms_userdataheader, '\0', sizeof(tech_pvt->sms_userdataheader)); - memset(tech_pvt->sms_body, '\0', sizeof(tech_pvt->sms_body)); - memset(tech_pvt->sms_datacodingscheme, '\0', sizeof(tech_pvt->sms_datacodingscheme)); - memset(tech_pvt->sms_servicecentreaddress, '\0', sizeof(tech_pvt->sms_servicecentreaddress)); - - return 0; -} - -int ussd_incoming(private_t *tech_pvt) -{ - switch_event_t *event; - - DEBUGA_GSMOPEN("received USSD on interface %s: TEXT=%s|\n", GSMOPEN_P_LOG, tech_pvt->name, tech_pvt->ussd_message); - -/* mod_sms begin */ - if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", GSMOPEN_CHAT_PROTO); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", tech_pvt->name); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", "ussd"); - //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "date", tech_pvt->sms_date); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "datacodingscheme", tech_pvt->ussd_dcs); - //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "servicecentreaddress", tech_pvt->sms_servicecentreaddress); - //switch_event_add_header(event, SWITCH_STACK_BOTTOM, "messagetype", "%d", tech_pvt->sms_messagetype); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "subject", "USSD MESSAGE"); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to", tech_pvt->name); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hint", tech_pvt->name); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_proto", GSMOPEN_CHAT_PROTO); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_user", "ussd"); - //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_host", "from_host"); - //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_full", "from_full"); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_user", tech_pvt->name); - //switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_host", "to_host"); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "ussd_status", "%d", tech_pvt->ussd_status); - switch_event_add_body(event, "%s\n", tech_pvt->ussd_message); - //switch_core_chat_send("GLOBAL", event); /* mod_sms */ - switch_core_chat_send("GLOBAL", event); /* mod_sms */ - } else { - - ERRORA("cannot create event on interface %s. WHY?????\n", GSMOPEN_P_LOG, tech_pvt->name); - } - /* mod_sms end */ - - return 0; -} - -#ifndef WIN32 -#define PATH_MAX_GIOVA PATH_MAX -static struct { -char path_idvendor[PATH_MAX_GIOVA]; -char path_idproduct[PATH_MAX_GIOVA]; -char tty_base[PATH_MAX_GIOVA]; -char idvendor[PATH_MAX_GIOVA]; -char idproduct[PATH_MAX_GIOVA]; -char tty_data_dir[PATH_MAX_GIOVA]; -char tty_audio_dir[PATH_MAX_GIOVA]; -char data_dev_id[256]; -char audio_dev_id[256]; -char delimiter[256]; -char txt_saved[PATH_MAX_GIOVA]; -char tty_base_copied[PATH_MAX_GIOVA]; -char tty_data_device_file[PATH_MAX_GIOVA]; -char tty_data_device[256]; -char tty_audio_device_file[PATH_MAX_GIOVA]; -char tty_audio_device[256]; -char answer[AT_BUFSIZ]; -char imei[256]; -char imsi[256]; -} f; -/* -int times=0; -int conta=0; -*/ -void find_ttyusb_devices(private_t *tech_pvt, const char *dirname) -{ - DIR *dir; - struct dirent *entry; - - memset( f.path_idvendor, 0, sizeof(f.path_idvendor) ); - memset( f.path_idproduct, 0, sizeof(f.path_idproduct) ); - memset( f.tty_base, 0, sizeof(f.tty_base) ); - memset( f.idvendor, 0, sizeof(f.idvendor) ); - memset( f.idproduct, 0, sizeof(f.idproduct) ); - memset( f.tty_data_dir, 0, sizeof(f.tty_data_dir) ); - memset( f.tty_audio_dir, 0, sizeof(f.tty_audio_dir) ); - memset( f.data_dev_id, 0, sizeof(f.data_dev_id) ); - memset( f.audio_dev_id, 0, sizeof(f.audio_dev_id) ); - memset( f.delimiter, 0, sizeof(f.delimiter) ); - memset( f.txt_saved, 0, sizeof(f.txt_saved) ); - memset( f.tty_base_copied, 0, sizeof(f.tty_base_copied) ); - memset( f.tty_data_device_file, 0, sizeof(f.tty_data_device_file) ); - memset( f.tty_data_device, 0, sizeof(f.tty_data_device) ); - memset( f.tty_audio_device_file, 0, sizeof(f.tty_audio_device_file) ); - memset( f.tty_audio_device, 0, sizeof(f.tty_audio_device) ); - - if (!(dir = opendir(dirname))){ - ERRORA("ERRORA! dirname=%s\n", GSMOPEN_P_LOG, dirname); - closedir(dir); - //conta--; - return; - } - if (!(entry = readdir(dir))){ - ERRORA("ERRORA!\n", GSMOPEN_P_LOG); - closedir(dir); - //conta--; - return; - } - - //conta++; - do { - if (entry->d_type == DT_DIR) { - char path[PATH_MAX_GIOVA]; - int len; - - //times++; - len = snprintf(path, sizeof(path)-1, "%s/%s", dirname, entry->d_name); - path[len] = 0; - if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) - continue; - find_ttyusb_devices(tech_pvt, path); - } else{ - int fd=-1; - int len2=-1; - DIR *dir2=NULL; - struct dirent *entry2=NULL; - int counter; - char *scratch=NULL; - char *txt=NULL; - - if (strcmp(entry->d_name, "idVendor") == 0){ - sprintf(f.tty_base, "%s", dirname); - sprintf(f.path_idvendor, "%s/%s", dirname, entry->d_name); - sprintf(f.path_idproduct, "%s/idProduct", dirname); - - fd = open(f.path_idvendor, O_RDONLY); - len2=read(fd, f.idvendor, sizeof(f.idvendor)); - close(fd); - - if(f.idvendor[len2-1]=='\n'){ - f.idvendor[len2-1]='\0'; - } - if (strcmp(f.idvendor, "12d1") == 0){ - - fd = open(f.path_idproduct, O_RDONLY); - len2=read(fd, f.idproduct, sizeof(f.idproduct)); - close(fd); - - if(f.idproduct[len2-1]=='\n'){ - f.idproduct[len2-1]='\0'; - } - if (strcmp(f.idproduct, "1001") == 0 || strcmp(f.idproduct, "140c") == 0 || strcmp(f.idproduct, "1436") == 0 || strcmp(f.idproduct, "1506") == 0 || strcmp(f.idproduct, "14ac") == 0 ){ - if (strcmp(f.idproduct, "1001") == 0){ - strcpy(f.data_dev_id, "2"); - strcpy(f.audio_dev_id, "1"); - }else if (strcmp(f.idproduct, "140c") == 0){ - strcpy(f.data_dev_id, "3"); - strcpy(f.audio_dev_id, "2"); - }else if (strcmp(f.idproduct, "1436") == 0){ - strcpy(f.data_dev_id, "4"); - strcpy(f.audio_dev_id, "3"); - }else if (strcmp(f.idproduct, "1506") == 0){ - strcpy(f.data_dev_id, "1"); - strcpy(f.audio_dev_id, "2"); - }else if (strcmp(f.idproduct, "14ac") == 0){ - strcpy(f.data_dev_id, "4"); - strcpy(f.audio_dev_id, "3"); - }else{ - //not possible - } - strcpy(f.delimiter, "/"); - strcpy(f.tty_base_copied, f.tty_base); - counter=0; - while((txt = strtok_r(!counter ? f.tty_base_copied : NULL, f.delimiter, &scratch))) - { - strcpy(f.txt_saved, txt); - counter++; - } - sprintf(f.tty_data_dir, "%s/%s:1.%s", f.tty_base, f.txt_saved, f.data_dev_id); - sprintf(f.tty_audio_dir, "%s/%s:1.%s", f.tty_base, f.txt_saved, f.audio_dev_id); - - if (!(dir2 = opendir(f.tty_data_dir))) { - ERRORA("ERRORA!\n", GSMOPEN_P_LOG); - } - if (!(entry2 = readdir(dir2))){ - ERRORA("ERRORA!\n", GSMOPEN_P_LOG); - } - do { - if (strncmp(entry2->d_name, "ttyUSB", 6) == 0){ - //char f.answer[AT_BUFSIZ]; - ctb::SerialPort *serialPort_serial_control; - int res; - int read_count; - char at_command[256]; - - sprintf(f.tty_data_device_file, "%s/%s", f.tty_data_dir, entry2->d_name); - sprintf(f.tty_data_device, "/dev/%s", entry2->d_name); - - memset(f.answer,0,sizeof(f.answer)); - memset(f.imei,0,sizeof(f.imei)); - memset(f.imsi,0,sizeof(f.imsi)); - - serialPort_serial_control = new ctb::SerialPort(); - if (serialPort_serial_control->Open(f.tty_data_device, 115200, "8N1", ctb::SerialPort::NoFlowControl) >= 0) { - sprintf(at_command, "AT\r\n"); - res = serialPort_serial_control->Write(at_command, 4); - usleep(20000); //0.02 seconds - res = serialPort_serial_control->Write(at_command, 4); - usleep(20000); //0.02 seconds - sprintf(at_command, "ATE1\r\n"); - res = serialPort_serial_control->Write(at_command, 6); - usleep(20000); //0.02 seconds - read_count = serialPort_serial_control->Read(f.answer, AT_BUFSIZ); - sprintf(at_command, "AT\r\n"); - res = serialPort_serial_control->Write(at_command, 4); - usleep(20000); //0.02 seconds - read_count = serialPort_serial_control->Read(f.answer, AT_BUFSIZ); - memset(f.answer,0,sizeof(f.answer)); - read_count = serialPort_serial_control->Read(f.answer, AT_BUFSIZ); - memset(f.answer,0,sizeof(f.answer)); - - /* IMEI */ - sprintf(at_command, "AT+GSN\r\n"); - res = serialPort_serial_control->Write(at_command, 8); - if (res != 8) { - ERRORA("writing AT+GSN failed: %d\n", GSMOPEN_P_LOG, res); - }else { - usleep(200000); //0.2 seconds - read_count = serialPort_serial_control->Read(f.answer, AT_BUFSIZ); - if (read_count < 32) { - ERRORA("reading AT+GSN failed: |%s|, read_count=%d, probably harmless in 'gsm reload'\n", GSMOPEN_P_LOG, f.answer, read_count); - } else { - strncpy(f.imei, f.answer+9, 15); - sprintf(at_command, "AT\r\n"); - res = serialPort_serial_control->Write(at_command, 4); - usleep(20000); //0.02 seconds - res = serialPort_serial_control->Write(at_command, 4); - usleep(20000); //0.02 seconds - sprintf(at_command, "ATE1\r\n"); - res = serialPort_serial_control->Write(at_command, 6); - usleep(20000); //0.02 seconds - read_count = serialPort_serial_control->Read(f.answer, AT_BUFSIZ); - sprintf(at_command, "AT\r\n"); - res = serialPort_serial_control->Write(at_command, 4); - usleep(20000); //0.02 seconds - read_count = serialPort_serial_control->Read(f.answer, AT_BUFSIZ); - memset(f.answer,0,sizeof(f.answer)); - read_count = serialPort_serial_control->Read(f.answer, AT_BUFSIZ); - memset(f.answer,0,sizeof(f.answer)); - - /* IMSI */ - sprintf(at_command, "AT+CIMI\r\n"); - res = serialPort_serial_control->Write(at_command, 9); - if (res != 9) { - ERRORA("writing AT+CIMI failed: %d\n", GSMOPEN_P_LOG, res); - }else { - usleep(200000); //0.2 seconds - read_count = serialPort_serial_control->Read(f.answer, AT_BUFSIZ); - if (read_count < 33) { - ERRORA("reading AT+CIMI failed: |%s|, read_count=%d\n", GSMOPEN_P_LOG, f.answer, read_count); - } else { - strncpy(f.imsi, f.answer+10, 15); - } - } - } - } - res = serialPort_serial_control->Close(); - } else { - ERRORA("port %s, NOT open\n", GSMOPEN_P_LOG, f.tty_data_device); - } - } - } while ((entry2 = readdir(dir2))); - closedir(dir2); - - if (!(dir2 = opendir(f.tty_audio_dir))) { - ERRORA("ERRORA!\n", GSMOPEN_P_LOG); - } - if (!(entry2 = readdir(dir2))){ - ERRORA("ERRORA!\n", GSMOPEN_P_LOG); - } - do { - if (strncmp(entry2->d_name, "ttyUSB", 6) == 0){ - int i; - sprintf(f.tty_audio_device_file, "%s/%s", f.tty_audio_dir, entry2->d_name); - sprintf(f.tty_audio_device, "/dev/%s", entry2->d_name); - - NOTICA("************************************************\n", GSMOPEN_P_LOG, f.imei); - NOTICA("f.imei=|%s|\n", GSMOPEN_P_LOG, f.imei); - NOTICA("f.imsi=|%s|\n", GSMOPEN_P_LOG, f.imsi); - NOTICA("f.tty_data_device = |%s|\n", GSMOPEN_P_LOG, f.tty_data_device); - NOTICA("f.tty_audio_device = |%s|\n", GSMOPEN_P_LOG, f.tty_audio_device); - NOTICA("************************************************\n", GSMOPEN_P_LOG, f.imei); - - for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) { - switch_threadattr_t *gsmopen_api_thread_attr = NULL; - int res = 0; - int interface_id = i; - - if (strlen(globals.GSMOPEN_INTERFACES[i].name) && (strlen(globals.GSMOPEN_INTERFACES[i].imsi) || strlen(globals.GSMOPEN_INTERFACES[i].imei)) ) { - //NOTICA("globals.GSMOPEN_INTERFACES[i].imei)=%s strlen(globals.GSMOPEN_INTERFACES[i].imei)=%d (strcmp(globals.GSMOPEN_INTERFACES[i].imei, f.imei) == 0)=%d \n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].imei, strlen(globals.GSMOPEN_INTERFACES[i].imei), (strcmp(globals.GSMOPEN_INTERFACES[i].imei, f.imei) == 0) ); - if( ( strlen(globals.GSMOPEN_INTERFACES[i].imei) ? (strcmp(globals.GSMOPEN_INTERFACES[i].imei, f.imei) == 0) : 1) ) { - if ( (strlen(globals.GSMOPEN_INTERFACES[i].imsi) ? (strcmp(globals.GSMOPEN_INTERFACES[i].imsi, f.imsi) == 0) : 1) ){ - strcpy(globals.GSMOPEN_INTERFACES[i].controldevice_audio_name, f.tty_audio_device); - strcpy(globals.GSMOPEN_INTERFACES[i].controldevice_name, f.tty_data_device); - NOTICA("name = |%s|, controldevice_audio_name = |%s|, controldevice_name = |%s|\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].controldevice_audio_name, globals.GSMOPEN_INTERFACES[i].controldevice_name); - break; - } - } - } - } - } - } while ((entry2 = readdir(dir2))); - closedir(dir2); - } - } - } - } - } while ((entry = readdir(dir))); - closedir(dir); -/* - if(f.conta < 0){ - ERRORA("f.conta=%d, dirs=%d, mem=%d\n", GSMOPEN_P_LOG, conta, times, conta*PATH_MAX_GIOVA); - }else{ - NOTICA("f.conta=%d, dirs=%d, mem=%d\n", GSMOPEN_P_LOG, conta, times, conta*PATH_MAX_GIOVA); - } - conta--; -*/ -} -#endif// WIN32 - - - - -/* 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 noet expandtab: - */ diff --git a/src/mod/endpoints/mod_gsmopen/win_iconv.c b/src/mod/endpoints/mod_gsmopen/win_iconv.c deleted file mode 100644 index e60f714889..0000000000 --- a/src/mod/endpoints/mod_gsmopen/win_iconv.c +++ /dev/null @@ -1,1986 +0,0 @@ -/* - * iconv library using Win32 API to conversion. - * - * This file is placed in the public domain. - * - * Last Change: 2009-07-06 - * - * ENVIRONMENT VARIABLE: - * WINICONV_LIBICONV_DLL - * If $WINICONV_LIBICONV_DLL is set, win_iconv uses the DLL. If - * loading the DLL or iconv_open() failed, falls back to internal - * conversion. If a few DLL are specified as comma separated list, - * the first loadable DLL is used. The DLL should have iconv_open(), - * iconv_close() and iconv(). Or libiconv_open(), libiconv_close() - * and libiconv(). - * (only available when USE_LIBICONV_DLL is defined at compile time) - * - * Win32 API does not support strict encoding conversion for some - * codepage. And MLang function drop or replace invalid bytes and does - * not return useful error status as iconv. This implementation cannot - * be used for encoding validation purpose. - */ - -/* for WC_NO_BEST_FIT_CHARS */ -#ifndef WINVER -# define WINVER 0x0500 -#endif - -#include -#include -#include -#include - -#if 0 -# define MAKE_EXE -# define MAKE_DLL -# define USE_LIBICONV_DLL -#endif - -#if !defined(DEFAULT_LIBICONV_DLL) -# define DEFAULT_LIBICONV_DLL "" -#endif - -#define MB_CHAR_MAX 16 - -#define UNICODE_MODE_BOM_DONE 1 -#define UNICODE_MODE_SWAPPED 2 - -#define FLAG_USE_BOM 1 -#define FLAG_TRANSLIT 2 /* //TRANSLIT */ -#define FLAG_IGNORE 4 /* //IGNORE (not implemented) */ - -typedef unsigned char uchar; -typedef unsigned short ushort; -typedef unsigned int uint; - -typedef void* iconv_t; - -iconv_t iconv_open(const char *tocode, const char *fromcode); -int iconv_close(iconv_t cd); -size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); - -/* libiconv interface for vim */ -#if defined(MAKE_DLL) -int -iconvctl (iconv_t cd, int request, void* argument) -{ - /* not supported */ - return 0; -} -#endif - -typedef struct compat_t compat_t; -typedef struct csconv_t csconv_t; -typedef struct rec_iconv_t rec_iconv_t; - -typedef iconv_t (*f_iconv_open)(const char *tocode, const char *fromcode); -typedef int (*f_iconv_close)(iconv_t cd); -typedef size_t (*f_iconv)(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); -typedef int* (*f_errno)(void); -typedef int (*f_mbtowc)(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); -typedef int (*f_wctomb)(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); -typedef int (*f_mblen)(csconv_t *cv, const uchar *buf, int bufsize); -typedef int (*f_flush)(csconv_t *cv, uchar *buf, int bufsize); - -#define COMPAT_IN 1 -#define COMPAT_OUT 2 - -/* unicode mapping for compatibility with other conversion table. */ -struct compat_t { - uint in; - uint out; - uint flag; -}; - -struct csconv_t { - int codepage; - int flags; - f_mbtowc mbtowc; - f_wctomb wctomb; - f_mblen mblen; - f_flush flush; - DWORD mode; - compat_t *compat; -}; - -struct rec_iconv_t { - iconv_t cd; - f_iconv_close iconv_close; - f_iconv iconv; - f_errno _errno; - csconv_t from; - csconv_t to; -#if defined(USE_LIBICONV_DLL) - HMODULE hlibiconv; -#endif -}; - -static int win_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode); -static int win_iconv_close(iconv_t cd); -static size_t win_iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); - -static int load_mlang(); -static int make_csconv(const char *name, csconv_t *cv); -static int name_to_codepage(const char *name); -static uint utf16_to_ucs4(const ushort *wbuf); -static void ucs4_to_utf16(uint wc, ushort *wbuf, int *wbufsize); -static int mbtowc_flags(int codepage); -static int must_use_null_useddefaultchar(int codepage); -static char *strrstr(const char *str, const char *token); -static char *xstrndup(const char *s, size_t n); -static int seterror(int err); - -#if defined(USE_LIBICONV_DLL) -static int libiconv_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode); -static PVOID MyImageDirectoryEntryToData(LPVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size); -static HMODULE find_imported_module_by_funcname(HMODULE hModule, const char *funcname); - -static HMODULE hwiniconv; -#endif - -static int sbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize); -static int dbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize); -static int mbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize); -static int utf8_mblen(csconv_t *cv, const uchar *buf, int bufsize); -static int eucjp_mblen(csconv_t *cv, const uchar *buf, int bufsize); - -static int kernel_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); -static int kernel_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); -static int mlang_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); -static int mlang_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); -static int utf16_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); -static int utf16_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); -static int utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); -static int utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); -static int iso2022jp_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); -static int iso2022jp_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); -static int iso2022jp_flush(csconv_t *cv, uchar *buf, int bufsize); - -static struct { - int codepage; - const char *name; -} codepage_alias[] = { - {65001, "CP65001"}, - {65001, "UTF8"}, - {65001, "UTF-8"}, - - {1200, "CP1200"}, - {1200, "UTF16LE"}, - {1200, "UTF-16LE"}, - {1200, "UCS-2LE"}, - - {1201, "CP1201"}, - {1201, "UTF16BE"}, - {1201, "UTF-16BE"}, - {1201, "UCS-2BE"}, - {1201, "unicodeFFFE"}, - - {12000, "CP12000"}, - {12000, "UTF32LE"}, - {12000, "UTF-32LE"}, - - {12001, "CP12001"}, - {12001, "UTF32BE"}, - {12001, "UTF-32BE"}, - -#ifndef GLIB_COMPILATION - /* - * Default is big endian. - * See rfc2781 4.3 Interpreting text labelled as UTF-16. - */ - {1201, "UTF16"}, - {1201, "UTF-16"}, - {12001, "UTF32"}, - {12001, "UTF-32"}, -#else - /* Default is little endian, because the platform is */ - {1200, "UTF16"}, - {1200, "UTF-16"}, - {1200, "UCS-2"}, - {12000, "UTF32"}, - {12000, "UTF-32"}, -#endif - - /* copy from libiconv `iconv -l` */ - /* !IsValidCodePage(367) */ - {20127, "ANSI_X3.4-1968"}, - {20127, "ANSI_X3.4-1986"}, - {20127, "ASCII"}, - {20127, "CP367"}, - {20127, "IBM367"}, - {20127, "ISO-IR-6"}, - {20127, "ISO646-US"}, - {20127, "ISO_646.IRV:1991"}, - {20127, "US"}, - {20127, "US-ASCII"}, - {20127, "CSASCII"}, - - /* !IsValidCodePage(819) */ - {1252, "CP819"}, - {1252, "IBM819"}, - {28591, "ISO-8859-1"}, - {28591, "ISO-IR-100"}, - {28591, "ISO8859-1"}, - {28591, "ISO_8859-1"}, - {28591, "ISO_8859-1:1987"}, - {28591, "L1"}, - {28591, "LATIN1"}, - {28591, "CSISOLATIN1"}, - - {1250, "CP1250"}, - {1250, "MS-EE"}, - {1250, "WINDOWS-1250"}, - - {1251, "CP1251"}, - {1251, "MS-CYRL"}, - {1251, "WINDOWS-1251"}, - - {1252, "CP1252"}, - {1252, "MS-ANSI"}, - {1252, "WINDOWS-1252"}, - - {1253, "CP1253"}, - {1253, "MS-GREEK"}, - {1253, "WINDOWS-1253"}, - - {1254, "CP1254"}, - {1254, "MS-TURK"}, - {1254, "WINDOWS-1254"}, - - {1255, "CP1255"}, - {1255, "MS-HEBR"}, - {1255, "WINDOWS-1255"}, - - {1256, "CP1256"}, - {1256, "MS-ARAB"}, - {1256, "WINDOWS-1256"}, - - {1257, "CP1257"}, - {1257, "WINBALTRIM"}, - {1257, "WINDOWS-1257"}, - - {1258, "CP1258"}, - {1258, "WINDOWS-1258"}, - - {850, "850"}, - {850, "CP850"}, - {850, "IBM850"}, - {850, "CSPC850MULTILINGUAL"}, - - /* !IsValidCodePage(862) */ - {862, "862"}, - {862, "CP862"}, - {862, "IBM862"}, - {862, "CSPC862LATINHEBREW"}, - - {866, "866"}, - {866, "CP866"}, - {866, "IBM866"}, - {866, "CSIBM866"}, - - /* !IsValidCodePage(154) */ - {154, "CP154"}, - {154, "CYRILLIC-ASIAN"}, - {154, "PT154"}, - {154, "PTCP154"}, - {154, "CSPTCP154"}, - - /* !IsValidCodePage(1133) */ - {1133, "CP1133"}, - {1133, "IBM-CP1133"}, - - {874, "CP874"}, - {874, "WINDOWS-874"}, - - /* !IsValidCodePage(51932) */ - {51932, "CP51932"}, - {51932, "MS51932"}, - {51932, "WINDOWS-51932"}, - {51932, "EUC-JP"}, - - {932, "CP932"}, - {932, "MS932"}, - {932, "SHIFFT_JIS"}, - {932, "SHIFFT_JIS-MS"}, - {932, "SJIS"}, - {932, "SJIS-MS"}, - {932, "SJIS-OPEN"}, - {932, "SJIS-WIN"}, - {932, "WINDOWS-31J"}, - {932, "WINDOWS-932"}, - {932, "CSWINDOWS31J"}, - - {50221, "CP50221"}, - {50221, "ISO-2022-JP"}, - {50221, "ISO-2022-JP-MS"}, - {50221, "ISO2022-JP"}, - {50221, "ISO2022-JP-MS"}, - {50221, "MS50221"}, - {50221, "WINDOWS-50221"}, - - {936, "CP936"}, - {936, "GBK"}, - {936, "MS936"}, - {936, "WINDOWS-936"}, - - {950, "CP950"}, - {950, "BIG5"}, - - {949, "CP949"}, - {949, "UHC"}, - {949, "EUC-KR"}, - - {1361, "CP1361"}, - {1361, "JOHAB"}, - - {437, "437"}, - {437, "CP437"}, - {437, "IBM437"}, - {437, "CSPC8CODEPAGE437"}, - - {737, "CP737"}, - - {775, "CP775"}, - {775, "IBM775"}, - {775, "CSPC775BALTIC"}, - - {852, "852"}, - {852, "CP852"}, - {852, "IBM852"}, - {852, "CSPCP852"}, - - /* !IsValidCodePage(853) */ - {853, "CP853"}, - - {855, "855"}, - {855, "CP855"}, - {855, "IBM855"}, - {855, "CSIBM855"}, - - {857, "857"}, - {857, "CP857"}, - {857, "IBM857"}, - {857, "CSIBM857"}, - - /* !IsValidCodePage(858) */ - {858, "CP858"}, - - {860, "860"}, - {860, "CP860"}, - {860, "IBM860"}, - {860, "CSIBM860"}, - - {861, "861"}, - {861, "CP-IS"}, - {861, "CP861"}, - {861, "IBM861"}, - {861, "CSIBM861"}, - - {863, "863"}, - {863, "CP863"}, - {863, "IBM863"}, - {863, "CSIBM863"}, - - {864, "CP864"}, - {864, "IBM864"}, - {864, "CSIBM864"}, - - {865, "865"}, - {865, "CP865"}, - {865, "IBM865"}, - {865, "CSIBM865"}, - - {869, "869"}, - {869, "CP-GR"}, - {869, "CP869"}, - {869, "IBM869"}, - {869, "CSIBM869"}, - - /* !IsValidCodePage(1152) */ - {1125, "CP1125"}, - - /* - * Code Page Identifiers - * http://msdn2.microsoft.com/en-us/library/ms776446.aspx - */ - {37, "IBM037"}, /* IBM EBCDIC US-Canada */ - {437, "IBM437"}, /* OEM United States */ - {500, "IBM500"}, /* IBM EBCDIC International */ - {708, "ASMO-708"}, /* Arabic (ASMO 708) */ - /* 709 Arabic (ASMO-449+, BCON V4) */ - /* 710 Arabic - Transparent Arabic */ - {720, "DOS-720"}, /* Arabic (Transparent ASMO); Arabic (DOS) */ - {737, "ibm737"}, /* OEM Greek (formerly 437G); Greek (DOS) */ - {775, "ibm775"}, /* OEM Baltic; Baltic (DOS) */ - {850, "ibm850"}, /* OEM Multilingual Latin 1; Western European (DOS) */ - {852, "ibm852"}, /* OEM Latin 2; Central European (DOS) */ - {855, "IBM855"}, /* OEM Cyrillic (primarily Russian) */ - {857, "ibm857"}, /* OEM Turkish; Turkish (DOS) */ - {858, "IBM00858"}, /* OEM Multilingual Latin 1 + Euro symbol */ - {860, "IBM860"}, /* OEM Portuguese; Portuguese (DOS) */ - {861, "ibm861"}, /* OEM Icelandic; Icelandic (DOS) */ - {862, "DOS-862"}, /* OEM Hebrew; Hebrew (DOS) */ - {863, "IBM863"}, /* OEM French Canadian; French Canadian (DOS) */ - {864, "IBM864"}, /* OEM Arabic; Arabic (864) */ - {865, "IBM865"}, /* OEM Nordic; Nordic (DOS) */ - {866, "cp866"}, /* OEM Russian; Cyrillic (DOS) */ - {869, "ibm869"}, /* OEM Modern Greek; Greek, Modern (DOS) */ - {870, "IBM870"}, /* IBM EBCDIC Multilingual/ROECE (Latin 2); IBM EBCDIC Multilingual Latin 2 */ - {874, "windows-874"}, /* ANSI/OEM Thai (same as 28605, ISO 8859-15); Thai (Windows) */ - {875, "cp875"}, /* IBM EBCDIC Greek Modern */ - {932, "shift_jis"}, /* ANSI/OEM Japanese; Japanese (Shift-JIS) */ - {932, "shift-jis"}, /* alternative name for it */ - {936, "gb2312"}, /* ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312) */ - {949, "ks_c_5601-1987"}, /* ANSI/OEM Korean (Unified Hangul Code) */ - {950, "big5"}, /* ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5) */ - {1026, "IBM1026"}, /* IBM EBCDIC Turkish (Latin 5) */ - {1047, "IBM01047"}, /* IBM EBCDIC Latin 1/Open System */ - {1140, "IBM01140"}, /* IBM EBCDIC US-Canada (037 + Euro symbol); IBM EBCDIC (US-Canada-Euro) */ - {1141, "IBM01141"}, /* IBM EBCDIC Germany (20273 + Euro symbol); IBM EBCDIC (Germany-Euro) */ - {1142, "IBM01142"}, /* IBM EBCDIC Denmark-Norway (20277 + Euro symbol); IBM EBCDIC (Denmark-Norway-Euro) */ - {1143, "IBM01143"}, /* IBM EBCDIC Finland-Sweden (20278 + Euro symbol); IBM EBCDIC (Finland-Sweden-Euro) */ - {1144, "IBM01144"}, /* IBM EBCDIC Italy (20280 + Euro symbol); IBM EBCDIC (Italy-Euro) */ - {1145, "IBM01145"}, /* IBM EBCDIC Latin America-Spain (20284 + Euro symbol); IBM EBCDIC (Spain-Euro) */ - {1146, "IBM01146"}, /* IBM EBCDIC United Kingdom (20285 + Euro symbol); IBM EBCDIC (UK-Euro) */ - {1147, "IBM01147"}, /* IBM EBCDIC France (20297 + Euro symbol); IBM EBCDIC (France-Euro) */ - {1148, "IBM01148"}, /* IBM EBCDIC International (500 + Euro symbol); IBM EBCDIC (International-Euro) */ - {1149, "IBM01149"}, /* IBM EBCDIC Icelandic (20871 + Euro symbol); IBM EBCDIC (Icelandic-Euro) */ - {1250, "windows-1250"}, /* ANSI Central European; Central European (Windows) */ - {1251, "windows-1251"}, /* ANSI Cyrillic; Cyrillic (Windows) */ - {1252, "windows-1252"}, /* ANSI Latin 1; Western European (Windows) */ - {1253, "windows-1253"}, /* ANSI Greek; Greek (Windows) */ - {1254, "windows-1254"}, /* ANSI Turkish; Turkish (Windows) */ - {1255, "windows-1255"}, /* ANSI Hebrew; Hebrew (Windows) */ - {1256, "windows-1256"}, /* ANSI Arabic; Arabic (Windows) */ - {1257, "windows-1257"}, /* ANSI Baltic; Baltic (Windows) */ - {1258, "windows-1258"}, /* ANSI/OEM Vietnamese; Vietnamese (Windows) */ - {1361, "Johab"}, /* Korean (Johab) */ - {10000, "macintosh"}, /* MAC Roman; Western European (Mac) */ - {10001, "x-mac-japanese"}, /* Japanese (Mac) */ - {10002, "x-mac-chinesetrad"}, /* MAC Traditional Chinese (Big5); Chinese Traditional (Mac) */ - {10003, "x-mac-korean"}, /* Korean (Mac) */ - {10004, "x-mac-arabic"}, /* Arabic (Mac) */ - {10005, "x-mac-hebrew"}, /* Hebrew (Mac) */ - {10006, "x-mac-greek"}, /* Greek (Mac) */ - {10007, "x-mac-cyrillic"}, /* Cyrillic (Mac) */ - {10008, "x-mac-chinesesimp"}, /* MAC Simplified Chinese (GB 2312); Chinese Simplified (Mac) */ - {10010, "x-mac-romanian"}, /* Romanian (Mac) */ - {10017, "x-mac-ukrainian"}, /* Ukrainian (Mac) */ - {10021, "x-mac-thai"}, /* Thai (Mac) */ - {10029, "x-mac-ce"}, /* MAC Latin 2; Central European (Mac) */ - {10079, "x-mac-icelandic"}, /* Icelandic (Mac) */ - {10081, "x-mac-turkish"}, /* Turkish (Mac) */ - {10082, "x-mac-croatian"}, /* Croatian (Mac) */ - {20000, "x-Chinese_CNS"}, /* CNS Taiwan; Chinese Traditional (CNS) */ - {20001, "x-cp20001"}, /* TCA Taiwan */ - {20002, "x_Chinese-Eten"}, /* Eten Taiwan; Chinese Traditional (Eten) */ - {20003, "x-cp20003"}, /* IBM5550 Taiwan */ - {20004, "x-cp20004"}, /* TeleText Taiwan */ - {20005, "x-cp20005"}, /* Wang Taiwan */ - {20105, "x-IA5"}, /* IA5 (IRV International Alphabet No. 5, 7-bit); Western European (IA5) */ - {20106, "x-IA5-German"}, /* IA5 German (7-bit) */ - {20107, "x-IA5-Swedish"}, /* IA5 Swedish (7-bit) */ - {20108, "x-IA5-Norwegian"}, /* IA5 Norwegian (7-bit) */ - {20127, "us-ascii"}, /* US-ASCII (7-bit) */ - {20261, "x-cp20261"}, /* T.61 */ - {20269, "x-cp20269"}, /* ISO 6937 Non-Spacing Accent */ - {20273, "IBM273"}, /* IBM EBCDIC Germany */ - {20277, "IBM277"}, /* IBM EBCDIC Denmark-Norway */ - {20278, "IBM278"}, /* IBM EBCDIC Finland-Sweden */ - {20280, "IBM280"}, /* IBM EBCDIC Italy */ - {20284, "IBM284"}, /* IBM EBCDIC Latin America-Spain */ - {20285, "IBM285"}, /* IBM EBCDIC United Kingdom */ - {20290, "IBM290"}, /* IBM EBCDIC Japanese Katakana Extended */ - {20297, "IBM297"}, /* IBM EBCDIC France */ - {20420, "IBM420"}, /* IBM EBCDIC Arabic */ - {20423, "IBM423"}, /* IBM EBCDIC Greek */ - {20424, "IBM424"}, /* IBM EBCDIC Hebrew */ - {20833, "x-EBCDIC-KoreanExtended"}, /* IBM EBCDIC Korean Extended */ - {20838, "IBM-Thai"}, /* IBM EBCDIC Thai */ - {20866, "koi8-r"}, /* Russian (KOI8-R); Cyrillic (KOI8-R) */ - {20871, "IBM871"}, /* IBM EBCDIC Icelandic */ - {20880, "IBM880"}, /* IBM EBCDIC Cyrillic Russian */ - {20905, "IBM905"}, /* IBM EBCDIC Turkish */ - {20924, "IBM00924"}, /* IBM EBCDIC Latin 1/Open System (1047 + Euro symbol) */ - {20932, "EUC-JP"}, /* Japanese (JIS 0208-1990 and 0121-1990) */ - {20936, "x-cp20936"}, /* Simplified Chinese (GB2312); Chinese Simplified (GB2312-80) */ - {20949, "x-cp20949"}, /* Korean Wansung */ - {21025, "cp1025"}, /* IBM EBCDIC Cyrillic Serbian-Bulgarian */ - /* 21027 (deprecated) */ - {21866, "koi8-u"}, /* Ukrainian (KOI8-U); Cyrillic (KOI8-U) */ - {28591, "iso-8859-1"}, /* ISO 8859-1 Latin 1; Western European (ISO) */ - {28591, "iso8859-1"}, /* ISO 8859-1 Latin 1; Western European (ISO) */ - {28592, "iso-8859-2"}, /* ISO 8859-2 Central European; Central European (ISO) */ - {28592, "iso8859-2"}, /* ISO 8859-2 Central European; Central European (ISO) */ - {28593, "iso-8859-3"}, /* ISO 8859-3 Latin 3 */ - {28593, "iso8859-3"}, /* ISO 8859-3 Latin 3 */ - {28594, "iso-8859-4"}, /* ISO 8859-4 Baltic */ - {28594, "iso8859-4"}, /* ISO 8859-4 Baltic */ - {28595, "iso-8859-5"}, /* ISO 8859-5 Cyrillic */ - {28595, "iso8859-5"}, /* ISO 8859-5 Cyrillic */ - {28596, "iso-8859-6"}, /* ISO 8859-6 Arabic */ - {28596, "iso8859-6"}, /* ISO 8859-6 Arabic */ - {28597, "iso-8859-7"}, /* ISO 8859-7 Greek */ - {28597, "iso8859-7"}, /* ISO 8859-7 Greek */ - {28598, "iso-8859-8"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Visual) */ - {28598, "iso8859-8"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Visual) */ - {28599, "iso-8859-9"}, /* ISO 8859-9 Turkish */ - {28599, "iso8859-9"}, /* ISO 8859-9 Turkish */ - {28603, "iso-8859-13"}, /* ISO 8859-13 Estonian */ - {28603, "iso8859-13"}, /* ISO 8859-13 Estonian */ - {28605, "iso-8859-15"}, /* ISO 8859-15 Latin 9 */ - {28605, "iso8859-15"}, /* ISO 8859-15 Latin 9 */ - {29001, "x-Europa"}, /* Europa 3 */ - {38598, "iso-8859-8-i"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Logical) */ - {38598, "iso8859-8-i"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Logical) */ - {50220, "iso-2022-jp"}, /* ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS) */ - {50221, "csISO2022JP"}, /* ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana) */ - {50222, "iso-2022-jp"}, /* ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI) */ - {50225, "iso-2022-kr"}, /* ISO 2022 Korean */ - {50225, "iso2022-kr"}, /* ISO 2022 Korean */ - {50227, "x-cp50227"}, /* ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022) */ - /* 50229 ISO 2022 Traditional Chinese */ - /* 50930 EBCDIC Japanese (Katakana) Extended */ - /* 50931 EBCDIC US-Canada and Japanese */ - /* 50933 EBCDIC Korean Extended and Korean */ - /* 50935 EBCDIC Simplified Chinese Extended and Simplified Chinese */ - /* 50936 EBCDIC Simplified Chinese */ - /* 50937 EBCDIC US-Canada and Traditional Chinese */ - /* 50939 EBCDIC Japanese (Latin) Extended and Japanese */ - {51932, "euc-jp"}, /* EUC Japanese */ - {51936, "EUC-CN"}, /* EUC Simplified Chinese; Chinese Simplified (EUC) */ - {51949, "euc-kr"}, /* EUC Korean */ - /* 51950 EUC Traditional Chinese */ - {52936, "hz-gb-2312"}, /* HZ-GB2312 Simplified Chinese; Chinese Simplified (HZ) */ - {54936, "GB18030"}, /* Windows XP and later: GB18030 Simplified Chinese (4 byte); Chinese Simplified (GB18030) */ - {57002, "x-iscii-de"}, /* ISCII Devanagari */ - {57003, "x-iscii-be"}, /* ISCII Bengali */ - {57004, "x-iscii-ta"}, /* ISCII Tamil */ - {57005, "x-iscii-te"}, /* ISCII Telugu */ - {57006, "x-iscii-as"}, /* ISCII Assamese */ - {57007, "x-iscii-or"}, /* ISCII Oriya */ - {57008, "x-iscii-ka"}, /* ISCII Kannada */ - {57009, "x-iscii-ma"}, /* ISCII Malayalam */ - {57010, "x-iscii-gu"}, /* ISCII Gujarati */ - {57011, "x-iscii-pa"}, /* ISCII Punjabi */ - - {0, NULL} -}; - -/* - * SJIS SHIFTJIS table CP932 table - * ---- --------------------------- -------------------------------- - * 5C U+00A5 YEN SIGN U+005C REVERSE SOLIDUS - * 7E U+203E OVERLINE U+007E TILDE - * 815C U+2014 EM DASH U+2015 HORIZONTAL BAR - * 815F U+005C REVERSE SOLIDUS U+FF3C FULLWIDTH REVERSE SOLIDUS - * 8160 U+301C WAVE DASH U+FF5E FULLWIDTH TILDE - * 8161 U+2016 DOUBLE VERTICAL LINE U+2225 PARALLEL TO - * 817C U+2212 MINUS SIGN U+FF0D FULLWIDTH HYPHEN-MINUS - * 8191 U+00A2 CENT SIGN U+FFE0 FULLWIDTH CENT SIGN - * 8192 U+00A3 POUND SIGN U+FFE1 FULLWIDTH POUND SIGN - * 81CA U+00AC NOT SIGN U+FFE2 FULLWIDTH NOT SIGN - * - * EUC-JP and ISO-2022-JP should be compatible with CP932. - * - * Kernel and MLang have different Unicode mapping table. Make sure - * which API is used. - */ -static compat_t cp932_compat[] = { - {0x00A5, 0x005C, COMPAT_OUT}, - {0x203E, 0x007E, COMPAT_OUT}, - {0x2014, 0x2015, COMPAT_OUT}, - {0x301C, 0xFF5E, COMPAT_OUT}, - {0x2016, 0x2225, COMPAT_OUT}, - {0x2212, 0xFF0D, COMPAT_OUT}, - {0x00A2, 0xFFE0, COMPAT_OUT}, - {0x00A3, 0xFFE1, COMPAT_OUT}, - {0x00AC, 0xFFE2, COMPAT_OUT}, - {0, 0, 0} -}; - -static compat_t cp20932_compat[] = { - {0x00A5, 0x005C, COMPAT_OUT}, - {0x203E, 0x007E, COMPAT_OUT}, - {0x2014, 0x2015, COMPAT_OUT}, - {0xFF5E, 0x301C, COMPAT_OUT|COMPAT_IN}, - {0x2225, 0x2016, COMPAT_OUT|COMPAT_IN}, - {0xFF0D, 0x2212, COMPAT_OUT|COMPAT_IN}, - {0xFFE0, 0x00A2, COMPAT_OUT|COMPAT_IN}, - {0xFFE1, 0x00A3, COMPAT_OUT|COMPAT_IN}, - {0xFFE2, 0x00AC, COMPAT_OUT|COMPAT_IN}, - {0, 0, 0} -}; - -static compat_t *cp51932_compat = cp932_compat; - -/* cp20932_compat for kernel. cp932_compat for mlang. */ -static compat_t *cp5022x_compat = cp932_compat; - -typedef HRESULT (WINAPI *CONVERTINETSTRING)( - LPDWORD lpdwMode, - DWORD dwSrcEncoding, - DWORD dwDstEncoding, - LPCSTR lpSrcStr, - LPINT lpnSrcSize, - LPBYTE lpDstStr, - LPINT lpnDstSize -); -typedef HRESULT (WINAPI *CONVERTINETMULTIBYTETOUNICODE)( - LPDWORD lpdwMode, - DWORD dwSrcEncoding, - LPCSTR lpSrcStr, - LPINT lpnMultiCharCount, - LPWSTR lpDstStr, - LPINT lpnWideCharCount -); -typedef HRESULT (WINAPI *CONVERTINETUNICODETOMULTIBYTE)( - LPDWORD lpdwMode, - DWORD dwEncoding, - LPCWSTR lpSrcStr, - LPINT lpnWideCharCount, - LPSTR lpDstStr, - LPINT lpnMultiCharCount -); -typedef HRESULT (WINAPI *ISCONVERTINETSTRINGAVAILABLE)( - DWORD dwSrcEncoding, - DWORD dwDstEncoding -); -typedef HRESULT (WINAPI *LCIDTORFC1766A)( - LCID Locale, - LPSTR pszRfc1766, - int nChar -); -typedef HRESULT (WINAPI *LCIDTORFC1766W)( - LCID Locale, - LPWSTR pszRfc1766, - int nChar -); -typedef HRESULT (WINAPI *RFC1766TOLCIDA)( - LCID *pLocale, - LPSTR pszRfc1766 -); -typedef HRESULT (WINAPI *RFC1766TOLCIDW)( - LCID *pLocale, - LPWSTR pszRfc1766 -); -static CONVERTINETSTRING ConvertINetString; -static CONVERTINETMULTIBYTETOUNICODE ConvertINetMultiByteToUnicode; -static CONVERTINETUNICODETOMULTIBYTE ConvertINetUnicodeToMultiByte; -static ISCONVERTINETSTRINGAVAILABLE IsConvertINetStringAvailable; -static LCIDTORFC1766A LcidToRfc1766A; -static RFC1766TOLCIDA Rfc1766ToLcidA; - -static int -load_mlang() -{ - HMODULE h; - if (ConvertINetString != NULL) - return TRUE; - h = LoadLibrary("mlang.dll"); - if (!h) - return FALSE; - ConvertINetString = (CONVERTINETSTRING)GetProcAddress(h, "ConvertINetString"); - ConvertINetMultiByteToUnicode = (CONVERTINETMULTIBYTETOUNICODE)GetProcAddress(h, "ConvertINetMultiByteToUnicode"); - ConvertINetUnicodeToMultiByte = (CONVERTINETUNICODETOMULTIBYTE)GetProcAddress(h, "ConvertINetUnicodeToMultiByte"); - IsConvertINetStringAvailable = (ISCONVERTINETSTRINGAVAILABLE)GetProcAddress(h, "IsConvertINetStringAvailable"); - LcidToRfc1766A = (LCIDTORFC1766A)GetProcAddress(h, "LcidToRfc1766A"); - Rfc1766ToLcidA = (RFC1766TOLCIDA)GetProcAddress(h, "Rfc1766ToLcidA"); - return TRUE; -} - -iconv_t -iconv_open(const char *tocode, const char *fromcode) -{ - rec_iconv_t *cd; - - cd = (rec_iconv_t *)calloc(1, sizeof(rec_iconv_t)); - if (cd == NULL) - return (iconv_t)(-1); - -#if defined(USE_LIBICONV_DLL) - errno = 0; - if (libiconv_iconv_open(cd, tocode, fromcode)) - return (iconv_t)cd; -#endif - - /* reset the errno to prevent reporting wrong error code. - * 0 for unsorted error. */ - errno = 0; - if (win_iconv_open(cd, tocode, fromcode)) - return (iconv_t)cd; - - free(cd); - - return (iconv_t)(-1); -} - -int -iconv_close(iconv_t _cd) -{ - rec_iconv_t *cd = (rec_iconv_t *)_cd; - int r = cd->iconv_close(cd->cd); - int e = *(cd->_errno()); -#if defined(USE_LIBICONV_DLL) - if (cd->hlibiconv != NULL) - FreeLibrary(cd->hlibiconv); -#endif - free(cd); - errno = e; - return r; -} - -size_t -iconv(iconv_t _cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) -{ - rec_iconv_t *cd = (rec_iconv_t *)_cd; - size_t r = cd->iconv(cd->cd, inbuf, inbytesleft, outbuf, outbytesleft); - errno = *(cd->_errno()); - return r; -} - -static int -win_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode) -{ - if (!make_csconv(fromcode, &cd->from) || !make_csconv(tocode, &cd->to)) - return FALSE; - cd->iconv_close = win_iconv_close; - cd->iconv = win_iconv; - cd->_errno = _errno; - cd->cd = (iconv_t)cd; - return TRUE; -} - -static int -win_iconv_close(iconv_t cd) -{ - return 0; -} - -static size_t -win_iconv(iconv_t _cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) -{ - rec_iconv_t *cd = (rec_iconv_t *)_cd; - ushort wbuf[MB_CHAR_MAX]; /* enough room for one character */ - int insize; - int outsize; - int wsize; - DWORD frommode; - DWORD tomode; - uint wc; - compat_t *cp; - int i; - - if (inbuf == NULL || *inbuf == NULL) - { - if (outbuf != NULL && *outbuf != NULL && cd->to.flush != NULL) - { - tomode = cd->to.mode; - outsize = cd->to.flush(&cd->to, (uchar *)*outbuf, *outbytesleft); - if (outsize == -1) - { - cd->to.mode = tomode; - return (size_t)(-1); - } - *outbuf += outsize; - *outbytesleft -= outsize; - } - cd->from.mode = 0; - cd->to.mode = 0; - return 0; - } - - while (*inbytesleft != 0) - { - frommode = cd->from.mode; - tomode = cd->to.mode; - wsize = MB_CHAR_MAX; - - insize = cd->from.mbtowc(&cd->from, (const uchar *)*inbuf, *inbytesleft, wbuf, &wsize); - if (insize == -1) - { - cd->from.mode = frommode; - return (size_t)(-1); - } - - if (wsize == 0) - { - *inbuf += insize; - *inbytesleft -= insize; - continue; - } - - if (cd->from.compat != NULL) - { - wc = utf16_to_ucs4(wbuf); - cp = cd->from.compat; - for (i = 0; cp[i].in != 0; ++i) - { - if ((cp[i].flag & COMPAT_IN) && cp[i].out == wc) - { - ucs4_to_utf16(cp[i].in, wbuf, &wsize); - break; - } - } - } - - if (cd->to.compat != NULL) - { - wc = utf16_to_ucs4(wbuf); - cp = cd->to.compat; - for (i = 0; cp[i].in != 0; ++i) - { - if ((cp[i].flag & COMPAT_OUT) && cp[i].in == wc) - { - ucs4_to_utf16(cp[i].out, wbuf, &wsize); - break; - } - } - } - - outsize = cd->to.wctomb(&cd->to, wbuf, wsize, (uchar *)*outbuf, *outbytesleft); - if (outsize == -1) - { - cd->from.mode = frommode; - cd->to.mode = tomode; - return (size_t)(-1); - } - - *inbuf += insize; - *outbuf += outsize; - *inbytesleft -= insize; - *outbytesleft -= outsize; - } - - return 0; -} - -static int -make_csconv(const char *_name, csconv_t *cv) -{ - CPINFOEX cpinfoex; - int use_compat = TRUE; - int flag = 0; - char *name; - char *p; - - name = xstrndup(_name, strlen(_name)); - if (name == NULL) - return FALSE; - - /* check for option "enc_name//opt1//opt2" */ - while ((p = strrstr(name, "//")) != NULL) - { - if (_stricmp(p + 2, "nocompat") == 0) - use_compat = FALSE; - else if (_stricmp(p + 2, "translit") == 0) - flag |= FLAG_TRANSLIT; - else if (_stricmp(p + 2, "ignore") == 0) - flag |= FLAG_IGNORE; - *p = 0; - } - - cv->mode = 0; - cv->flags = flag; - cv->mblen = NULL; - cv->flush = NULL; - cv->compat = NULL; - cv->codepage = name_to_codepage(name); - if (cv->codepage == 1200 || cv->codepage == 1201) - { - cv->mbtowc = utf16_mbtowc; - cv->wctomb = utf16_wctomb; - if (_stricmp(name, "UTF-16") == 0 || _stricmp(name, "UTF16") == 0) - cv->flags |= FLAG_USE_BOM; - } - else if (cv->codepage == 12000 || cv->codepage == 12001) - { - cv->mbtowc = utf32_mbtowc; - cv->wctomb = utf32_wctomb; - if (_stricmp(name, "UTF-32") == 0 || _stricmp(name, "UTF32") == 0) - cv->flags |= FLAG_USE_BOM; - } - else if (cv->codepage == 65001) - { - cv->mbtowc = kernel_mbtowc; - cv->wctomb = kernel_wctomb; - cv->mblen = utf8_mblen; - } - else if ((cv->codepage == 50220 || cv->codepage == 50221 || cv->codepage == 50222) && load_mlang()) - { - cv->mbtowc = iso2022jp_mbtowc; - cv->wctomb = iso2022jp_wctomb; - cv->flush = iso2022jp_flush; - } - else if (cv->codepage == 51932 && load_mlang()) - { - cv->mbtowc = mlang_mbtowc; - cv->wctomb = mlang_wctomb; - cv->mblen = eucjp_mblen; - } - else if (IsValidCodePage(cv->codepage) - && GetCPInfoEx(cv->codepage, 0, &cpinfoex) != 0) - { - cv->mbtowc = kernel_mbtowc; - cv->wctomb = kernel_wctomb; - if (cpinfoex.MaxCharSize == 1) - cv->mblen = sbcs_mblen; - else if (cpinfoex.MaxCharSize == 2) - cv->mblen = dbcs_mblen; - else - cv->mblen = mbcs_mblen; - } - else - { - /* not supported */ - free(name); - errno = EINVAL; - return FALSE; - } - - if (use_compat) - { - switch (cv->codepage) - { - case 932: cv->compat = cp932_compat; break; - case 20932: cv->compat = cp20932_compat; break; - case 51932: cv->compat = cp51932_compat; break; - case 50220: case 50221: case 50222: cv->compat = cp5022x_compat; break; - } - } - - free(name); - - return TRUE; -} - -static int -name_to_codepage(const char *name) -{ - int i; - - if (*name == '\0' || - strcmp(name, "char") == 0) - return GetACP(); - else if (strcmp(name, "wchar_t") == 0) - return 1200; - else if (_strnicmp(name, "cp", 2) == 0) - return atoi(name + 2); /* CP123 */ - else if ('0' <= name[0] && name[0] <= '9') - return atoi(name); /* 123 */ - else if (_strnicmp(name, "xx", 2) == 0) - return atoi(name + 2); /* XX123 for debug */ - - for (i = 0; codepage_alias[i].name != NULL; ++i) - if (_stricmp(name, codepage_alias[i].name) == 0) - return codepage_alias[i].codepage; - return -1; -} - -/* - * http://www.faqs.org/rfcs/rfc2781.html - */ -static uint -utf16_to_ucs4(const ushort *wbuf) -{ - uint wc = wbuf[0]; - if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF) - wc = ((wbuf[0] & 0x3FF) << 10) + (wbuf[1] & 0x3FF) + 0x10000; - return wc; -} - -static void -ucs4_to_utf16(uint wc, ushort *wbuf, int *wbufsize) -{ - if (wc < 0x10000) - { - wbuf[0] = wc; - *wbufsize = 1; - } - else - { - wc -= 0x10000; - wbuf[0] = 0xD800 | ((wc >> 10) & 0x3FF); - wbuf[1] = 0xDC00 | (wc & 0x3FF); - *wbufsize = 2; - } -} - -/* - * Check if codepage is one of those for which the dwFlags parameter - * to MultiByteToWideChar() must be zero. Return zero or - * MB_ERR_INVALID_CHARS. The docs in Platform SDK for for Windows - * Server 2003 R2 claims that also codepage 65001 is one of these, but - * that doesn't seem to be the case. The MSDN docs for MSVS2008 leave - * out 65001 (UTF-8), and that indeed seems to be the case on XP, it - * works fine to pass MB_ERR_INVALID_CHARS in dwFlags when converting - * from UTF-8. - */ -static int -mbtowc_flags(int codepage) -{ - return (codepage == 50220 || codepage == 50221 || - codepage == 50222 || codepage == 50225 || - codepage == 50227 || codepage == 50229 || - codepage == 52936 || codepage == 54936 || - (codepage >= 57002 && codepage <= 57011) || - codepage == 65000 || codepage == 42) ? 0 : MB_ERR_INVALID_CHARS; -} - -/* - * Check if codepage is one those for which the lpUsedDefaultChar - * parameter to WideCharToMultiByte() must be NULL. The docs in - * Platform SDK for for Windows Server 2003 R2 claims that this is the - * list below, while the MSDN docs for MSVS2008 claim that it is only - * for 65000 (UTF-7) and 65001 (UTF-8). This time the earlier Platform - * SDK seems to be correct, at least for XP. - */ -static int -must_use_null_useddefaultchar(int codepage) -{ - return (codepage == 65000 || codepage == 65001 || - codepage == 50220 || codepage == 50221 || - codepage == 50222 || codepage == 50225 || - codepage == 50227 || codepage == 50229 || - codepage == 52936 || codepage == 54936 || - (codepage >= 57002 && codepage <= 57011) || - codepage == 42); -} - -static char * -strrstr(const char *str, const char *token) -{ - int len = strlen(token); - const char *p = str + strlen(str); - - while (str <= --p) - if (p[0] == token[0] && strncmp(p, token, len) == 0) - return (char *)p; - return NULL; -} - -static char * -xstrndup(const char *s, size_t n) -{ - char *p; - - p = (char *)malloc(n + 1); - if (p == NULL) - return NULL; - memcpy(p, s, n); - p[n] = '\0'; - return p; -} - -static int -seterror(int err) -{ - errno = err; - return -1; -} - -#if defined(USE_LIBICONV_DLL) -static int -libiconv_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode) -{ - HMODULE hlibiconv = NULL; - HMODULE hmsvcrt = NULL; - char *dllname; - const char *p; - const char *e; - f_iconv_open _iconv_open; - - /* - * always try to load dll, so that we can switch dll in runtime. - */ - - /* XXX: getenv() can't get variable set by SetEnvironmentVariable() */ - p = getenv("WINICONV_LIBICONV_DLL"); - if (p == NULL) - p = DEFAULT_LIBICONV_DLL; - /* parse comma separated value */ - for ( ; *p != 0; p = (*e == ',') ? e + 1 : e) - { - e = strchr(p, ','); - if (p == e) - continue; - else if (e == NULL) - e = p + strlen(p); - dllname = xstrndup(p, e - p); - if (dllname == NULL) - return FALSE; - hlibiconv = LoadLibrary(dllname); - free(dllname); - if (hlibiconv != NULL) - { - if (hlibiconv == hwiniconv) - { - FreeLibrary(hlibiconv); - hlibiconv = NULL; - continue; - } - break; - } - } - - if (hlibiconv == NULL) - goto failed; - - hmsvcrt = find_imported_module_by_funcname(hlibiconv, "_errno"); - if (hmsvcrt == NULL) - goto failed; - - _iconv_open = (f_iconv_open)GetProcAddress(hlibiconv, "libiconv_open"); - if (_iconv_open == NULL) - _iconv_open = (f_iconv_open)GetProcAddress(hlibiconv, "iconv_open"); - cd->iconv_close = (f_iconv_close)GetProcAddress(hlibiconv, "libiconv_close"); - if (cd->iconv_close == NULL) - cd->iconv_close = (f_iconv_close)GetProcAddress(hlibiconv, "iconv_close"); - cd->iconv = (f_iconv)GetProcAddress(hlibiconv, "libiconv"); - if (cd->iconv == NULL) - cd->iconv = (f_iconv)GetProcAddress(hlibiconv, "iconv"); - cd->_errno = (f_errno)GetProcAddress(hmsvcrt, "_errno"); - if (_iconv_open == NULL || cd->iconv_close == NULL - || cd->iconv == NULL || cd->_errno == NULL) - goto failed; - - cd->cd = _iconv_open(tocode, fromcode); - if (cd->cd == (iconv_t)(-1)) - goto failed; - - cd->hlibiconv = hlibiconv; - return TRUE; - -failed: - if (hlibiconv != NULL) - FreeLibrary(hlibiconv); - /* do not free hmsvcrt which is obtained by GetModuleHandle() */ - return FALSE; -} - -/* - * Reference: - * http://forums.belution.com/ja/vc/000/234/78s.shtml - * http://nienie.com/~masapico/api_ImageDirectoryEntryToData.html - * - * The formal way is - * imagehlp.h or dbghelp.h - * imagehlp.lib or dbghelp.lib - * ImageDirectoryEntryToData() - */ -#define TO_DOS_HEADER(base) ((PIMAGE_DOS_HEADER)(base)) -#define TO_NT_HEADERS(base) ((PIMAGE_NT_HEADERS)((LPBYTE)(base) + TO_DOS_HEADER(base)->e_lfanew)) -static PVOID -MyImageDirectoryEntryToData(LPVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size) -{ - /* TODO: MappedAsImage? */ - PIMAGE_DATA_DIRECTORY p; - p = TO_NT_HEADERS(Base)->OptionalHeader.DataDirectory + DirectoryEntry; - if (p->VirtualAddress == 0) { - *Size = 0; - return NULL; - } - *Size = p->Size; - return (PVOID)((LPBYTE)Base + p->VirtualAddress); -} - -static HMODULE -find_imported_module_by_funcname(HMODULE hModule, const char *funcname) -{ - DWORD Base; - ULONG Size; - PIMAGE_IMPORT_DESCRIPTOR Imp; - PIMAGE_THUNK_DATA Name; /* Import Name Table */ - PIMAGE_IMPORT_BY_NAME ImpName; - - Base = (DWORD)hModule; - Imp = MyImageDirectoryEntryToData( - (LPVOID)Base, - TRUE, - IMAGE_DIRECTORY_ENTRY_IMPORT, - &Size); - if (Imp == NULL) - return NULL; - for ( ; Imp->OriginalFirstThunk != 0; ++Imp) - { - Name = (PIMAGE_THUNK_DATA)(Base + Imp->OriginalFirstThunk); - for ( ; Name->u1.Ordinal != 0; ++Name) - { - if (!IMAGE_SNAP_BY_ORDINAL(Name->u1.Ordinal)) - { - ImpName = (PIMAGE_IMPORT_BY_NAME) - (Base + (DWORD)Name->u1.AddressOfData); - if (strcmp((char *)ImpName->Name, funcname) == 0) - return GetModuleHandle((char *)(Base + Imp->Name)); - } - } - } - return NULL; -} -#endif - -static int -sbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize) -{ - return 1; -} - -static int -dbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize) -{ - int len = IsDBCSLeadByteEx(cv->codepage, buf[0]) ? 2 : 1; - if (bufsize < len) - return seterror(EINVAL); - return len; -} - -static int -mbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize) -{ - int len = 0; - - if (cv->codepage == 54936) { - if (buf[0] <= 0x7F) len = 1; - else if (buf[0] >= 0x81 && buf[0] <= 0xFE && - bufsize >= 2 && - ((buf[1] >= 0x40 && buf[1] <= 0x7E) || - (buf[1] >= 0x80 && buf[1] <= 0xFE))) len = 2; - else if (buf[0] >= 0x81 && buf[0] <= 0xFE && - bufsize >= 4 && - buf[1] >= 0x30 && buf[1] <= 0x39) len = 4; - else - return seterror(EINVAL); - return len; - } - else - return seterror(EINVAL); -} - -static int -utf8_mblen(csconv_t *cv, const uchar *buf, int bufsize) -{ - int len = 0; - - if (buf[0] < 0x80) len = 1; - else if ((buf[0] & 0xE0) == 0xC0) len = 2; - else if ((buf[0] & 0xF0) == 0xE0) len = 3; - else if ((buf[0] & 0xF8) == 0xF0) len = 4; - else if ((buf[0] & 0xFC) == 0xF8) len = 5; - else if ((buf[0] & 0xFE) == 0xFC) len = 6; - - if (len == 0) - return seterror(EILSEQ); - else if (bufsize < len) - return seterror(EINVAL); - return len; -} - -static int -eucjp_mblen(csconv_t *cv, const uchar *buf, int bufsize) -{ - if (buf[0] < 0x80) /* ASCII */ - return 1; - else if (buf[0] == 0x8E) /* JIS X 0201 */ - { - if (bufsize < 2) - return seterror(EINVAL); - else if (!(0xA1 <= buf[1] && buf[1] <= 0xDF)) - return seterror(EILSEQ); - return 2; - } - else if (buf[0] == 0x8F) /* JIS X 0212 */ - { - if (bufsize < 3) - return seterror(EINVAL); - else if (!(0xA1 <= buf[1] && buf[1] <= 0xFE) - || !(0xA1 <= buf[2] && buf[2] <= 0xFE)) - return seterror(EILSEQ); - return 3; - } - else /* JIS X 0208 */ - { - if (bufsize < 2) - return seterror(EINVAL); - else if (!(0xA1 <= buf[0] && buf[0] <= 0xFE) - || !(0xA1 <= buf[1] && buf[1] <= 0xFE)) - return seterror(EILSEQ); - return 2; - } -} - -static int -kernel_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) -{ - int len; - - len = cv->mblen(cv, buf, bufsize); - if (len == -1) - return -1; - *wbufsize = MultiByteToWideChar(cv->codepage, mbtowc_flags (cv->codepage), - (const char *)buf, len, (wchar_t *)wbuf, *wbufsize); - if (*wbufsize == 0) - return seterror(EILSEQ); - return len; -} - -static int -kernel_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) -{ - BOOL usedDefaultChar = 0; - BOOL *p = NULL; - int flags = 0; - int len; - - if (bufsize == 0) - return seterror(E2BIG); - if (!must_use_null_useddefaultchar(cv->codepage)) - { - p = &usedDefaultChar; -#ifdef WC_NO_BEST_FIT_CHARS - if (!(cv->flags & FLAG_TRANSLIT)) - flags |= WC_NO_BEST_FIT_CHARS; -#endif - } - len = WideCharToMultiByte(cv->codepage, flags, - (const wchar_t *)wbuf, wbufsize, (char *)buf, bufsize, NULL, p); - if (len == 0) - { - if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) - return seterror(E2BIG); - return seterror(EILSEQ); - } - else if (usedDefaultChar) - return seterror(EILSEQ); - else if (cv->mblen(cv, buf, len) != len) /* validate result */ - return seterror(EILSEQ); - return len; -} - -/* - * It seems that the mode (cv->mode) is fixnum. - * For example, when converting iso-2022-jp(cp50221) to unicode: - * in ascii sequence: mode=0xC42C0000 - * in jisx0208 sequence: mode=0xC42C0001 - * "C42C" is same for each convert session. - * It should be: ((codepage-1)<<16)|state - */ -static int -mlang_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) -{ - int len; - int insize; - HRESULT hr; - - len = cv->mblen(cv, buf, bufsize); - if (len == -1) - return -1; - insize = len; - hr = ConvertINetMultiByteToUnicode(&cv->mode, cv->codepage, - (const char *)buf, &insize, (wchar_t *)wbuf, wbufsize); - if (hr != S_OK || insize != len) - return seterror(EILSEQ); - return len; -} - -static int -mlang_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) -{ - char tmpbuf[MB_CHAR_MAX]; /* enough room for one character */ - int tmpsize = MB_CHAR_MAX; - int insize = wbufsize; - HRESULT hr; - - hr = ConvertINetUnicodeToMultiByte(&cv->mode, cv->codepage, - (const wchar_t *)wbuf, &wbufsize, tmpbuf, &tmpsize); - if (hr != S_OK || insize != wbufsize) - return seterror(EILSEQ); - else if (bufsize < tmpsize) - return seterror(E2BIG); - else if (cv->mblen(cv, (uchar *)tmpbuf, tmpsize) != tmpsize) - return seterror(EILSEQ); - memcpy(buf, tmpbuf, tmpsize); - return tmpsize; -} - -static int -utf16_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) -{ - int codepage = cv->codepage; - - /* swap endian: 1200 <-> 1201 */ - if (cv->mode & UNICODE_MODE_SWAPPED) - codepage ^= 1; - - if (bufsize < 2) - return seterror(EINVAL); - if (codepage == 1200) /* little endian */ - wbuf[0] = (buf[1] << 8) | buf[0]; - else if (codepage == 1201) /* big endian */ - wbuf[0] = (buf[0] << 8) | buf[1]; - - if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) - { - cv->mode |= UNICODE_MODE_BOM_DONE; - if (wbuf[0] == 0xFFFE) - { - cv->mode |= UNICODE_MODE_SWAPPED; - *wbufsize = 0; - return 2; - } - else if (wbuf[0] == 0xFEFF) - { - *wbufsize = 0; - return 2; - } - } - - if (0xDC00 <= wbuf[0] && wbuf[0] <= 0xDFFF) - return seterror(EILSEQ); - if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF) - { - if (bufsize < 4) - return seterror(EINVAL); - if (codepage == 1200) /* little endian */ - wbuf[1] = (buf[3] << 8) | buf[2]; - else if (codepage == 1201) /* big endian */ - wbuf[1] = (buf[2] << 8) | buf[3]; - if (!(0xDC00 <= wbuf[1] && wbuf[1] <= 0xDFFF)) - return seterror(EILSEQ); - *wbufsize = 2; - return 4; - } - *wbufsize = 1; - return 2; -} - -static int -utf16_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) -{ - if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) - { - int r; - - cv->mode |= UNICODE_MODE_BOM_DONE; - if (bufsize < 2) - return seterror(E2BIG); - if (cv->codepage == 1200) /* little endian */ - memcpy(buf, "\xFF\xFE", 2); - else if (cv->codepage == 1201) /* big endian */ - memcpy(buf, "\xFE\xFF", 2); - - r = utf16_wctomb(cv, wbuf, wbufsize, buf + 2, bufsize - 2); - if (r == -1) - return -1; - return r + 2; - } - - if (bufsize < 2) - return seterror(E2BIG); - if (cv->codepage == 1200) /* little endian */ - { - buf[0] = (wbuf[0] & 0x00FF); - buf[1] = (wbuf[0] & 0xFF00) >> 8; - } - else if (cv->codepage == 1201) /* big endian */ - { - buf[0] = (wbuf[0] & 0xFF00) >> 8; - buf[1] = (wbuf[0] & 0x00FF); - } - if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF) - { - if (bufsize < 4) - return seterror(E2BIG); - if (cv->codepage == 1200) /* little endian */ - { - buf[2] = (wbuf[1] & 0x00FF); - buf[3] = (wbuf[1] & 0xFF00) >> 8; - } - else if (cv->codepage == 1201) /* big endian */ - { - buf[2] = (wbuf[1] & 0xFF00) >> 8; - buf[3] = (wbuf[1] & 0x00FF); - } - return 4; - } - return 2; -} - -static int -utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) -{ - int codepage = cv->codepage; - uint wc = 0; - - /* swap endian: 12000 <-> 12001 */ - if (cv->mode & UNICODE_MODE_SWAPPED) - codepage ^= 1; - - if (bufsize < 4) - return seterror(EINVAL); - if (codepage == 12000) /* little endian */ - wc = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; - else if (codepage == 12001) /* big endian */ - wc = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; - - if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) - { - cv->mode |= UNICODE_MODE_BOM_DONE; - if (wc == 0xFFFE0000) - { - cv->mode |= UNICODE_MODE_SWAPPED; - *wbufsize = 0; - return 4; - } - else if (wc == 0x0000FEFF) - { - *wbufsize = 0; - return 4; - } - } - - if ((0xD800 <= wc && wc <= 0xDFFF) || 0x10FFFF < wc) - return seterror(EILSEQ); - ucs4_to_utf16(wc, wbuf, wbufsize); - return 4; -} - -static int -utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) -{ - uint wc; - - if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) - { - int r; - - cv->mode |= UNICODE_MODE_BOM_DONE; - if (bufsize < 4) - return seterror(E2BIG); - if (cv->codepage == 12000) /* little endian */ - memcpy(buf, "\xFF\xFE\x00\x00", 4); - else if (cv->codepage == 12001) /* big endian */ - memcpy(buf, "\x00\x00\xFE\xFF", 4); - - r = utf32_wctomb(cv, wbuf, wbufsize, buf + 4, bufsize - 4); - if (r == -1) - return -1; - return r + 4; - } - - if (bufsize < 4) - return seterror(E2BIG); - wc = utf16_to_ucs4(wbuf); - if (cv->codepage == 12000) /* little endian */ - { - buf[0] = wc & 0x000000FF; - buf[1] = (wc & 0x0000FF00) >> 8; - buf[2] = (wc & 0x00FF0000) >> 16; - buf[3] = (wc & 0xFF000000) >> 24; - } - else if (cv->codepage == 12001) /* big endian */ - { - buf[0] = (wc & 0xFF000000) >> 24; - buf[1] = (wc & 0x00FF0000) >> 16; - buf[2] = (wc & 0x0000FF00) >> 8; - buf[3] = wc & 0x000000FF; - } - return 4; -} - -/* - * 50220: ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS) - * 50221: ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow - * 1 byte Kana) - * 50222: ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte - * Kana - SO/SI) - * - * MultiByteToWideChar() and WideCharToMultiByte() behave differently - * depending on Windows version. On XP, WideCharToMultiByte() doesn't - * terminate result sequence with ascii escape. But Vista does. - * Use MLang instead. - */ - -#define ISO2022_MODE(cs, shift) (((cs) << 8) | (shift)) -#define ISO2022_MODE_CS(mode) (((mode) >> 8) & 0xFF) -#define ISO2022_MODE_SHIFT(mode) ((mode) & 0xFF) - -#define ISO2022_SI 0 -#define ISO2022_SO 1 - -/* shift in */ -static const char iso2022_SI_seq[] = "\x0F"; -/* shift out */ -static const char iso2022_SO_seq[] = "\x0E"; - -typedef struct iso2022_esc_t iso2022_esc_t; -struct iso2022_esc_t { - const char *esc; - int esc_len; - int len; - int cs; -}; - -#define ISO2022JP_CS_ASCII 0 -#define ISO2022JP_CS_JISX0201_ROMAN 1 -#define ISO2022JP_CS_JISX0201_KANA 2 -#define ISO2022JP_CS_JISX0208_1978 3 -#define ISO2022JP_CS_JISX0208_1983 4 -#define ISO2022JP_CS_JISX0212 5 - -static iso2022_esc_t iso2022jp_esc[] = { - {"\x1B\x28\x42", 3, 1, ISO2022JP_CS_ASCII}, - {"\x1B\x28\x4A", 3, 1, ISO2022JP_CS_JISX0201_ROMAN}, - {"\x1B\x28\x49", 3, 1, ISO2022JP_CS_JISX0201_KANA}, - {"\x1B\x24\x40", 3, 2, ISO2022JP_CS_JISX0208_1983}, /* unify 1978 with 1983 */ - {"\x1B\x24\x42", 3, 2, ISO2022JP_CS_JISX0208_1983}, - {"\x1B\x24\x28\x44", 4, 2, ISO2022JP_CS_JISX0212}, - {NULL, 0, 0, 0} -}; - -static int -iso2022jp_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) -{ - iso2022_esc_t *iesc = iso2022jp_esc; - char tmp[MB_CHAR_MAX]; - int insize; - HRESULT hr; - DWORD dummy = 0; - int len; - int esc_len; - int cs; - int shift; - int i; - - if (buf[0] == 0x1B) - { - for (i = 0; iesc[i].esc != NULL; ++i) - { - esc_len = iesc[i].esc_len; - if (bufsize < esc_len) - { - if (strncmp((char *)buf, iesc[i].esc, bufsize) == 0) - return seterror(EINVAL); - } - else - { - if (strncmp((char *)buf, iesc[i].esc, esc_len) == 0) - { - cv->mode = ISO2022_MODE(iesc[i].cs, ISO2022_SI); - *wbufsize = 0; - return esc_len; - } - } - } - /* not supported escape sequence */ - return seterror(EILSEQ); - } - else if (buf[0] == iso2022_SO_seq[0]) - { - cv->mode = ISO2022_MODE(ISO2022_MODE_CS(cv->mode), ISO2022_SO); - *wbufsize = 0; - return 1; - } - else if (buf[0] == iso2022_SI_seq[0]) - { - cv->mode = ISO2022_MODE(ISO2022_MODE_CS(cv->mode), ISO2022_SI); - *wbufsize = 0; - return 1; - } - - cs = ISO2022_MODE_CS(cv->mode); - shift = ISO2022_MODE_SHIFT(cv->mode); - - /* reset the mode for informal sequence */ - if (buf[0] < 0x20) - { - cs = ISO2022JP_CS_ASCII; - shift = ISO2022_SI; - } - - len = iesc[cs].len; - if (bufsize < len) - return seterror(EINVAL); - for (i = 0; i < len; ++i) - if (!(buf[i] < 0x80)) - return seterror(EILSEQ); - esc_len = iesc[cs].esc_len; - memcpy(tmp, iesc[cs].esc, esc_len); - if (shift == ISO2022_SO) - { - memcpy(tmp + esc_len, iso2022_SO_seq, 1); - esc_len += 1; - } - memcpy(tmp + esc_len, buf, len); - - if ((cv->codepage == 50220 || cv->codepage == 50221 - || cv->codepage == 50222) && shift == ISO2022_SO) - { - /* XXX: shift-out cannot be used for mbtowc (both kernel and - * mlang) */ - esc_len = iesc[ISO2022JP_CS_JISX0201_KANA].esc_len; - memcpy(tmp, iesc[ISO2022JP_CS_JISX0201_KANA].esc, esc_len); - memcpy(tmp + esc_len, buf, len); - } - - insize = len + esc_len; - hr = ConvertINetMultiByteToUnicode(&dummy, cv->codepage, - (const char *)tmp, &insize, (wchar_t *)wbuf, wbufsize); - if (hr != S_OK || insize != len + esc_len) - return seterror(EILSEQ); - - /* Check for conversion error. Assuming defaultChar is 0x3F. */ - /* ascii should be converted from ascii */ - if (wbuf[0] == buf[0] - && cv->mode != ISO2022_MODE(ISO2022JP_CS_ASCII, ISO2022_SI)) - return seterror(EILSEQ); - - /* reset the mode for informal sequence */ - if (cv->mode != ISO2022_MODE(cs, shift)) - cv->mode = ISO2022_MODE(cs, shift); - - return len; -} - -static int -iso2022jp_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) -{ - iso2022_esc_t *iesc = iso2022jp_esc; - char tmp[MB_CHAR_MAX]; - int tmpsize = MB_CHAR_MAX; - int insize = wbufsize; - HRESULT hr; - DWORD dummy = 0; - int len; - int esc_len = 0; - int cs = 0; - int shift; - int i; - - /* - * MultiByte = [escape sequence] + character + [escape sequence] - * - * Whether trailing escape sequence is added depends on which API is - * used (kernel or MLang, and its version). - */ - hr = ConvertINetUnicodeToMultiByte(&dummy, cv->codepage, - (const wchar_t *)wbuf, &wbufsize, tmp, &tmpsize); - if (hr != S_OK || insize != wbufsize) - return seterror(EILSEQ); - else if (bufsize < tmpsize) - return seterror(E2BIG); - - if (tmpsize == 1) - { - cs = ISO2022JP_CS_ASCII; - esc_len = 0; - } - else - { - for (i = 1; iesc[i].esc != NULL; ++i) - { - esc_len = iesc[i].esc_len; - if (strncmp(tmp, iesc[i].esc, esc_len) == 0) - { - cs = iesc[i].cs; - break; - } - } - if (iesc[i].esc == NULL) - /* not supported escape sequence */ - return seterror(EILSEQ); - } - - shift = ISO2022_SI; - if (tmp[esc_len] == iso2022_SO_seq[0]) - { - shift = ISO2022_SO; - esc_len += 1; - } - - len = iesc[cs].len; - - /* Check for converting error. Assuming defaultChar is 0x3F. */ - /* ascii should be converted from ascii */ - if (cs == ISO2022JP_CS_ASCII && !(wbuf[0] < 0x80)) - return seterror(EILSEQ); - else if (tmpsize < esc_len + len) - return seterror(EILSEQ); - - if (cv->mode == ISO2022_MODE(cs, shift)) - { - /* remove escape sequence */ - if (esc_len != 0) - memmove(tmp, tmp + esc_len, len); - esc_len = 0; - } - else - { - if (cs == ISO2022JP_CS_ASCII) - { - esc_len = iesc[ISO2022JP_CS_ASCII].esc_len; - memmove(tmp + esc_len, tmp, len); - memcpy(tmp, iesc[ISO2022JP_CS_ASCII].esc, esc_len); - } - if (ISO2022_MODE_SHIFT(cv->mode) == ISO2022_SO) - { - /* shift-in before changing to other mode */ - memmove(tmp + 1, tmp, len + esc_len); - memcpy(tmp, iso2022_SI_seq, 1); - esc_len += 1; - } - } - - if (bufsize < len + esc_len) - return seterror(E2BIG); - memcpy(buf, tmp, len + esc_len); - cv->mode = ISO2022_MODE(cs, shift); - return len + esc_len; -} - -static int -iso2022jp_flush(csconv_t *cv, uchar *buf, int bufsize) -{ - iso2022_esc_t *iesc = iso2022jp_esc; - int esc_len; - - if (cv->mode != ISO2022_MODE(ISO2022JP_CS_ASCII, ISO2022_SI)) - { - esc_len = 0; - if (ISO2022_MODE_SHIFT(cv->mode) != ISO2022_SI) - esc_len += 1; - if (ISO2022_MODE_CS(cv->mode) != ISO2022JP_CS_ASCII) - esc_len += iesc[ISO2022JP_CS_ASCII].esc_len; - if (bufsize < esc_len) - return seterror(E2BIG); - - esc_len = 0; - if (ISO2022_MODE_SHIFT(cv->mode) != ISO2022_SI) - { - memcpy(buf, iso2022_SI_seq, 1); - esc_len += 1; - } - if (ISO2022_MODE_CS(cv->mode) != ISO2022JP_CS_ASCII) - { - memcpy(buf + esc_len, iesc[ISO2022JP_CS_ASCII].esc, - iesc[ISO2022JP_CS_ASCII].esc_len); - esc_len += iesc[ISO2022JP_CS_ASCII].esc_len; - } - return esc_len; - } - return 0; -} - -#if defined(MAKE_DLL) && defined(USE_LIBICONV_DLL) -BOOL WINAPI -DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) -{ - switch( fdwReason ) - { - case DLL_PROCESS_ATTACH: - hwiniconv = (HMODULE)hinstDLL; - break; - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} -#endif - -#if defined(MAKE_EXE) -#include -#include -#include -int -main(int argc, char **argv) -{ - char *fromcode = NULL; - char *tocode = NULL; - int i; - char inbuf[BUFSIZ]; - char outbuf[BUFSIZ]; - const char *pin; - char *pout; - size_t inbytesleft; - size_t outbytesleft; - size_t rest = 0; - iconv_t cd; - size_t r; - FILE *in = stdin; - - _setmode(_fileno(stdin), _O_BINARY); - _setmode(_fileno(stdout), _O_BINARY); - - for (i = 1; i < argc; ++i) - { - if (strcmp(argv[i], "-l") == 0) - { - for (i = 0; codepage_alias[i].name != NULL; ++i) - printf("%s\n", codepage_alias[i].name); - return 0; - } - - if (strcmp(argv[i], "-f") == 0) - fromcode = argv[++i]; - else if (strcmp(argv[i], "-t") == 0) - tocode = argv[++i]; - else - { - in = fopen(argv[i], "rb"); - if (in == NULL) - { - fprintf(stderr, "cannot open %s\n", argv[i]); - return 1; - } - break; - } - } - - if (fromcode == NULL || tocode == NULL) - { - printf("usage: %s -f from-enc -t to-enc [file]\n", argv[0]); - return 0; - } - - cd = iconv_open(tocode, fromcode); - if (cd == (iconv_t)(-1)) - { - perror("iconv_open error"); - return 1; - } - - while ((inbytesleft = fread(inbuf + rest, 1, sizeof(inbuf) - rest, in)) != 0 - || rest != 0) - { - inbytesleft += rest; - pin = inbuf; - pout = outbuf; - outbytesleft = sizeof(outbuf); - r = iconv(cd, &pin, &inbytesleft, &pout, &outbytesleft); - fwrite(outbuf, 1, sizeof(outbuf) - outbytesleft, stdout); - if (r == (size_t)(-1) && errno != E2BIG && (errno != EINVAL || feof(in))) - { - perror("conversion error"); - return 1; - } - memmove(inbuf, pin, inbytesleft); - rest = inbytesleft; - } - pout = outbuf; - outbytesleft = sizeof(outbuf); - r = iconv(cd, NULL, NULL, &pout, &outbytesleft); - fwrite(outbuf, 1, sizeof(outbuf) - outbytesleft, stdout); - if (r == (size_t)(-1)) - { - perror("conversion error"); - return 1; - } - - iconv_close(cd); - - return 0; -} -#endif - diff --git a/src/mod/endpoints/mod_gsmopen/win_iconv/Makefile b/src/mod/endpoints/mod_gsmopen/win_iconv/Makefile deleted file mode 100644 index c0969f607f..0000000000 --- a/src/mod/endpoints/mod_gsmopen/win_iconv/Makefile +++ /dev/null @@ -1,72 +0,0 @@ - -# comma separated list (e.g. "iconv.dll,libiconv.dll") -DEFAULT_LIBICONV_DLL ?= \"\" - -CFLAGS += -pedantic -Wall -CFLAGS += -DUSE_LIBICONV_DLL -CFLAGS += -DDEFAULT_LIBICONV_DLL=$(DEFAULT_LIBICONV_DLL) - -all: iconv.dll libiconv.a win_iconv.exe - -dist: test win_iconv.zip - -iconv.dll: win_iconv.c - gcc $(CFLAGS) -c win_iconv.c -DMAKE_DLL - dllwrap --dllname iconv.dll --def iconv.def win_iconv.o $(SPECS_FLAGS) - strip iconv.dll - -libiconv.a: win_iconv.c - gcc $(CFLAGS) -c win_iconv.c - ar rcs libiconv.a win_iconv.o - ranlib libiconv.a - -win_iconv.exe: win_iconv.c - gcc $(CFLAGS) -s -o win_iconv.exe win_iconv.c -DMAKE_EXE - -libmlang.a: mlang.def - dlltool --kill-at --input-def mlang.def --output-lib libmlang.a - -test: - gcc $(CFLAGS) -s -o win_iconv_test.exe win_iconv_test.c - ./win_iconv_test.exe - -win_iconv.zip: msvcrt msvcr70 msvcr71 - rm -rf win_iconv - svn export . win_iconv - cp msvcrt/iconv.dll msvcrt/win_iconv.exe win_iconv/ - mkdir win_iconv/msvcr70 - cp msvcr70/iconv.dll win_iconv/msvcr70/ - mkdir win_iconv/msvcr71 - cp msvcr71/iconv.dll win_iconv/msvcr71/ - zip -r win_iconv.zip win_iconv - -msvcrt: - svn export . msvcrt; \ - cd msvcrt; \ - $(MAKE); - -msvcr70: - svn export . msvcr70; \ - cd msvcr70; \ - gcc -dumpspecs | sed s/-lmsvcrt/-lmsvcr70/ > specs; \ - $(MAKE) "SPECS_FLAGS=-specs=$$PWD/specs"; - -msvcr71: - svn export . msvcr71; \ - cd msvcr71; \ - gcc -dumpspecs | sed s/-lmsvcrt/-lmsvcr71/ > specs; \ - $(MAKE) "SPECS_FLAGS=-specs=$$PWD/specs"; - -clean: - rm -f win_iconv.exe - rm -f win_iconv.o - rm -f iconv.dll - rm -f libiconv.a - rm -f win_iconv_test.exe - rm -f libmlang.a - rm -rf win_iconv - rm -rf win_iconv.zip - rm -rf msvcrt - rm -rf msvcr70 - rm -rf msvcr71 - diff --git a/src/mod/endpoints/mod_gsmopen/win_iconv/iconv.def b/src/mod/endpoints/mod_gsmopen/win_iconv/iconv.def deleted file mode 100644 index f609c86a59..0000000000 --- a/src/mod/endpoints/mod_gsmopen/win_iconv/iconv.def +++ /dev/null @@ -1,24 +0,0 @@ -LIBRARY ICONV.DLL -EXPORTS - iconv - iconv_open - iconv_close - iconvctl - libiconv=iconv - libiconv_open=iconv_open - libiconv_close=iconv_close - libiconvctl=iconvctl -;; libiconv-1.11.dll -;; TODO for binary compatibility -; _libiconv_version @1 -; aliases2_lookup @2 -; aliases_lookup @3 -; iconv_canonicalize @4 -; libiconv @5 -; libiconv_close @6 -; libiconv_open @7 -; libiconv_relocate @8 -; libiconv_set_relocation_prefix @9 -; libiconvctl @10 -; libiconvlist @11 -; locale_charset @12 diff --git a/src/mod/endpoints/mod_gsmopen/win_iconv/iconv.h b/src/mod/endpoints/mod_gsmopen/win_iconv/iconv.h deleted file mode 100644 index 455be3b6b7..0000000000 --- a/src/mod/endpoints/mod_gsmopen/win_iconv/iconv.h +++ /dev/null @@ -1,5 +0,0 @@ -#include -typedef void* iconv_t; -iconv_t iconv_open(const char *tocode, const char *fromcode); -int iconv_close(iconv_t cd); -size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); diff --git a/src/mod/endpoints/mod_gsmopen/win_iconv/mlang.def b/src/mod/endpoints/mod_gsmopen/win_iconv/mlang.def deleted file mode 100644 index cb475aeea8..0000000000 --- a/src/mod/endpoints/mod_gsmopen/win_iconv/mlang.def +++ /dev/null @@ -1,11 +0,0 @@ -LIBRARY MLANG.DLL -EXPORTS - ConvertINetMultiByteToUnicode@24 - ;; ConvertINetReset (not documented) - ConvertINetString@28 - ConvertINetUnicodeToMultiByte@24 - IsConvertINetStringAvailable@8 - LcidToRfc1766A@12 - LcidToRfc1766W@12 - Rfc1766ToLcidA@8 - Rfc1766ToLcidW@8 diff --git a/src/mod/endpoints/mod_gsmopen/win_iconv/mlang.h b/src/mod/endpoints/mod_gsmopen/win_iconv/mlang.h deleted file mode 100644 index 5cbf779c92..0000000000 --- a/src/mod/endpoints/mod_gsmopen/win_iconv/mlang.h +++ /dev/null @@ -1,54 +0,0 @@ -HRESULT WINAPI ConvertINetString( - LPDWORD lpdwMode, - DWORD dwSrcEncoding, - DWORD dwDstEncoding, - LPCSTR lpSrcStr, - LPINT lpnSrcSize, - LPBYTE lpDstStr, - LPINT lpnDstSize -); - -HRESULT WINAPI ConvertINetMultiByteToUnicode( - LPDWORD lpdwMode, - DWORD dwSrcEncoding, - LPCSTR lpSrcStr, - LPINT lpnMultiCharCount, - LPWSTR lpDstStr, - LPINT lpnWideCharCount -); - -HRESULT WINAPI ConvertINetUnicodeToMultiByte( - LPDWORD lpdwMode, - DWORD dwEncoding, - LPCWSTR lpSrcStr, - LPINT lpnWideCharCount, - LPSTR lpDstStr, - LPINT lpnMultiCharCount -); - -HRESULT WINAPI IsConvertINetStringAvailable( - DWORD dwSrcEncoding, - DWORD dwDstEncoding -); - -HRESULT WINAPI LcidToRfc1766A( - LCID Locale, - LPSTR pszRfc1766, - int nChar -); - -HRESULT WINAPI LcidToRfc1766W( - LCID Locale, - LPWSTR pszRfc1766, - int nChar -); - -HRESULT WINAPI Rfc1766ToLcidA( - LCID *pLocale, - LPSTR pszRfc1766 -); - -HRESULT WINAPI Rfc1766ToLcidW( - LCID *pLocale, - LPWSTR pszRfc1766 -); diff --git a/src/mod/endpoints/mod_gsmopen/win_iconv/readme.txt b/src/mod/endpoints/mod_gsmopen/win_iconv/readme.txt deleted file mode 100644 index 31f423dc75..0000000000 --- a/src/mod/endpoints/mod_gsmopen/win_iconv/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -win_iconv is a iconv library using Win32 API to conversion. -win_iconv is placed in the public domain. -Yukihiro Nakadaira diff --git a/src/mod/endpoints/mod_gsmopen/win_iconv/win_iconv.c b/src/mod/endpoints/mod_gsmopen/win_iconv/win_iconv.c deleted file mode 100644 index 7a3eda3e10..0000000000 --- a/src/mod/endpoints/mod_gsmopen/win_iconv/win_iconv.c +++ /dev/null @@ -1,1986 +0,0 @@ -/* - * iconv library using Win32 API to conversion. - * - * This file is placed in the public domain. - * - * Last Change: 2009-07-06 - * - * ENVIRONMENT VARIABLE: - * WINICONV_LIBICONV_DLL - * If $WINICONV_LIBICONV_DLL is set, win_iconv uses the DLL. If - * loading the DLL or iconv_open() failed, falls back to internal - * conversion. If a few DLL are specified as comma separated list, - * the first loadable DLL is used. The DLL should have iconv_open(), - * iconv_close() and iconv(). Or libiconv_open(), libiconv_close() - * and libiconv(). - * (only available when USE_LIBICONV_DLL is defined at compile time) - * - * Win32 API does not support strict encoding conversion for some - * codepage. And MLang function drop or replace invalid bytes and does - * not return useful error status as iconv. This implementation cannot - * be used for encoding validation purpose. - */ - -/* for WC_NO_BEST_FIT_CHARS */ -#ifndef WINVER -# define WINVER 0x0500 -#endif - -#include -#include -#include -#include - -#if 0 -# define MAKE_EXE -# define MAKE_DLL -# define USE_LIBICONV_DLL -#endif - -#if !defined(DEFAULT_LIBICONV_DLL) -# define DEFAULT_LIBICONV_DLL "" -#endif - -#define MB_CHAR_MAX 16 - -#define UNICODE_MODE_BOM_DONE 1 -#define UNICODE_MODE_SWAPPED 2 - -#define FLAG_USE_BOM 1 -#define FLAG_TRANSLIT 2 /* //TRANSLIT */ -#define FLAG_IGNORE 4 /* //IGNORE (not implemented) */ - -typedef unsigned char uchar; -typedef unsigned short ushort; -typedef unsigned int uint; - -typedef void* iconv_t; - -iconv_t iconv_open(const char *tocode, const char *fromcode); -int iconv_close(iconv_t cd); -size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); - -/* libiconv interface for vim */ -#if defined(MAKE_DLL) -int -iconvctl (iconv_t cd, int request, void* argument) -{ - /* not supported */ - return 0; -} -#endif - -typedef struct compat_t compat_t; -typedef struct csconv_t csconv_t; -typedef struct rec_iconv_t rec_iconv_t; - -typedef iconv_t (*f_iconv_open)(const char *tocode, const char *fromcode); -typedef int (*f_iconv_close)(iconv_t cd); -typedef size_t (*f_iconv)(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); -typedef int* (*f_errno)(void); -typedef int (*f_mbtowc)(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); -typedef int (*f_wctomb)(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); -typedef int (*f_mblen)(csconv_t *cv, const uchar *buf, int bufsize); -typedef int (*f_flush)(csconv_t *cv, uchar *buf, int bufsize); - -#define COMPAT_IN 1 -#define COMPAT_OUT 2 - -/* unicode mapping for compatibility with other conversion table. */ -struct compat_t { - uint in; - uint out; - uint flag; -}; - -struct csconv_t { - int codepage; - int flags; - f_mbtowc mbtowc; - f_wctomb wctomb; - f_mblen mblen; - f_flush flush; - DWORD mode; - compat_t *compat; -}; - -struct rec_iconv_t { - iconv_t cd; - f_iconv_close iconv_close; - f_iconv iconv; - f_errno _errno; - csconv_t from; - csconv_t to; -#if defined(USE_LIBICONV_DLL) - HMODULE hlibiconv; -#endif -}; - -static int win_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode); -static int win_iconv_close(iconv_t cd); -static size_t win_iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); - -static int load_mlang(); -static int make_csconv(const char *name, csconv_t *cv); -static int name_to_codepage(const char *name); -static uint utf16_to_ucs4(const ushort *wbuf); -static void ucs4_to_utf16(uint wc, ushort *wbuf, int *wbufsize); -static int mbtowc_flags(int codepage); -static int must_use_null_useddefaultchar(int codepage); -static char *strrstr(const char *str, const char *token); -static char *xstrndup(const char *s, size_t n); -static int seterror(int err); - -#if defined(USE_LIBICONV_DLL) -static int libiconv_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode); -static PVOID MyImageDirectoryEntryToData(LPVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size); -static HMODULE find_imported_module_by_funcname(HMODULE hModule, const char *funcname); - -static HMODULE hwiniconv; -#endif - -static int sbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize); -static int dbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize); -static int mbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize); -static int utf8_mblen(csconv_t *cv, const uchar *buf, int bufsize); -static int eucjp_mblen(csconv_t *cv, const uchar *buf, int bufsize); - -static int kernel_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); -static int kernel_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); -static int mlang_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); -static int mlang_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); -static int utf16_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); -static int utf16_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); -static int utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); -static int utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); -static int iso2022jp_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); -static int iso2022jp_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); -static int iso2022jp_flush(csconv_t *cv, uchar *buf, int bufsize); - -static struct { - int codepage; - const char *name; -} codepage_alias[] = { - {65001, "CP65001"}, - {65001, "UTF8"}, - {65001, "UTF-8"}, - - {1200, "CP1200"}, - {1200, "UTF16LE"}, - {1200, "UTF-16LE"}, - {1200, "UCS-2LE"}, - - {1201, "CP1201"}, - {1201, "UTF16BE"}, - {1201, "UTF-16BE"}, - {1201, "UCS-2BE"}, - {1201, "unicodeFFFE"}, - - {12000, "CP12000"}, - {12000, "UTF32LE"}, - {12000, "UTF-32LE"}, - - {12001, "CP12001"}, - {12001, "UTF32BE"}, - {12001, "UTF-32BE"}, - -#ifndef GLIB_COMPILATION - /* - * Default is big endian. - * See rfc2781 4.3 Interpreting text labelled as UTF-16. - */ - {1201, "UTF16"}, - {1201, "UTF-16"}, - {12001, "UTF32"}, - {12001, "UTF-32"}, -#else - /* Default is little endian, because the platform is */ - {1200, "UTF16"}, - {1200, "UTF-16"}, - {1200, "UCS-2"}, - {12000, "UTF32"}, - {12000, "UTF-32"}, -#endif - - /* copy from libiconv `iconv -l` */ - /* !IsValidCodePage(367) */ - {20127, "ANSI_X3.4-1968"}, - {20127, "ANSI_X3.4-1986"}, - {20127, "ASCII"}, - {20127, "CP367"}, - {20127, "IBM367"}, - {20127, "ISO-IR-6"}, - {20127, "ISO646-US"}, - {20127, "ISO_646.IRV:1991"}, - {20127, "US"}, - {20127, "US-ASCII"}, - {20127, "CSASCII"}, - - /* !IsValidCodePage(819) */ - {1252, "CP819"}, - {1252, "IBM819"}, - {28591, "ISO-8859-1"}, - {28591, "ISO-IR-100"}, - {28591, "ISO8859-1"}, - {28591, "ISO_8859-1"}, - {28591, "ISO_8859-1:1987"}, - {28591, "L1"}, - {28591, "LATIN1"}, - {28591, "CSISOLATIN1"}, - - {1250, "CP1250"}, - {1250, "MS-EE"}, - {1250, "WINDOWS-1250"}, - - {1251, "CP1251"}, - {1251, "MS-CYRL"}, - {1251, "WINDOWS-1251"}, - - {1252, "CP1252"}, - {1252, "MS-ANSI"}, - {1252, "WINDOWS-1252"}, - - {1253, "CP1253"}, - {1253, "MS-GREEK"}, - {1253, "WINDOWS-1253"}, - - {1254, "CP1254"}, - {1254, "MS-TURK"}, - {1254, "WINDOWS-1254"}, - - {1255, "CP1255"}, - {1255, "MS-HEBR"}, - {1255, "WINDOWS-1255"}, - - {1256, "CP1256"}, - {1256, "MS-ARAB"}, - {1256, "WINDOWS-1256"}, - - {1257, "CP1257"}, - {1257, "WINBALTRIM"}, - {1257, "WINDOWS-1257"}, - - {1258, "CP1258"}, - {1258, "WINDOWS-1258"}, - - {850, "850"}, - {850, "CP850"}, - {850, "IBM850"}, - {850, "CSPC850MULTILINGUAL"}, - - /* !IsValidCodePage(862) */ - {862, "862"}, - {862, "CP862"}, - {862, "IBM862"}, - {862, "CSPC862LATINHEBREW"}, - - {866, "866"}, - {866, "CP866"}, - {866, "IBM866"}, - {866, "CSIBM866"}, - - /* !IsValidCodePage(154) */ - {154, "CP154"}, - {154, "CYRILLIC-ASIAN"}, - {154, "PT154"}, - {154, "PTCP154"}, - {154, "CSPTCP154"}, - - /* !IsValidCodePage(1133) */ - {1133, "CP1133"}, - {1133, "IBM-CP1133"}, - - {874, "CP874"}, - {874, "WINDOWS-874"}, - - /* !IsValidCodePage(51932) */ - {51932, "CP51932"}, - {51932, "MS51932"}, - {51932, "WINDOWS-51932"}, - {51932, "EUC-JP"}, - - {932, "CP932"}, - {932, "MS932"}, - {932, "SHIFFT_JIS"}, - {932, "SHIFFT_JIS-MS"}, - {932, "SJIS"}, - {932, "SJIS-MS"}, - {932, "SJIS-OPEN"}, - {932, "SJIS-WIN"}, - {932, "WINDOWS-31J"}, - {932, "WINDOWS-932"}, - {932, "CSWINDOWS31J"}, - - {50221, "CP50221"}, - {50221, "ISO-2022-JP"}, - {50221, "ISO-2022-JP-MS"}, - {50221, "ISO2022-JP"}, - {50221, "ISO2022-JP-MS"}, - {50221, "MS50221"}, - {50221, "WINDOWS-50221"}, - - {936, "CP936"}, - {936, "GBK"}, - {936, "MS936"}, - {936, "WINDOWS-936"}, - - {950, "CP950"}, - {950, "BIG5"}, - - {949, "CP949"}, - {949, "UHC"}, - {949, "EUC-KR"}, - - {1361, "CP1361"}, - {1361, "JOHAB"}, - - {437, "437"}, - {437, "CP437"}, - {437, "IBM437"}, - {437, "CSPC8CODEPAGE437"}, - - {737, "CP737"}, - - {775, "CP775"}, - {775, "IBM775"}, - {775, "CSPC775BALTIC"}, - - {852, "852"}, - {852, "CP852"}, - {852, "IBM852"}, - {852, "CSPCP852"}, - - /* !IsValidCodePage(853) */ - {853, "CP853"}, - - {855, "855"}, - {855, "CP855"}, - {855, "IBM855"}, - {855, "CSIBM855"}, - - {857, "857"}, - {857, "CP857"}, - {857, "IBM857"}, - {857, "CSIBM857"}, - - /* !IsValidCodePage(858) */ - {858, "CP858"}, - - {860, "860"}, - {860, "CP860"}, - {860, "IBM860"}, - {860, "CSIBM860"}, - - {861, "861"}, - {861, "CP-IS"}, - {861, "CP861"}, - {861, "IBM861"}, - {861, "CSIBM861"}, - - {863, "863"}, - {863, "CP863"}, - {863, "IBM863"}, - {863, "CSIBM863"}, - - {864, "CP864"}, - {864, "IBM864"}, - {864, "CSIBM864"}, - - {865, "865"}, - {865, "CP865"}, - {865, "IBM865"}, - {865, "CSIBM865"}, - - {869, "869"}, - {869, "CP-GR"}, - {869, "CP869"}, - {869, "IBM869"}, - {869, "CSIBM869"}, - - /* !IsValidCodePage(1152) */ - {1125, "CP1125"}, - - /* - * Code Page Identifiers - * http://msdn2.microsoft.com/en-us/library/ms776446.aspx - */ - {37, "IBM037"}, /* IBM EBCDIC US-Canada */ - {437, "IBM437"}, /* OEM United States */ - {500, "IBM500"}, /* IBM EBCDIC International */ - {708, "ASMO-708"}, /* Arabic (ASMO 708) */ - /* 709 Arabic (ASMO-449+, BCON V4) */ - /* 710 Arabic - Transparent Arabic */ - {720, "DOS-720"}, /* Arabic (Transparent ASMO); Arabic (DOS) */ - {737, "ibm737"}, /* OEM Greek (formerly 437G); Greek (DOS) */ - {775, "ibm775"}, /* OEM Baltic; Baltic (DOS) */ - {850, "ibm850"}, /* OEM Multilingual Latin 1; Western European (DOS) */ - {852, "ibm852"}, /* OEM Latin 2; Central European (DOS) */ - {855, "IBM855"}, /* OEM Cyrillic (primarily Russian) */ - {857, "ibm857"}, /* OEM Turkish; Turkish (DOS) */ - {858, "IBM00858"}, /* OEM Multilingual Latin 1 + Euro symbol */ - {860, "IBM860"}, /* OEM Portuguese; Portuguese (DOS) */ - {861, "ibm861"}, /* OEM Icelandic; Icelandic (DOS) */ - {862, "DOS-862"}, /* OEM Hebrew; Hebrew (DOS) */ - {863, "IBM863"}, /* OEM French Canadian; French Canadian (DOS) */ - {864, "IBM864"}, /* OEM Arabic; Arabic (864) */ - {865, "IBM865"}, /* OEM Nordic; Nordic (DOS) */ - {866, "cp866"}, /* OEM Russian; Cyrillic (DOS) */ - {869, "ibm869"}, /* OEM Modern Greek; Greek, Modern (DOS) */ - {870, "IBM870"}, /* IBM EBCDIC Multilingual/ROECE (Latin 2); IBM EBCDIC Multilingual Latin 2 */ - {874, "windows-874"}, /* ANSI/OEM Thai (same as 28605, ISO 8859-15); Thai (Windows) */ - {875, "cp875"}, /* IBM EBCDIC Greek Modern */ - {932, "shift_jis"}, /* ANSI/OEM Japanese; Japanese (Shift-JIS) */ - {932, "shift-jis"}, /* alternative name for it */ - {936, "gb2312"}, /* ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312) */ - {949, "ks_c_5601-1987"}, /* ANSI/OEM Korean (Unified Hangul Code) */ - {950, "big5"}, /* ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5) */ - {1026, "IBM1026"}, /* IBM EBCDIC Turkish (Latin 5) */ - {1047, "IBM01047"}, /* IBM EBCDIC Latin 1/Open System */ - {1140, "IBM01140"}, /* IBM EBCDIC US-Canada (037 + Euro symbol); IBM EBCDIC (US-Canada-Euro) */ - {1141, "IBM01141"}, /* IBM EBCDIC Germany (20273 + Euro symbol); IBM EBCDIC (Germany-Euro) */ - {1142, "IBM01142"}, /* IBM EBCDIC Denmark-Norway (20277 + Euro symbol); IBM EBCDIC (Denmark-Norway-Euro) */ - {1143, "IBM01143"}, /* IBM EBCDIC Finland-Sweden (20278 + Euro symbol); IBM EBCDIC (Finland-Sweden-Euro) */ - {1144, "IBM01144"}, /* IBM EBCDIC Italy (20280 + Euro symbol); IBM EBCDIC (Italy-Euro) */ - {1145, "IBM01145"}, /* IBM EBCDIC Latin America-Spain (20284 + Euro symbol); IBM EBCDIC (Spain-Euro) */ - {1146, "IBM01146"}, /* IBM EBCDIC United Kingdom (20285 + Euro symbol); IBM EBCDIC (UK-Euro) */ - {1147, "IBM01147"}, /* IBM EBCDIC France (20297 + Euro symbol); IBM EBCDIC (France-Euro) */ - {1148, "IBM01148"}, /* IBM EBCDIC International (500 + Euro symbol); IBM EBCDIC (International-Euro) */ - {1149, "IBM01149"}, /* IBM EBCDIC Icelandic (20871 + Euro symbol); IBM EBCDIC (Icelandic-Euro) */ - {1250, "windows-1250"}, /* ANSI Central European; Central European (Windows) */ - {1251, "windows-1251"}, /* ANSI Cyrillic; Cyrillic (Windows) */ - {1252, "windows-1252"}, /* ANSI Latin 1; Western European (Windows) */ - {1253, "windows-1253"}, /* ANSI Greek; Greek (Windows) */ - {1254, "windows-1254"}, /* ANSI Turkish; Turkish (Windows) */ - {1255, "windows-1255"}, /* ANSI Hebrew; Hebrew (Windows) */ - {1256, "windows-1256"}, /* ANSI Arabic; Arabic (Windows) */ - {1257, "windows-1257"}, /* ANSI Baltic; Baltic (Windows) */ - {1258, "windows-1258"}, /* ANSI/OEM Vietnamese; Vietnamese (Windows) */ - {1361, "Johab"}, /* Korean (Johab) */ - {10000, "macintosh"}, /* MAC Roman; Western European (Mac) */ - {10001, "x-mac-japanese"}, /* Japanese (Mac) */ - {10002, "x-mac-chinesetrad"}, /* MAC Traditional Chinese (Big5); Chinese Traditional (Mac) */ - {10003, "x-mac-korean"}, /* Korean (Mac) */ - {10004, "x-mac-arabic"}, /* Arabic (Mac) */ - {10005, "x-mac-hebrew"}, /* Hebrew (Mac) */ - {10006, "x-mac-greek"}, /* Greek (Mac) */ - {10007, "x-mac-cyrillic"}, /* Cyrillic (Mac) */ - {10008, "x-mac-chinesesimp"}, /* MAC Simplified Chinese (GB 2312); Chinese Simplified (Mac) */ - {10010, "x-mac-romanian"}, /* Romanian (Mac) */ - {10017, "x-mac-ukrainian"}, /* Ukrainian (Mac) */ - {10021, "x-mac-thai"}, /* Thai (Mac) */ - {10029, "x-mac-ce"}, /* MAC Latin 2; Central European (Mac) */ - {10079, "x-mac-icelandic"}, /* Icelandic (Mac) */ - {10081, "x-mac-turkish"}, /* Turkish (Mac) */ - {10082, "x-mac-croatian"}, /* Croatian (Mac) */ - {20000, "x-Chinese_CNS"}, /* CNS Taiwan; Chinese Traditional (CNS) */ - {20001, "x-cp20001"}, /* TCA Taiwan */ - {20002, "x_Chinese-Eten"}, /* Eten Taiwan; Chinese Traditional (Eten) */ - {20003, "x-cp20003"}, /* IBM5550 Taiwan */ - {20004, "x-cp20004"}, /* TeleText Taiwan */ - {20005, "x-cp20005"}, /* Wang Taiwan */ - {20105, "x-IA5"}, /* IA5 (IRV International Alphabet No. 5, 7-bit); Western European (IA5) */ - {20106, "x-IA5-German"}, /* IA5 German (7-bit) */ - {20107, "x-IA5-Swedish"}, /* IA5 Swedish (7-bit) */ - {20108, "x-IA5-Norwegian"}, /* IA5 Norwegian (7-bit) */ - {20127, "us-ascii"}, /* US-ASCII (7-bit) */ - {20261, "x-cp20261"}, /* T.61 */ - {20269, "x-cp20269"}, /* ISO 6937 Non-Spacing Accent */ - {20273, "IBM273"}, /* IBM EBCDIC Germany */ - {20277, "IBM277"}, /* IBM EBCDIC Denmark-Norway */ - {20278, "IBM278"}, /* IBM EBCDIC Finland-Sweden */ - {20280, "IBM280"}, /* IBM EBCDIC Italy */ - {20284, "IBM284"}, /* IBM EBCDIC Latin America-Spain */ - {20285, "IBM285"}, /* IBM EBCDIC United Kingdom */ - {20290, "IBM290"}, /* IBM EBCDIC Japanese Katakana Extended */ - {20297, "IBM297"}, /* IBM EBCDIC France */ - {20420, "IBM420"}, /* IBM EBCDIC Arabic */ - {20423, "IBM423"}, /* IBM EBCDIC Greek */ - {20424, "IBM424"}, /* IBM EBCDIC Hebrew */ - {20833, "x-EBCDIC-KoreanExtended"}, /* IBM EBCDIC Korean Extended */ - {20838, "IBM-Thai"}, /* IBM EBCDIC Thai */ - {20866, "koi8-r"}, /* Russian (KOI8-R); Cyrillic (KOI8-R) */ - {20871, "IBM871"}, /* IBM EBCDIC Icelandic */ - {20880, "IBM880"}, /* IBM EBCDIC Cyrillic Russian */ - {20905, "IBM905"}, /* IBM EBCDIC Turkish */ - {20924, "IBM00924"}, /* IBM EBCDIC Latin 1/Open System (1047 + Euro symbol) */ - {20932, "EUC-JP"}, /* Japanese (JIS 0208-1990 and 0121-1990) */ - {20936, "x-cp20936"}, /* Simplified Chinese (GB2312); Chinese Simplified (GB2312-80) */ - {20949, "x-cp20949"}, /* Korean Wansung */ - {21025, "cp1025"}, /* IBM EBCDIC Cyrillic Serbian-Bulgarian */ - /* 21027 (deprecated) */ - {21866, "koi8-u"}, /* Ukrainian (KOI8-U); Cyrillic (KOI8-U) */ - {28591, "iso-8859-1"}, /* ISO 8859-1 Latin 1; Western European (ISO) */ - {28591, "iso8859-1"}, /* ISO 8859-1 Latin 1; Western European (ISO) */ - {28592, "iso-8859-2"}, /* ISO 8859-2 Central European; Central European (ISO) */ - {28592, "iso8859-2"}, /* ISO 8859-2 Central European; Central European (ISO) */ - {28593, "iso-8859-3"}, /* ISO 8859-3 Latin 3 */ - {28593, "iso8859-3"}, /* ISO 8859-3 Latin 3 */ - {28594, "iso-8859-4"}, /* ISO 8859-4 Baltic */ - {28594, "iso8859-4"}, /* ISO 8859-4 Baltic */ - {28595, "iso-8859-5"}, /* ISO 8859-5 Cyrillic */ - {28595, "iso8859-5"}, /* ISO 8859-5 Cyrillic */ - {28596, "iso-8859-6"}, /* ISO 8859-6 Arabic */ - {28596, "iso8859-6"}, /* ISO 8859-6 Arabic */ - {28597, "iso-8859-7"}, /* ISO 8859-7 Greek */ - {28597, "iso8859-7"}, /* ISO 8859-7 Greek */ - {28598, "iso-8859-8"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Visual) */ - {28598, "iso8859-8"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Visual) */ - {28599, "iso-8859-9"}, /* ISO 8859-9 Turkish */ - {28599, "iso8859-9"}, /* ISO 8859-9 Turkish */ - {28603, "iso-8859-13"}, /* ISO 8859-13 Estonian */ - {28603, "iso8859-13"}, /* ISO 8859-13 Estonian */ - {28605, "iso-8859-15"}, /* ISO 8859-15 Latin 9 */ - {28605, "iso8859-15"}, /* ISO 8859-15 Latin 9 */ - {29001, "x-Europa"}, /* Europa 3 */ - {38598, "iso-8859-8-i"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Logical) */ - {38598, "iso8859-8-i"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Logical) */ - {50220, "iso-2022-jp"}, /* ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS) */ - {50221, "csISO2022JP"}, /* ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana) */ - {50222, "iso-2022-jp"}, /* ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI) */ - {50225, "iso-2022-kr"}, /* ISO 2022 Korean */ - {50225, "iso2022-kr"}, /* ISO 2022 Korean */ - {50227, "x-cp50227"}, /* ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022) */ - /* 50229 ISO 2022 Traditional Chinese */ - /* 50930 EBCDIC Japanese (Katakana) Extended */ - /* 50931 EBCDIC US-Canada and Japanese */ - /* 50933 EBCDIC Korean Extended and Korean */ - /* 50935 EBCDIC Simplified Chinese Extended and Simplified Chinese */ - /* 50936 EBCDIC Simplified Chinese */ - /* 50937 EBCDIC US-Canada and Traditional Chinese */ - /* 50939 EBCDIC Japanese (Latin) Extended and Japanese */ - {51932, "euc-jp"}, /* EUC Japanese */ - {51936, "EUC-CN"}, /* EUC Simplified Chinese; Chinese Simplified (EUC) */ - {51949, "euc-kr"}, /* EUC Korean */ - /* 51950 EUC Traditional Chinese */ - {52936, "hz-gb-2312"}, /* HZ-GB2312 Simplified Chinese; Chinese Simplified (HZ) */ - {54936, "GB18030"}, /* Windows XP and later: GB18030 Simplified Chinese (4 byte); Chinese Simplified (GB18030) */ - {57002, "x-iscii-de"}, /* ISCII Devanagari */ - {57003, "x-iscii-be"}, /* ISCII Bengali */ - {57004, "x-iscii-ta"}, /* ISCII Tamil */ - {57005, "x-iscii-te"}, /* ISCII Telugu */ - {57006, "x-iscii-as"}, /* ISCII Assamese */ - {57007, "x-iscii-or"}, /* ISCII Oriya */ - {57008, "x-iscii-ka"}, /* ISCII Kannada */ - {57009, "x-iscii-ma"}, /* ISCII Malayalam */ - {57010, "x-iscii-gu"}, /* ISCII Gujarati */ - {57011, "x-iscii-pa"}, /* ISCII Punjabi */ - - {0, NULL} -}; - -/* - * SJIS SHIFTJIS table CP932 table - * ---- --------------------------- -------------------------------- - * 5C U+00A5 YEN SIGN U+005C REVERSE SOLIDUS - * 7E U+203E OVERLINE U+007E TILDE - * 815C U+2014 EM DASH U+2015 HORIZONTAL BAR - * 815F U+005C REVERSE SOLIDUS U+FF3C FULLWIDTH REVERSE SOLIDUS - * 8160 U+301C WAVE DASH U+FF5E FULLWIDTH TILDE - * 8161 U+2016 DOUBLE VERTICAL LINE U+2225 PARALLEL TO - * 817C U+2212 MINUS SIGN U+FF0D FULLWIDTH HYPHEN-MINUS - * 8191 U+00A2 CENT SIGN U+FFE0 FULLWIDTH CENT SIGN - * 8192 U+00A3 POUND SIGN U+FFE1 FULLWIDTH POUND SIGN - * 81CA U+00AC NOT SIGN U+FFE2 FULLWIDTH NOT SIGN - * - * EUC-JP and ISO-2022-JP should be compatible with CP932. - * - * Kernel and MLang have different Unicode mapping table. Make sure - * which API is used. - */ -static compat_t cp932_compat[] = { - {0x00A5, 0x005C, COMPAT_OUT}, - {0x203E, 0x007E, COMPAT_OUT}, - {0x2014, 0x2015, COMPAT_OUT}, - {0x301C, 0xFF5E, COMPAT_OUT}, - {0x2016, 0x2225, COMPAT_OUT}, - {0x2212, 0xFF0D, COMPAT_OUT}, - {0x00A2, 0xFFE0, COMPAT_OUT}, - {0x00A3, 0xFFE1, COMPAT_OUT}, - {0x00AC, 0xFFE2, COMPAT_OUT}, - {0, 0, 0} -}; - -static compat_t cp20932_compat[] = { - {0x00A5, 0x005C, COMPAT_OUT}, - {0x203E, 0x007E, COMPAT_OUT}, - {0x2014, 0x2015, COMPAT_OUT}, - {0xFF5E, 0x301C, COMPAT_OUT|COMPAT_IN}, - {0x2225, 0x2016, COMPAT_OUT|COMPAT_IN}, - {0xFF0D, 0x2212, COMPAT_OUT|COMPAT_IN}, - {0xFFE0, 0x00A2, COMPAT_OUT|COMPAT_IN}, - {0xFFE1, 0x00A3, COMPAT_OUT|COMPAT_IN}, - {0xFFE2, 0x00AC, COMPAT_OUT|COMPAT_IN}, - {0, 0, 0} -}; - -static compat_t *cp51932_compat = cp932_compat; - -/* cp20932_compat for kernel. cp932_compat for mlang. */ -static compat_t *cp5022x_compat = cp932_compat; - -typedef HRESULT (WINAPI *CONVERTINETSTRING)( - LPDWORD lpdwMode, - DWORD dwSrcEncoding, - DWORD dwDstEncoding, - LPCSTR lpSrcStr, - LPINT lpnSrcSize, - LPBYTE lpDstStr, - LPINT lpnDstSize -); -typedef HRESULT (WINAPI *CONVERTINETMULTIBYTETOUNICODE)( - LPDWORD lpdwMode, - DWORD dwSrcEncoding, - LPCSTR lpSrcStr, - LPINT lpnMultiCharCount, - LPWSTR lpDstStr, - LPINT lpnWideCharCount -); -typedef HRESULT (WINAPI *CONVERTINETUNICODETOMULTIBYTE)( - LPDWORD lpdwMode, - DWORD dwEncoding, - LPCWSTR lpSrcStr, - LPINT lpnWideCharCount, - LPSTR lpDstStr, - LPINT lpnMultiCharCount -); -typedef HRESULT (WINAPI *ISCONVERTINETSTRINGAVAILABLE)( - DWORD dwSrcEncoding, - DWORD dwDstEncoding -); -typedef HRESULT (WINAPI *LCIDTORFC1766A)( - LCID Locale, - LPSTR pszRfc1766, - int nChar -); -typedef HRESULT (WINAPI *LCIDTORFC1766W)( - LCID Locale, - LPWSTR pszRfc1766, - int nChar -); -typedef HRESULT (WINAPI *RFC1766TOLCIDA)( - LCID *pLocale, - LPSTR pszRfc1766 -); -typedef HRESULT (WINAPI *RFC1766TOLCIDW)( - LCID *pLocale, - LPWSTR pszRfc1766 -); -static CONVERTINETSTRING ConvertINetString; -static CONVERTINETMULTIBYTETOUNICODE ConvertINetMultiByteToUnicode; -static CONVERTINETUNICODETOMULTIBYTE ConvertINetUnicodeToMultiByte; -static ISCONVERTINETSTRINGAVAILABLE IsConvertINetStringAvailable; -static LCIDTORFC1766A LcidToRfc1766A; -static RFC1766TOLCIDA Rfc1766ToLcidA; - -static int -load_mlang() -{ - HMODULE h; - if (ConvertINetString != NULL) - return TRUE; - h = LoadLibrary("mlang.dll"); - if (!h) - return FALSE; - ConvertINetString = (CONVERTINETSTRING)GetProcAddress(h, "ConvertINetString"); - ConvertINetMultiByteToUnicode = (CONVERTINETMULTIBYTETOUNICODE)GetProcAddress(h, "ConvertINetMultiByteToUnicode"); - ConvertINetUnicodeToMultiByte = (CONVERTINETUNICODETOMULTIBYTE)GetProcAddress(h, "ConvertINetUnicodeToMultiByte"); - IsConvertINetStringAvailable = (ISCONVERTINETSTRINGAVAILABLE)GetProcAddress(h, "IsConvertINetStringAvailable"); - LcidToRfc1766A = (LCIDTORFC1766A)GetProcAddress(h, "LcidToRfc1766A"); - Rfc1766ToLcidA = (RFC1766TOLCIDA)GetProcAddress(h, "Rfc1766ToLcidA"); - return TRUE; -} - -iconv_t -iconv_open(const char *tocode, const char *fromcode) -{ - rec_iconv_t *cd; - - cd = (rec_iconv_t *)calloc(1, sizeof(rec_iconv_t)); - if (cd == NULL) - return (iconv_t)(-1); - -#if defined(USE_LIBICONV_DLL) - errno = 0; - if (libiconv_iconv_open(cd, tocode, fromcode)) - return (iconv_t)cd; -#endif - - /* reset the errno to prevent reporting wrong error code. - * 0 for unsorted error. */ - errno = 0; - if (win_iconv_open(cd, tocode, fromcode)) - return (iconv_t)cd; - - free(cd); - - return (iconv_t)(-1); -} - -int -iconv_close(iconv_t _cd) -{ - rec_iconv_t *cd = (rec_iconv_t *)_cd; - int r = cd->iconv_close(cd->cd); - int e = *(cd->_errno()); -#if defined(USE_LIBICONV_DLL) - if (cd->hlibiconv != NULL) - FreeLibrary(cd->hlibiconv); -#endif - free(cd); - errno = e; - return r; -} - -size_t -iconv(iconv_t _cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) -{ - rec_iconv_t *cd = (rec_iconv_t *)_cd; - size_t r = cd->iconv(cd->cd, inbuf, inbytesleft, outbuf, outbytesleft); - errno = *(cd->_errno()); - return r; -} - -static int -win_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode) -{ - if (!make_csconv(fromcode, &cd->from) || !make_csconv(tocode, &cd->to)) - return FALSE; - cd->iconv_close = win_iconv_close; - cd->iconv = win_iconv; - cd->_errno = _errno; - cd->cd = (iconv_t)cd; - return TRUE; -} - -static int -win_iconv_close(iconv_t cd) -{ - return 0; -} - -static size_t -win_iconv(iconv_t _cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) -{ - rec_iconv_t *cd = (rec_iconv_t *)_cd; - ushort wbuf[MB_CHAR_MAX]; /* enough room for one character */ - int insize; - int outsize; - int wsize; - DWORD frommode; - DWORD tomode; - uint wc; - compat_t *cp; - int i; - - if (inbuf == NULL || *inbuf == NULL) - { - if (outbuf != NULL && *outbuf != NULL && cd->to.flush != NULL) - { - tomode = cd->to.mode; - outsize = cd->to.flush(&cd->to, (uchar *)*outbuf, *outbytesleft); - if (outsize == -1) - { - cd->to.mode = tomode; - return (size_t)(-1); - } - *outbuf += outsize; - *outbytesleft -= outsize; - } - cd->from.mode = 0; - cd->to.mode = 0; - return 0; - } - - while (*inbytesleft != 0) - { - frommode = cd->from.mode; - tomode = cd->to.mode; - wsize = MB_CHAR_MAX; - - insize = cd->from.mbtowc(&cd->from, (const uchar *)*inbuf, *inbytesleft, wbuf, &wsize); - if (insize == -1) - { - cd->from.mode = frommode; - return (size_t)(-1); - } - - if (wsize == 0) - { - *inbuf += insize; - *inbytesleft -= insize; - continue; - } - - if (cd->from.compat != NULL) - { - wc = utf16_to_ucs4(wbuf); - cp = cd->from.compat; - for (i = 0; cp[i].in != 0; ++i) - { - if ((cp[i].flag & COMPAT_IN) && cp[i].out == wc) - { - ucs4_to_utf16(cp[i].in, wbuf, &wsize); - break; - } - } - } - - if (cd->to.compat != NULL) - { - wc = utf16_to_ucs4(wbuf); - cp = cd->to.compat; - for (i = 0; cp[i].in != 0; ++i) - { - if ((cp[i].flag & COMPAT_OUT) && cp[i].in == wc) - { - ucs4_to_utf16(cp[i].out, wbuf, &wsize); - break; - } - } - } - - outsize = cd->to.wctomb(&cd->to, wbuf, wsize, (uchar *)*outbuf, *outbytesleft); - if (outsize == -1) - { - cd->from.mode = frommode; - cd->to.mode = tomode; - return (size_t)(-1); - } - - *inbuf += insize; - *outbuf += outsize; - *inbytesleft -= insize; - *outbytesleft -= outsize; - } - - return 0; -} - -static int -make_csconv(const char *_name, csconv_t *cv) -{ - CPINFOEX cpinfoex; - int use_compat = TRUE; - int flag = 0; - char *name; - char *p; - - name = xstrndup(_name, strlen(_name)); - if (name == NULL) - return FALSE; - - /* check for option "enc_name//opt1//opt2" */ - while ((p = strrstr(name, "//")) != NULL) - { - if (_stricmp(p + 2, "nocompat") == 0) - use_compat = FALSE; - else if (_stricmp(p + 2, "translit") == 0) - flag |= FLAG_TRANSLIT; - else if (_stricmp(p + 2, "ignore") == 0) - flag |= FLAG_IGNORE; - *p = 0; - } - - cv->mode = 0; - cv->flags = flag; - cv->mblen = NULL; - cv->flush = NULL; - cv->compat = NULL; - cv->codepage = name_to_codepage(name); - if (cv->codepage == 1200 || cv->codepage == 1201) - { - cv->mbtowc = utf16_mbtowc; - cv->wctomb = utf16_wctomb; - if (_stricmp(name, "UTF-16") == 0 || _stricmp(name, "UTF16") == 0) - cv->flags |= FLAG_USE_BOM; - } - else if (cv->codepage == 12000 || cv->codepage == 12001) - { - cv->mbtowc = utf32_mbtowc; - cv->wctomb = utf32_wctomb; - if (_stricmp(name, "UTF-32") == 0 || _stricmp(name, "UTF32") == 0) - cv->flags |= FLAG_USE_BOM; - } - else if (cv->codepage == 65001) - { - cv->mbtowc = kernel_mbtowc; - cv->wctomb = kernel_wctomb; - cv->mblen = utf8_mblen; - } - else if ((cv->codepage == 50220 || cv->codepage == 50221 || cv->codepage == 50222) && load_mlang()) - { - cv->mbtowc = iso2022jp_mbtowc; - cv->wctomb = iso2022jp_wctomb; - cv->flush = iso2022jp_flush; - } - else if (cv->codepage == 51932 && load_mlang()) - { - cv->mbtowc = mlang_mbtowc; - cv->wctomb = mlang_wctomb; - cv->mblen = eucjp_mblen; - } - else if (IsValidCodePage(cv->codepage) - && GetCPInfoEx(cv->codepage, 0, &cpinfoex) != 0) - { - cv->mbtowc = kernel_mbtowc; - cv->wctomb = kernel_wctomb; - if (cpinfoex.MaxCharSize == 1) - cv->mblen = sbcs_mblen; - else if (cpinfoex.MaxCharSize == 2) - cv->mblen = dbcs_mblen; - else - cv->mblen = mbcs_mblen; - } - else - { - /* not supported */ - free(name); - errno = EINVAL; - return FALSE; - } - - if (use_compat) - { - switch (cv->codepage) - { - case 932: cv->compat = cp932_compat; break; - case 20932: cv->compat = cp20932_compat; break; - case 51932: cv->compat = cp51932_compat; break; - case 50220: case 50221: case 50222: cv->compat = cp5022x_compat; break; - } - } - - free(name); - - return TRUE; -} - -static int -name_to_codepage(const char *name) -{ - int i; - - if (*name == '\0' || - strcmp(name, "char") == 0) - return GetACP(); - else if (strcmp(name, "wchar_t") == 0) - return 1200; - else if (_strnicmp(name, "cp", 2) == 0) - return atoi(name + 2); /* CP123 */ - else if ('0' <= name[0] && name[0] <= '9') - return atoi(name); /* 123 */ - else if (_strnicmp(name, "xx", 2) == 0) - return atoi(name + 2); /* XX123 for debug */ - - for (i = 0; codepage_alias[i].name != NULL; ++i) - if (_stricmp(name, codepage_alias[i].name) == 0) - return codepage_alias[i].codepage; - return -1; -} - -/* - * http://www.faqs.org/rfcs/rfc2781.html - */ -static uint -utf16_to_ucs4(const ushort *wbuf) -{ - uint wc = wbuf[0]; - if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF) - wc = ((wbuf[0] & 0x3FF) << 10) + (wbuf[1] & 0x3FF) + 0x10000; - return wc; -} - -static void -ucs4_to_utf16(uint wc, ushort *wbuf, int *wbufsize) -{ - if (wc < 0x10000) - { - wbuf[0] = wc; - *wbufsize = 1; - } - else - { - wc -= 0x10000; - wbuf[0] = 0xD800 | ((wc >> 10) & 0x3FF); - wbuf[1] = 0xDC00 | (wc & 0x3FF); - *wbufsize = 2; - } -} - -/* - * Check if codepage is one of those for which the dwFlags parameter - * to MultiByteToWideChar() must be zero. Return zero or - * MB_ERR_INVALID_CHARS. The docs in Platform SDK for for Windows - * Server 2003 R2 claims that also codepage 65001 is one of these, but - * that doesn't seem to be the case. The MSDN docs for MSVS2008 leave - * out 65001 (UTF-8), and that indeed seems to be the case on XP, it - * works fine to pass MB_ERR_INVALID_CHARS in dwFlags when converting - * from UTF-8. - */ -static int -mbtowc_flags(int codepage) -{ - return (codepage == 50220 || codepage == 50221 || - codepage == 50222 || codepage == 50225 || - codepage == 50227 || codepage == 50229 || - codepage == 52936 || codepage == 54936 || - (codepage >= 57002 && codepage <= 57011) || - codepage == 65000 || codepage == 42) ? 0 : MB_ERR_INVALID_CHARS; -} - -/* - * Check if codepage is one those for which the lpUsedDefaultChar - * parameter to WideCharToMultiByte() must be NULL. The docs in - * Platform SDK for for Windows Server 2003 R2 claims that this is the - * list below, while the MSDN docs for MSVS2008 claim that it is only - * for 65000 (UTF-7) and 65001 (UTF-8). This time the earlier Platform - * SDK seems to be correct, at least for XP. - */ -static int -must_use_null_useddefaultchar(int codepage) -{ - return (codepage == 65000 || codepage == 65001 || - codepage == 50220 || codepage == 50221 || - codepage == 50222 || codepage == 50225 || - codepage == 50227 || codepage == 50229 || - codepage == 52936 || codepage == 54936 || - (codepage >= 57002 && codepage <= 57011) || - codepage == 42); -} - -static char * -strrstr(const char *str, const char *token) -{ - int len = strlen(token); - const char *p = str + strlen(str); - - while (str <= --p) - if (p[0] == token[0] && strncmp(p, token, len) == 0) - return (char *)p; - return NULL; -} - -static char * -xstrndup(const char *s, size_t n) -{ - char *p; - - p = (char *)malloc(n + 1); - if (p == NULL) - return NULL; - memcpy(p, s, n); - p[n] = '\0'; - return p; -} - -static int -seterror(int err) -{ - errno = err; - return -1; -} - -#if defined(USE_LIBICONV_DLL) -static int -libiconv_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode) -{ - HMODULE hlibiconv = NULL; - HMODULE hmsvcrt = NULL; - char *dllname; - const char *p; - const char *e; - f_iconv_open _iconv_open; - - /* - * always try to load dll, so that we can switch dll in runtime. - */ - - /* XXX: getenv() can't get variable set by SetEnvironmentVariable() */ - p = getenv("WINICONV_LIBICONV_DLL"); - if (p == NULL) - p = DEFAULT_LIBICONV_DLL; - /* parse comma separated value */ - for ( ; *p != 0; p = (*e == ',') ? e + 1 : e) - { - e = strchr(p, ','); - if (p == e) - continue; - else if (e == NULL) - e = p + strlen(p); - dllname = xstrndup(p, e - p); - if (dllname == NULL) - return FALSE; - hlibiconv = LoadLibrary(dllname); - free(dllname); - if (hlibiconv != NULL) - { - if (hlibiconv == hwiniconv) - { - FreeLibrary(hlibiconv); - hlibiconv = NULL; - continue; - } - break; - } - } - - if (hlibiconv == NULL) - goto failed; - - hmsvcrt = find_imported_module_by_funcname(hlibiconv, "_errno"); - if (hmsvcrt == NULL) - goto failed; - - _iconv_open = (f_iconv_open)GetProcAddress(hlibiconv, "libiconv_open"); - if (_iconv_open == NULL) - _iconv_open = (f_iconv_open)GetProcAddress(hlibiconv, "iconv_open"); - cd->iconv_close = (f_iconv_close)GetProcAddress(hlibiconv, "libiconv_close"); - if (cd->iconv_close == NULL) - cd->iconv_close = (f_iconv_close)GetProcAddress(hlibiconv, "iconv_close"); - cd->iconv = (f_iconv)GetProcAddress(hlibiconv, "libiconv"); - if (cd->iconv == NULL) - cd->iconv = (f_iconv)GetProcAddress(hlibiconv, "iconv"); - cd->_errno = (f_errno)GetProcAddress(hmsvcrt, "_errno"); - if (_iconv_open == NULL || cd->iconv_close == NULL - || cd->iconv == NULL || cd->_errno == NULL) - goto failed; - - cd->cd = _iconv_open(tocode, fromcode); - if (cd->cd == (iconv_t)(-1)) - goto failed; - - cd->hlibiconv = hlibiconv; - return TRUE; - -failed: - if (hlibiconv != NULL) - FreeLibrary(hlibiconv); - /* do not free hmsvcrt which is obtained by GetModuleHandle() */ - return FALSE; -} - -/* - * Reference: - * http://forums.belution.com/ja/vc/000/234/78s.shtml - * http://nienie.com/~masapico/api_ImageDirectoryEntryToData.html - * - * The formal way is - * imagehlp.h or dbghelp.h - * imagehlp.lib or dbghelp.lib - * ImageDirectoryEntryToData() - */ -#define TO_DOS_HEADER(base) ((PIMAGE_DOS_HEADER)(base)) -#define TO_NT_HEADERS(base) ((PIMAGE_NT_HEADERS)((LPBYTE)(base) + TO_DOS_HEADER(base)->e_lfanew)) -static PVOID -MyImageDirectoryEntryToData(LPVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size) -{ - /* TODO: MappedAsImage? */ - PIMAGE_DATA_DIRECTORY p; - p = TO_NT_HEADERS(Base)->OptionalHeader.DataDirectory + DirectoryEntry; - if (p->VirtualAddress == 0) { - *Size = 0; - return NULL; - } - *Size = p->Size; - return (PVOID)((LPBYTE)Base + p->VirtualAddress); -} - -static HMODULE -find_imported_module_by_funcname(HMODULE hModule, const char *funcname) -{ - DWORD Base; - ULONG Size; - PIMAGE_IMPORT_DESCRIPTOR Imp; - PIMAGE_THUNK_DATA Name; /* Import Name Table */ - PIMAGE_IMPORT_BY_NAME ImpName; - - Base = (DWORD)hModule; - Imp = MyImageDirectoryEntryToData( - (LPVOID)Base, - TRUE, - IMAGE_DIRECTORY_ENTRY_IMPORT, - &Size); - if (Imp == NULL) - return NULL; - for ( ; Imp->OriginalFirstThunk != 0; ++Imp) - { - Name = (PIMAGE_THUNK_DATA)(Base + Imp->OriginalFirstThunk); - for ( ; Name->u1.Ordinal != 0; ++Name) - { - if (!IMAGE_SNAP_BY_ORDINAL(Name->u1.Ordinal)) - { - ImpName = (PIMAGE_IMPORT_BY_NAME) - (Base + (DWORD)Name->u1.AddressOfData); - if (strcmp((char *)ImpName->Name, funcname) == 0) - return GetModuleHandle((char *)(Base + Imp->Name)); - } - } - } - return NULL; -} -#endif - -static int -sbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize) -{ - return 1; -} - -static int -dbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize) -{ - int len = IsDBCSLeadByteEx(cv->codepage, buf[0]) ? 2 : 1; - if (bufsize < len) - return seterror(EINVAL); - return len; -} - -static int -mbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize) -{ - int len = 0; - - if (cv->codepage == 54936) { - if (buf[0] <= 0x7F) len = 1; - else if (buf[0] >= 0x81 && buf[0] <= 0xFE && - bufsize >= 2 && - ((buf[1] >= 0x40 && buf[1] <= 0x7E) || - (buf[1] >= 0x80 && buf[1] <= 0xFE))) len = 2; - else if (buf[0] >= 0x81 && buf[0] <= 0xFE && - bufsize >= 4 && - buf[1] >= 0x30 && buf[1] <= 0x39) len = 4; - else - return seterror(EINVAL); - return len; - } - else - return seterror(EINVAL); -} - -static int -utf8_mblen(csconv_t *cv, const uchar *buf, int bufsize) -{ - int len = 0; - - if (buf[0] < 0x80) len = 1; - else if ((buf[0] & 0xE0) == 0xC0) len = 2; - else if ((buf[0] & 0xF0) == 0xE0) len = 3; - else if ((buf[0] & 0xF8) == 0xF0) len = 4; - else if ((buf[0] & 0xFC) == 0xF8) len = 5; - else if ((buf[0] & 0xFE) == 0xFC) len = 6; - - if (len == 0) - return seterror(EILSEQ); - else if (bufsize < len) - return seterror(EINVAL); - return len; -} - -static int -eucjp_mblen(csconv_t *cv, const uchar *buf, int bufsize) -{ - if (buf[0] < 0x80) /* ASCII */ - return 1; - else if (buf[0] == 0x8E) /* JIS X 0201 */ - { - if (bufsize < 2) - return seterror(EINVAL); - else if (!(0xA1 <= buf[1] && buf[1] <= 0xDF)) - return seterror(EILSEQ); - return 2; - } - else if (buf[0] == 0x8F) /* JIS X 0212 */ - { - if (bufsize < 3) - return seterror(EINVAL); - else if (!(0xA1 <= buf[1] && buf[1] <= 0xFE) - || !(0xA1 <= buf[2] && buf[2] <= 0xFE)) - return seterror(EILSEQ); - return 3; - } - else /* JIS X 0208 */ - { - if (bufsize < 2) - return seterror(EINVAL); - else if (!(0xA1 <= buf[0] && buf[0] <= 0xFE) - || !(0xA1 <= buf[1] && buf[1] <= 0xFE)) - return seterror(EILSEQ); - return 2; - } -} - -static int -kernel_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) -{ - int len; - - len = cv->mblen(cv, buf, bufsize); - if (len == -1) - return -1; - *wbufsize = MultiByteToWideChar(cv->codepage, mbtowc_flags (cv->codepage), - (const char *)buf, len, (wchar_t *)wbuf, *wbufsize); - if (*wbufsize == 0) - return seterror(EILSEQ); - return len; -} - -static int -kernel_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) -{ - BOOL usedDefaultChar = 0; - BOOL *p = NULL; - int flags = 0; - int len; - - if (bufsize == 0) - return seterror(E2BIG); - if (!must_use_null_useddefaultchar(cv->codepage)) - { - p = &usedDefaultChar; -#ifdef WC_NO_BEST_FIT_CHARS - if (!(cv->flags & FLAG_TRANSLIT)) - flags |= WC_NO_BEST_FIT_CHARS; -#endif - } - len = WideCharToMultiByte(cv->codepage, flags, - (const wchar_t *)wbuf, wbufsize, (char *)buf, bufsize, NULL, p); - if (len == 0) - { - if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) - return seterror(E2BIG); - return seterror(EILSEQ); - } - else if (usedDefaultChar) - return seterror(EILSEQ); - else if (cv->mblen(cv, buf, len) != len) /* validate result */ - return seterror(EILSEQ); - return len; -} - -/* - * It seems that the mode (cv->mode) is fixnum. - * For example, when converting iso-2022-jp(cp50221) to unicode: - * in ascii sequence: mode=0xC42C0000 - * in jisx0208 sequence: mode=0xC42C0001 - * "C42C" is same for each convert session. - * It should be: ((codepage-1)<<16)|state - */ -static int -mlang_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) -{ - int len; - int insize; - HRESULT hr; - - len = cv->mblen(cv, buf, bufsize); - if (len == -1) - return -1; - insize = len; - hr = ConvertINetMultiByteToUnicode(&cv->mode, cv->codepage, - (const char *)buf, &insize, (wchar_t *)wbuf, wbufsize); - if (hr != S_OK || insize != len) - return seterror(EILSEQ); - return len; -} - -static int -mlang_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) -{ - char tmpbuf[MB_CHAR_MAX]; /* enough room for one character */ - int tmpsize = MB_CHAR_MAX; - int insize = wbufsize; - HRESULT hr; - - hr = ConvertINetUnicodeToMultiByte(&cv->mode, cv->codepage, - (const wchar_t *)wbuf, &wbufsize, tmpbuf, &tmpsize); - if (hr != S_OK || insize != wbufsize) - return seterror(EILSEQ); - else if (bufsize < tmpsize) - return seterror(E2BIG); - else if (cv->mblen(cv, (uchar *)tmpbuf, tmpsize) != tmpsize) - return seterror(EILSEQ); - memcpy(buf, tmpbuf, tmpsize); - return tmpsize; -} - -static int -utf16_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) -{ - int codepage = cv->codepage; - - /* swap endian: 1200 <-> 1201 */ - if (cv->mode & UNICODE_MODE_SWAPPED) - codepage ^= 1; - - if (bufsize < 2) - return seterror(EINVAL); - if (codepage == 1200) /* little endian */ - wbuf[0] = (buf[1] << 8) | buf[0]; - else if (codepage == 1201) /* big endian */ - wbuf[0] = (buf[0] << 8) | buf[1]; - - if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) - { - cv->mode |= UNICODE_MODE_BOM_DONE; - if (wbuf[0] == 0xFFFE) - { - cv->mode |= UNICODE_MODE_SWAPPED; - *wbufsize = 0; - return 2; - } - else if (wbuf[0] == 0xFEFF) - { - *wbufsize = 0; - return 2; - } - } - - if (0xDC00 <= wbuf[0] && wbuf[0] <= 0xDFFF) - return seterror(EILSEQ); - if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF) - { - if (bufsize < 4) - return seterror(EINVAL); - if (codepage == 1200) /* little endian */ - wbuf[1] = (buf[3] << 8) | buf[2]; - else if (codepage == 1201) /* big endian */ - wbuf[1] = (buf[2] << 8) | buf[3]; - if (!(0xDC00 <= wbuf[1] && wbuf[1] <= 0xDFFF)) - return seterror(EILSEQ); - *wbufsize = 2; - return 4; - } - *wbufsize = 1; - return 2; -} - -static int -utf16_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) -{ - if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) - { - int r; - - cv->mode |= UNICODE_MODE_BOM_DONE; - if (bufsize < 2) - return seterror(E2BIG); - if (cv->codepage == 1200) /* little endian */ - memcpy(buf, "\xFF\xFE", 2); - else if (cv->codepage == 1201) /* big endian */ - memcpy(buf, "\xFE\xFF", 2); - - r = utf16_wctomb(cv, wbuf, wbufsize, buf + 2, bufsize - 2); - if (r == -1) - return -1; - return r + 2; - } - - if (bufsize < 2) - return seterror(E2BIG); - if (cv->codepage == 1200) /* little endian */ - { - buf[0] = (wbuf[0] & 0x00FF); - buf[1] = (wbuf[0] & 0xFF00) >> 8; - } - else if (cv->codepage == 1201) /* big endian */ - { - buf[0] = (wbuf[0] & 0xFF00) >> 8; - buf[1] = (wbuf[0] & 0x00FF); - } - if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF) - { - if (bufsize < 4) - return seterror(E2BIG); - if (cv->codepage == 1200) /* little endian */ - { - buf[2] = (wbuf[1] & 0x00FF); - buf[3] = (wbuf[1] & 0xFF00) >> 8; - } - else if (cv->codepage == 1201) /* big endian */ - { - buf[2] = (wbuf[1] & 0xFF00) >> 8; - buf[3] = (wbuf[1] & 0x00FF); - } - return 4; - } - return 2; -} - -static int -utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) -{ - int codepage = cv->codepage; - uint wc; - - /* swap endian: 12000 <-> 12001 */ - if (cv->mode & UNICODE_MODE_SWAPPED) - codepage ^= 1; - - if (bufsize < 4) - return seterror(EINVAL); - if (codepage == 12000) /* little endian */ - wc = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; - else if (codepage == 12001) /* big endian */ - wc = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; - - if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) - { - cv->mode |= UNICODE_MODE_BOM_DONE; - if (wc == 0xFFFE0000) - { - cv->mode |= UNICODE_MODE_SWAPPED; - *wbufsize = 0; - return 4; - } - else if (wc == 0x0000FEFF) - { - *wbufsize = 0; - return 4; - } - } - - if ((0xD800 <= wc && wc <= 0xDFFF) || 0x10FFFF < wc) - return seterror(EILSEQ); - ucs4_to_utf16(wc, wbuf, wbufsize); - return 4; -} - -static int -utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) -{ - uint wc; - - if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) - { - int r; - - cv->mode |= UNICODE_MODE_BOM_DONE; - if (bufsize < 4) - return seterror(E2BIG); - if (cv->codepage == 12000) /* little endian */ - memcpy(buf, "\xFF\xFE\x00\x00", 4); - else if (cv->codepage == 12001) /* big endian */ - memcpy(buf, "\x00\x00\xFE\xFF", 4); - - r = utf32_wctomb(cv, wbuf, wbufsize, buf + 4, bufsize - 4); - if (r == -1) - return -1; - return r + 4; - } - - if (bufsize < 4) - return seterror(E2BIG); - wc = utf16_to_ucs4(wbuf); - if (cv->codepage == 12000) /* little endian */ - { - buf[0] = wc & 0x000000FF; - buf[1] = (wc & 0x0000FF00) >> 8; - buf[2] = (wc & 0x00FF0000) >> 16; - buf[3] = (wc & 0xFF000000) >> 24; - } - else if (cv->codepage == 12001) /* big endian */ - { - buf[0] = (wc & 0xFF000000) >> 24; - buf[1] = (wc & 0x00FF0000) >> 16; - buf[2] = (wc & 0x0000FF00) >> 8; - buf[3] = wc & 0x000000FF; - } - return 4; -} - -/* - * 50220: ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS) - * 50221: ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow - * 1 byte Kana) - * 50222: ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte - * Kana - SO/SI) - * - * MultiByteToWideChar() and WideCharToMultiByte() behave differently - * depending on Windows version. On XP, WideCharToMultiByte() doesn't - * terminate result sequence with ascii escape. But Vista does. - * Use MLang instead. - */ - -#define ISO2022_MODE(cs, shift) (((cs) << 8) | (shift)) -#define ISO2022_MODE_CS(mode) (((mode) >> 8) & 0xFF) -#define ISO2022_MODE_SHIFT(mode) ((mode) & 0xFF) - -#define ISO2022_SI 0 -#define ISO2022_SO 1 - -/* shift in */ -static const char iso2022_SI_seq[] = "\x0F"; -/* shift out */ -static const char iso2022_SO_seq[] = "\x0E"; - -typedef struct iso2022_esc_t iso2022_esc_t; -struct iso2022_esc_t { - const char *esc; - int esc_len; - int len; - int cs; -}; - -#define ISO2022JP_CS_ASCII 0 -#define ISO2022JP_CS_JISX0201_ROMAN 1 -#define ISO2022JP_CS_JISX0201_KANA 2 -#define ISO2022JP_CS_JISX0208_1978 3 -#define ISO2022JP_CS_JISX0208_1983 4 -#define ISO2022JP_CS_JISX0212 5 - -static iso2022_esc_t iso2022jp_esc[] = { - {"\x1B\x28\x42", 3, 1, ISO2022JP_CS_ASCII}, - {"\x1B\x28\x4A", 3, 1, ISO2022JP_CS_JISX0201_ROMAN}, - {"\x1B\x28\x49", 3, 1, ISO2022JP_CS_JISX0201_KANA}, - {"\x1B\x24\x40", 3, 2, ISO2022JP_CS_JISX0208_1983}, /* unify 1978 with 1983 */ - {"\x1B\x24\x42", 3, 2, ISO2022JP_CS_JISX0208_1983}, - {"\x1B\x24\x28\x44", 4, 2, ISO2022JP_CS_JISX0212}, - {NULL, 0, 0, 0} -}; - -static int -iso2022jp_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) -{ - iso2022_esc_t *iesc = iso2022jp_esc; - char tmp[MB_CHAR_MAX]; - int insize; - HRESULT hr; - DWORD dummy = 0; - int len; - int esc_len; - int cs; - int shift; - int i; - - if (buf[0] == 0x1B) - { - for (i = 0; iesc[i].esc != NULL; ++i) - { - esc_len = iesc[i].esc_len; - if (bufsize < esc_len) - { - if (strncmp((char *)buf, iesc[i].esc, bufsize) == 0) - return seterror(EINVAL); - } - else - { - if (strncmp((char *)buf, iesc[i].esc, esc_len) == 0) - { - cv->mode = ISO2022_MODE(iesc[i].cs, ISO2022_SI); - *wbufsize = 0; - return esc_len; - } - } - } - /* not supported escape sequence */ - return seterror(EILSEQ); - } - else if (buf[0] == iso2022_SO_seq[0]) - { - cv->mode = ISO2022_MODE(ISO2022_MODE_CS(cv->mode), ISO2022_SO); - *wbufsize = 0; - return 1; - } - else if (buf[0] == iso2022_SI_seq[0]) - { - cv->mode = ISO2022_MODE(ISO2022_MODE_CS(cv->mode), ISO2022_SI); - *wbufsize = 0; - return 1; - } - - cs = ISO2022_MODE_CS(cv->mode); - shift = ISO2022_MODE_SHIFT(cv->mode); - - /* reset the mode for informal sequence */ - if (buf[0] < 0x20) - { - cs = ISO2022JP_CS_ASCII; - shift = ISO2022_SI; - } - - len = iesc[cs].len; - if (bufsize < len) - return seterror(EINVAL); - for (i = 0; i < len; ++i) - if (!(buf[i] < 0x80)) - return seterror(EILSEQ); - esc_len = iesc[cs].esc_len; - memcpy(tmp, iesc[cs].esc, esc_len); - if (shift == ISO2022_SO) - { - memcpy(tmp + esc_len, iso2022_SO_seq, 1); - esc_len += 1; - } - memcpy(tmp + esc_len, buf, len); - - if ((cv->codepage == 50220 || cv->codepage == 50221 - || cv->codepage == 50222) && shift == ISO2022_SO) - { - /* XXX: shift-out cannot be used for mbtowc (both kernel and - * mlang) */ - esc_len = iesc[ISO2022JP_CS_JISX0201_KANA].esc_len; - memcpy(tmp, iesc[ISO2022JP_CS_JISX0201_KANA].esc, esc_len); - memcpy(tmp + esc_len, buf, len); - } - - insize = len + esc_len; - hr = ConvertINetMultiByteToUnicode(&dummy, cv->codepage, - (const char *)tmp, &insize, (wchar_t *)wbuf, wbufsize); - if (hr != S_OK || insize != len + esc_len) - return seterror(EILSEQ); - - /* Check for conversion error. Assuming defaultChar is 0x3F. */ - /* ascii should be converted from ascii */ - if (wbuf[0] == buf[0] - && cv->mode != ISO2022_MODE(ISO2022JP_CS_ASCII, ISO2022_SI)) - return seterror(EILSEQ); - - /* reset the mode for informal sequence */ - if (cv->mode != ISO2022_MODE(cs, shift)) - cv->mode = ISO2022_MODE(cs, shift); - - return len; -} - -static int -iso2022jp_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) -{ - iso2022_esc_t *iesc = iso2022jp_esc; - char tmp[MB_CHAR_MAX]; - int tmpsize = MB_CHAR_MAX; - int insize = wbufsize; - HRESULT hr; - DWORD dummy = 0; - int len; - int esc_len; - int cs; - int shift; - int i; - - /* - * MultiByte = [escape sequence] + character + [escape sequence] - * - * Whether trailing escape sequence is added depends on which API is - * used (kernel or MLang, and its version). - */ - hr = ConvertINetUnicodeToMultiByte(&dummy, cv->codepage, - (const wchar_t *)wbuf, &wbufsize, tmp, &tmpsize); - if (hr != S_OK || insize != wbufsize) - return seterror(EILSEQ); - else if (bufsize < tmpsize) - return seterror(E2BIG); - - if (tmpsize == 1) - { - cs = ISO2022JP_CS_ASCII; - esc_len = 0; - } - else - { - for (i = 1; iesc[i].esc != NULL; ++i) - { - esc_len = iesc[i].esc_len; - if (strncmp(tmp, iesc[i].esc, esc_len) == 0) - { - cs = iesc[i].cs; - break; - } - } - if (iesc[i].esc == NULL) - /* not supported escape sequence */ - return seterror(EILSEQ); - } - - shift = ISO2022_SI; - if (tmp[esc_len] == iso2022_SO_seq[0]) - { - shift = ISO2022_SO; - esc_len += 1; - } - - len = iesc[cs].len; - - /* Check for converting error. Assuming defaultChar is 0x3F. */ - /* ascii should be converted from ascii */ - if (cs == ISO2022JP_CS_ASCII && !(wbuf[0] < 0x80)) - return seterror(EILSEQ); - else if (tmpsize < esc_len + len) - return seterror(EILSEQ); - - if (cv->mode == ISO2022_MODE(cs, shift)) - { - /* remove escape sequence */ - if (esc_len != 0) - memmove(tmp, tmp + esc_len, len); - esc_len = 0; - } - else - { - if (cs == ISO2022JP_CS_ASCII) - { - esc_len = iesc[ISO2022JP_CS_ASCII].esc_len; - memmove(tmp + esc_len, tmp, len); - memcpy(tmp, iesc[ISO2022JP_CS_ASCII].esc, esc_len); - } - if (ISO2022_MODE_SHIFT(cv->mode) == ISO2022_SO) - { - /* shift-in before changing to other mode */ - memmove(tmp + 1, tmp, len + esc_len); - memcpy(tmp, iso2022_SI_seq, 1); - esc_len += 1; - } - } - - if (bufsize < len + esc_len) - return seterror(E2BIG); - memcpy(buf, tmp, len + esc_len); - cv->mode = ISO2022_MODE(cs, shift); - return len + esc_len; -} - -static int -iso2022jp_flush(csconv_t *cv, uchar *buf, int bufsize) -{ - iso2022_esc_t *iesc = iso2022jp_esc; - int esc_len; - - if (cv->mode != ISO2022_MODE(ISO2022JP_CS_ASCII, ISO2022_SI)) - { - esc_len = 0; - if (ISO2022_MODE_SHIFT(cv->mode) != ISO2022_SI) - esc_len += 1; - if (ISO2022_MODE_CS(cv->mode) != ISO2022JP_CS_ASCII) - esc_len += iesc[ISO2022JP_CS_ASCII].esc_len; - if (bufsize < esc_len) - return seterror(E2BIG); - - esc_len = 0; - if (ISO2022_MODE_SHIFT(cv->mode) != ISO2022_SI) - { - memcpy(buf, iso2022_SI_seq, 1); - esc_len += 1; - } - if (ISO2022_MODE_CS(cv->mode) != ISO2022JP_CS_ASCII) - { - memcpy(buf + esc_len, iesc[ISO2022JP_CS_ASCII].esc, - iesc[ISO2022JP_CS_ASCII].esc_len); - esc_len += iesc[ISO2022JP_CS_ASCII].esc_len; - } - return esc_len; - } - return 0; -} - -#if defined(MAKE_DLL) && defined(USE_LIBICONV_DLL) -BOOL WINAPI -DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) -{ - switch( fdwReason ) - { - case DLL_PROCESS_ATTACH: - hwiniconv = (HMODULE)hinstDLL; - break; - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} -#endif - -#if defined(MAKE_EXE) -#include -#include -#include -int -main(int argc, char **argv) -{ - char *fromcode = NULL; - char *tocode = NULL; - int i; - char inbuf[BUFSIZ]; - char outbuf[BUFSIZ]; - const char *pin; - char *pout; - size_t inbytesleft; - size_t outbytesleft; - size_t rest = 0; - iconv_t cd; - size_t r; - FILE *in = stdin; - - _setmode(_fileno(stdin), _O_BINARY); - _setmode(_fileno(stdout), _O_BINARY); - - for (i = 1; i < argc; ++i) - { - if (strcmp(argv[i], "-l") == 0) - { - for (i = 0; codepage_alias[i].name != NULL; ++i) - printf("%s\n", codepage_alias[i].name); - return 0; - } - - if (strcmp(argv[i], "-f") == 0) - fromcode = argv[++i]; - else if (strcmp(argv[i], "-t") == 0) - tocode = argv[++i]; - else - { - in = fopen(argv[i], "rb"); - if (in == NULL) - { - fprintf(stderr, "cannot open %s\n", argv[i]); - return 1; - } - break; - } - } - - if (fromcode == NULL || tocode == NULL) - { - printf("usage: %s -f from-enc -t to-enc [file]\n", argv[0]); - return 0; - } - - cd = iconv_open(tocode, fromcode); - if (cd == (iconv_t)(-1)) - { - perror("iconv_open error"); - return 1; - } - - while ((inbytesleft = fread(inbuf + rest, 1, sizeof(inbuf) - rest, in)) != 0 - || rest != 0) - { - inbytesleft += rest; - pin = inbuf; - pout = outbuf; - outbytesleft = sizeof(outbuf); - r = iconv(cd, &pin, &inbytesleft, &pout, &outbytesleft); - fwrite(outbuf, 1, sizeof(outbuf) - outbytesleft, stdout); - if (r == (size_t)(-1) && errno != E2BIG && (errno != EINVAL || feof(in))) - { - perror("conversion error"); - return 1; - } - memmove(inbuf, pin, inbytesleft); - rest = inbytesleft; - } - pout = outbuf; - outbytesleft = sizeof(outbuf); - r = iconv(cd, NULL, NULL, &pout, &outbytesleft); - fwrite(outbuf, 1, sizeof(outbuf) - outbytesleft, stdout); - if (r == (size_t)(-1)) - { - perror("conversion error"); - return 1; - } - - iconv_close(cd); - - return 0; -} -#endif - diff --git a/src/mod/endpoints/mod_gsmopen/win_iconv/win_iconv_test.c b/src/mod/endpoints/mod_gsmopen/win_iconv/win_iconv_test.c deleted file mode 100644 index b2aafa4a57..0000000000 --- a/src/mod/endpoints/mod_gsmopen/win_iconv/win_iconv_test.c +++ /dev/null @@ -1,261 +0,0 @@ - -#include "win_iconv.c" -#include - -const char * -tohex(const char *str, int size) -{ - static char buf[BUFSIZ]; - char *pbuf = buf; - int i; - buf[0] = 0; - for (i = 0; i < size; ++i) - pbuf += sprintf(pbuf, "%02X", str[i] & 0xFF); - return buf; -} - -const char * -errstr(int errcode) -{ - static char buf[BUFSIZ]; - switch (errcode) - { - case 0: return "NOERROR"; - case EINVAL: return "EINVAL"; - case EILSEQ: return "EILSEQ"; - case E2BIG: return "E2BIG"; - } - sprintf(buf, "%d\n", errcode); - return buf; -} - -#ifdef USE_LIBICONV_DLL -int use_dll; - -int -setdll(const char *dllpath) -{ - char buf[BUFSIZ]; - rec_iconv_t cd; - - sprintf(buf, "WINICONV_LIBICONV_DLL=%s", dllpath); - putenv(buf); - if (libiconv_iconv_open(&cd, "ascii", "ascii")) - { - FreeLibrary(cd.hlibiconv); - use_dll = TRUE; - return TRUE; - } - use_dll = FALSE; - return FALSE; -} -#endif - -/* - * We can test the codepage that is installed in the system. - */ -int -check_enc(const char *encname, int codepage) -{ - iconv_t cd; - int cp; - cd = iconv_open("utf-8", encname); - if (cd == (iconv_t)(-1)) - { - printf("%s(%d) IS NOT SUPPORTED: SKIP THE TEST\n", encname, codepage); - return FALSE; - } - cp = ((rec_iconv_t *)cd)->from.codepage; - if (cp != codepage) - { - printf("%s(%d) ALIAS IS MAPPED TO DIFFERENT CODEPAGE (%d)\n", encname, codepage, cp); - exit(1); - } - iconv_close(cd); - return TRUE; -} - -int use_dll; - -void -test(const char *from, const char *fromstr, int fromsize, const char *to, const char *tostr, int tosize, int errcode, int bufsize, int line) -{ - char outbuf[BUFSIZ]; - const char *pin; - char *pout; - size_t inbytesleft; - size_t outbytesleft; - iconv_t cd; - size_t r; - char dllpath[_MAX_PATH]; - - cd = iconv_open(to, from); - if (cd == (iconv_t)(-1)) - { - printf("%s -> %s: NG: INVALID ENCODING NAME: line=%d\n", from, to, line); - exit(1); - } - -#ifdef USE_LIBICONV_DLL - if (((rec_iconv_t *)cd)->hlibiconv != NULL) - GetModuleFileName(((rec_iconv_t *)cd)->hlibiconv, dllpath, sizeof(dllpath)); - - if (use_dll && ((rec_iconv_t *)cd)->hlibiconv == NULL) - { - printf("%s: %s -> %s: NG: FAILED TO USE DLL: line=%d\n", dllpath, from, to, line); - exit(1); - } - else if (!use_dll && ((rec_iconv_t *)cd)->hlibiconv != NULL) - { - printf("%s: %s -> %s: NG: DLL IS LOADED UNEXPECTEDLY: line=%d\n", dllpath, from, to, line); - exit(1); - } -#endif - - errno = 0; - - pin = fromstr; - pout = outbuf; - inbytesleft = fromsize; - outbytesleft = bufsize; - r = iconv(cd, &pin, &inbytesleft, &pout, &outbytesleft); - if (r != (size_t)(-1)) - r = iconv(cd, NULL, NULL, &pout, &outbytesleft); - *pout = 0; - -#ifdef USE_LIBICONV_DLL - if (use_dll) - printf("%s: ", dllpath); -#endif - printf("%s(%s) -> ", from, tohex(fromstr, fromsize)); - printf("%s(%s%s%s): ", to, tohex(tostr, tosize), - errcode == 0 ? "" : ":", - errcode == 0 ? "" : errstr(errcode)); - if (strcmp(outbuf, tostr) == 0 && errno == errcode) - printf("OK\n"); - else - { - printf("RESULT(%s:%s): ", tohex(outbuf, sizeof(outbuf) - outbytesleft), - errstr(errno)); - printf("NG: line=%d\n", line); - exit(1); - } -} - -#define STATIC_STRLEN(arr) (sizeof(arr) - 1) - -#define success(from, fromstr, to, tostr) test(from, fromstr, STATIC_STRLEN(fromstr), to, tostr, STATIC_STRLEN(tostr), 0, BUFSIZ, __LINE__) -#define einval(from, fromstr, to, tostr) test(from, fromstr, STATIC_STRLEN(fromstr), to, tostr, STATIC_STRLEN(tostr), EINVAL, BUFSIZ, __LINE__) -#define eilseq(from, fromstr, to, tostr) test(from, fromstr, STATIC_STRLEN(fromstr), to, tostr, STATIC_STRLEN(tostr), EILSEQ, BUFSIZ, __LINE__) -#define e2big(from, fromstr, to, tostr, bufsize) test(from, fromstr, STATIC_STRLEN(fromstr), to, tostr, STATIC_STRLEN(tostr), E2BIG, bufsize, __LINE__) - -int -main(int argc, char **argv) -{ -#ifdef USE_LIBICONV_DLL - /* test use of dll if $DEFAULT_LIBICONV_DLL was defined. */ - if (setdll("")) - { - success("ascii", "ABC", "ascii", "ABC"); - success("ascii", "ABC", "utf-16be", "\x00\x41\x00\x42\x00\x43"); - } - else - { - printf("\nDLL TEST IS SKIPPED\n\n"); - } - - setdll("none"); -#endif - - if (check_enc("ascii", 20127)) - { - success("ascii", "ABC", "ascii", "ABC"); - /* MSB is dropped. Hmm... */ - success("ascii", "\x80\xFF", "ascii", "\x00\x7F"); - } - - /* unicode (CP1200 CP1201 CP12000 CP12001 CP65001) */ - if (check_enc("utf-8", 65001) - && check_enc("utf-16be", 1201) && check_enc("utf-16le", 1200) - && check_enc("utf-32be", 12001) && check_enc("utf-32le", 12000) - ) - { - /* Test the BOM behavior - * 1. Remove the BOM when "fromcode" is utf-16 or utf-32. - * 2. Add the BOM when "tocode" is utf-16 or utf-32. */ - success("utf-16", "\xFE\xFF\x01\x02", "utf-16be", "\x01\x02"); - success("utf-16", "\xFF\xFE\x02\x01", "utf-16be", "\x01\x02"); - success("utf-32", "\x00\x00\xFE\xFF\x00\x00\x01\x02", "utf-32be", "\x00\x00\x01\x02"); - success("utf-32", "\xFF\xFE\x00\x00\x02\x01\x00\x00", "utf-32be", "\x00\x00\x01\x02"); - success("utf-16", "\xFE\xFF\x00\x01", "utf-8", "\x01"); -#ifndef GLIB_COMPILATION - success("utf-8", "\x01", "utf-16", "\xFE\xFF\x00\x01"); - success("utf-8", "\x01", "utf-32", "\x00\x00\xFE\xFF\x00\x00\x00\x01"); -#else - success("utf-8", "\x01", "utf-16", "\xFF\xFE\x01\x00"); - success("utf-8", "\x01", "utf-32", "\xFF\xFE\x00\x00\x01\x00\x00\x00"); -#endif - - success("utf-16be", "\xFE\xFF\x01\x02", "utf-16be", "\xFE\xFF\x01\x02"); - success("utf-16le", "\xFF\xFE\x02\x01", "utf-16be", "\xFE\xFF\x01\x02"); - success("utf-32be", "\x00\x00\xFE\xFF\x00\x00\x01\x02", "utf-32be", "\x00\x00\xFE\xFF\x00\x00\x01\x02"); - success("utf-32le", "\xFF\xFE\x00\x00\x02\x01\x00\x00", "utf-32be", "\x00\x00\xFE\xFF\x00\x00\x01\x02"); - success("utf-16be", "\xFE\xFF\x00\x01", "utf-8", "\xEF\xBB\xBF\x01"); - success("utf-8", "\xEF\xBB\xBF\x01", "utf-8", "\xEF\xBB\xBF\x01"); - - success("utf-16be", "\x01\x02", "utf-16le", "\x02\x01"); - success("utf-16le", "\x02\x01", "utf-16be", "\x01\x02"); - success("utf-16be", "\xFE\xFF", "utf-16le", "\xFF\xFE"); - success("utf-16le", "\xFF\xFE", "utf-16be", "\xFE\xFF"); - success("utf-32be", "\x00\x00\x03\x04", "utf-32le", "\x04\x03\x00\x00"); - success("utf-32le", "\x04\x03\x00\x00", "utf-32be", "\x00\x00\x03\x04"); - success("utf-32be", "\x00\x00\xFF\xFF", "utf-16be", "\xFF\xFF"); - success("utf-16be", "\xFF\xFF", "utf-32be", "\x00\x00\xFF\xFF"); - success("utf-32be", "\x00\x01\x00\x00", "utf-16be", "\xD8\x00\xDC\x00"); - success("utf-16be", "\xD8\x00\xDC\x00", "utf-32be", "\x00\x01\x00\x00"); - success("utf-32be", "\x00\x10\xFF\xFF", "utf-16be", "\xDB\xFF\xDF\xFF"); - success("utf-16be", "\xDB\xFF\xDF\xFF", "utf-32be", "\x00\x10\xFF\xFF"); - eilseq("utf-32be", "\x00\x11\x00\x00", "utf-16be", ""); - eilseq("utf-16be", "\xDB\xFF\xE0\x00", "utf-32be", ""); - success("utf-8", "\xE3\x81\x82", "utf-16be", "\x30\x42"); - einval("utf-8", "\xE3", "utf-16be", ""); - } - - /* Japanese (CP932 CP20932 CP50220 CP50221 CP50222 CP51932) */ - if (check_enc("cp932", 932) - && check_enc("cp20932", 20932) && check_enc("euc-jp", 51932) - && check_enc("cp50220", 50220) && check_enc("cp50221", 50221) - && check_enc("cp50222", 50222) && check_enc("iso-2022-jp", 50221)) - { - /* Test the compatibility for each other Japanese codepage. - * And validate the escape sequence handling for iso-2022-jp. */ - success("utf-16be", "\xFF\x5E", "cp932", "\x81\x60"); - success("utf-16be", "\x30\x1C", "cp932", "\x81\x60"); - success("utf-16be", "\xFF\x5E", "cp932//nocompat", "\x81\x60"); - eilseq("utf-16be", "\x30\x1C", "cp932//nocompat", ""); - success("euc-jp", "\xA4\xA2", "utf-16be", "\x30\x42"); - einval("euc-jp", "\xA4\xA2\xA4", "utf-16be", "\x30\x42"); - eilseq("euc-jp", "\xA4\xA2\xFF\xFF", "utf-16be", "\x30\x42"); - success("cp932", "\x81\x60", "iso-2022-jp", "\x1B\x24\x42\x21\x41\x1B\x28\x42"); - success("UTF-16BE", "\xFF\x5E", "iso-2022-jp", "\x1B\x24\x42\x21\x41\x1B\x28\x42"); - eilseq("UTF-16BE", "\x30\x1C", "iso-2022-jp//nocompat", ""); - success("UTF-16BE", "\x30\x42\x30\x44", "iso-2022-jp", "\x1B\x24\x42\x24\x22\x24\x24\x1B\x28\x42"); - success("iso-2022-jp", "\x1B\x24\x42\x21\x41\x1B\x28\x42", "UTF-16BE", "\xFF\x5E"); - } - - /* - * test for //translit - * U+FF41 (FULLWIDTH LATIN SMALL LETTER A) <-> U+0062 (LATIN SMALL LETTER A) - */ - eilseq("UTF-16BE", "\xFF\x41", "iso-8859-1", ""); - success("UTF-16BE", "\xFF\x41", "iso-8859-1//translit", "a"); - - /* - * TODO: - * Test for state after iconv() failed. - * Ensure iconv() error is safe and continuable. - */ - - return 0; -} - diff --git a/w32/Setup/Setup.2017.wixproj b/w32/Setup/Setup.2017.wixproj index ef66d7c2e8..5bd65cfa18 100644 --- a/w32/Setup/Setup.2017.wixproj +++ b/w32/Setup/Setup.2017.wixproj @@ -521,14 +521,6 @@ Binaries;Content;Satellites INSTALLFOLDER - - mod_gsmopen - {74b120ff-6935-4dfe-a142-cdb6bea99c90} - True - True - Binaries;Content;Satellites - INSTALLFOLDER - mod_loopback {b3f424ec-3d8f-417c-b244-3919d5e1a577}