From b3e8b2020a9d40a5d7e08ed69ad427013890c9d8 Mon Sep 17 00:00:00 2001 From: Jinkun Jang Date: Wed, 13 Mar 2013 01:50:02 +0900 Subject: [PATCH] Tizen 2.1 base --- AUTHORS | 3 + LICENSE.APLv2 | 204 + Makefile.am | 69 + NOTICE | 3 + audio_device.png | Bin 0 -> 27428 bytes autogen.sh | 6 + common/Makefile.am | 24 + common/mm_ipc.c | 151 + common/mm_sound_utils.c | 222 + common/mm_source.c | 299 + configure | 15649 +++++++++++++++++++ configure.ac | 127 + depcomp | 589 + include/mm_ipc.h | 97 + include/mm_sound.h | 2163 +++ include/mm_sound_client.h | 46 + include/mm_sound_common.h | 83 + include/mm_sound_msg.h | 80 + include/mm_sound_private.h | 211 + include/mm_sound_utils.h | 58 + include/mm_source.h | 72 + init/Makefile.am | 2 + init/mmfwaudio | 10 + init/soundserver | 12 + libmm-sound.manifest | 14 + missing | 367 + mm_sound.c | 1560 ++ mm_sound_client.c | 1436 ++ mm_sound_keysound.c | 100 + packaging/libmm-sound.changes | 2 + packaging/libmm-sound.spec | 141 + packaging/sound-server.service | 12 + pkgconfig/Makefile.am | 16 + pkgconfig/mm-keysound.pc.in | 11 + pkgconfig/mm-sound.pc.in | 11 + server/Makefile.am | 58 + server/include/mm_sound_mgr_asm.h | 35 + server/include/mm_sound_mgr_codec.h | 66 + server/include/mm_sound_mgr_common.h | 33 + server/include/mm_sound_mgr_device.h | 49 + server/include/mm_sound_mgr_dock.h | 32 + server/include/mm_sound_mgr_hdmi.h | 30 + server/include/mm_sound_mgr_headset.h | 33 + server/include/mm_sound_mgr_ipc.h | 42 + server/include/mm_sound_mgr_pulse.h | 40 + server/include/mm_sound_mgr_run.h | 30 + server/include/mm_sound_mgr_session.h | 101 + server/include/mm_sound_mgr_wfd.h | 30 + server/include/mm_sound_plugin.h | 54 + server/include/mm_sound_plugin_codec.h | 78 + server/include/mm_sound_plugin_run.h | 50 + server/include/mm_sound_thread_pool.h | 30 + server/mm_sound_mgr_asm.c | 1982 +++ server/mm_sound_mgr_codec.c | 629 + server/mm_sound_mgr_device.c | 414 + server/mm_sound_mgr_dock.c | 246 + server/mm_sound_mgr_hdmi.c | 95 + server/mm_sound_mgr_headset.c | 239 + server/mm_sound_mgr_ipc.c | 905 ++ server/mm_sound_mgr_pulse.c | 522 + server/mm_sound_mgr_run.c | 121 + server/mm_sound_mgr_session.c | 1542 ++ server/mm_sound_mgr_wfd.c | 98 + server/mm_sound_plugin.c | 272 + server/mm_sound_server.c | 383 + server/mm_sound_thread_pool.c | 359 + server/plugin/Makefile.am | 1 + server/plugin/keytone/Makefile.am | 23 + .../plugin/keytone/mm_sound_plugin_run_key_tone.c | 580 + server/plugin/tone/Makefile.am | 21 + server/plugin/tone/mm_sound_plugin_codec_tone.c | 1162 ++ server/plugin/wav/Makefile.am | 21 + server/plugin/wav/mm_sound_plugin_codec_wave.c | 560 + server/sounds/dock.wav | Bin 0 -> 151246 bytes server/sounds/undock.wav | Bin 0 -> 152718 bytes testsuite/01_Touch.wav | Bin 0 -> 42412 bytes testsuite/Makefile.am | 24 + testsuite/mm_sound_testsuite_simple.c | 947 ++ 78 files changed, 35787 insertions(+) create mode 100644 AUTHORS create mode 100644 LICENSE.APLv2 create mode 100644 Makefile.am create mode 100644 NOTICE create mode 100644 audio_device.png create mode 100755 autogen.sh create mode 100644 common/Makefile.am create mode 100644 common/mm_ipc.c create mode 100644 common/mm_sound_utils.c create mode 100644 common/mm_source.c create mode 100755 configure create mode 100644 configure.ac create mode 100755 depcomp create mode 100644 include/mm_ipc.h create mode 100644 include/mm_sound.h create mode 100644 include/mm_sound_client.h create mode 100644 include/mm_sound_common.h create mode 100644 include/mm_sound_msg.h create mode 100644 include/mm_sound_private.h create mode 100644 include/mm_sound_utils.h create mode 100644 include/mm_source.h create mode 100644 init/Makefile.am create mode 100755 init/mmfwaudio create mode 100755 init/soundserver create mode 100644 libmm-sound.manifest create mode 100755 missing create mode 100644 mm_sound.c create mode 100644 mm_sound_client.c create mode 100644 mm_sound_keysound.c create mode 100644 packaging/libmm-sound.changes create mode 100644 packaging/libmm-sound.spec create mode 100644 packaging/sound-server.service create mode 100644 pkgconfig/Makefile.am create mode 100644 pkgconfig/mm-keysound.pc.in create mode 100644 pkgconfig/mm-sound.pc.in create mode 100644 server/Makefile.am create mode 100644 server/include/mm_sound_mgr_asm.h create mode 100644 server/include/mm_sound_mgr_codec.h create mode 100644 server/include/mm_sound_mgr_common.h create mode 100644 server/include/mm_sound_mgr_device.h create mode 100644 server/include/mm_sound_mgr_dock.h create mode 100644 server/include/mm_sound_mgr_hdmi.h create mode 100644 server/include/mm_sound_mgr_headset.h create mode 100644 server/include/mm_sound_mgr_ipc.h create mode 100644 server/include/mm_sound_mgr_pulse.h create mode 100644 server/include/mm_sound_mgr_run.h create mode 100644 server/include/mm_sound_mgr_session.h create mode 100644 server/include/mm_sound_mgr_wfd.h create mode 100644 server/include/mm_sound_plugin.h create mode 100644 server/include/mm_sound_plugin_codec.h create mode 100644 server/include/mm_sound_plugin_run.h create mode 100644 server/include/mm_sound_thread_pool.h create mode 100644 server/mm_sound_mgr_asm.c create mode 100644 server/mm_sound_mgr_codec.c create mode 100644 server/mm_sound_mgr_device.c create mode 100644 server/mm_sound_mgr_dock.c create mode 100644 server/mm_sound_mgr_hdmi.c create mode 100644 server/mm_sound_mgr_headset.c create mode 100644 server/mm_sound_mgr_ipc.c create mode 100644 server/mm_sound_mgr_pulse.c create mode 100644 server/mm_sound_mgr_run.c create mode 100644 server/mm_sound_mgr_session.c create mode 100644 server/mm_sound_mgr_wfd.c create mode 100644 server/mm_sound_plugin.c create mode 100644 server/mm_sound_server.c create mode 100644 server/mm_sound_thread_pool.c create mode 100644 server/plugin/Makefile.am create mode 100644 server/plugin/keytone/Makefile.am create mode 100644 server/plugin/keytone/mm_sound_plugin_run_key_tone.c create mode 100644 server/plugin/tone/Makefile.am create mode 100644 server/plugin/tone/mm_sound_plugin_codec_tone.c create mode 100644 server/plugin/wav/Makefile.am create mode 100644 server/plugin/wav/mm_sound_plugin_codec_wave.c create mode 100755 server/sounds/dock.wav create mode 100755 server/sounds/undock.wav create mode 100755 testsuite/01_Touch.wav create mode 100644 testsuite/Makefile.am create mode 100644 testsuite/mm_sound_testsuite_simple.c diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..ca8e051 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,3 @@ +Seungbae Shin +Hyunseok Lee +Sangchul Lee diff --git a/LICENSE.APLv2 b/LICENSE.APLv2 new file mode 100644 index 0000000..a06208b --- /dev/null +++ b/LICENSE.APLv2 @@ -0,0 +1,204 @@ +Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..efa0c75 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,69 @@ +SUBDIRS = common \ + pkgconfig \ + . \ + server \ + testsuite + +SUBDIRS += init + +lib_LTLIBRARIES = libmmfsound.la + +includelibmmfsounddir = $(includedir)/mmf +includelibmmfsound_HEADERS = include/mm_sound.h \ + include/mm_sound_private.h + +libmmfsound_la_SOURCES = mm_sound.c \ + mm_sound_client.c + +libmmfsound_la_DEPENDENCIES = common/libmmfsoundcommon.la + + +libmmfsound_la_CFLAGS = -I$(srcdir)/include \ + $(MMCOMMON_CFLAGS) \ + $(VCONF_CFLAGS) \ + -I$(srcdir)/servertype/include \ + $(AVSYSTEM_CFLAGS) \ + $(GLIB2_CFLAGS) \ + $(MMSESSION_CFLAGS) \ + $(AUDIOSESSIONMGR_CFLAGS) \ + -D_USE_INTERNAL_SOUND_PATH_ \ + $(VCONF_CFLAGS) + +if USE_PULSE +libmmfsound_la_CFLAGS += -DPULSE_CLIENT +endif + + +libmmfsound_la_LIBADD = $(MMCOMMON_LIBS) \ + $(AVSYSTEM_LIBS) \ + $(MMSESSION_LIBS) \ + $(AUDIOSESSIONMGR_LIBS) \ + $(GLIB2_LIBS) \ + $(srcdir)/common/libmmfsoundcommon.la \ + $(VCONF_LIBS) + +libmmfsound_la_LDFLAGS = -version-info 1:0:1 + +#For logmanager +libmmfsound_la_CFLAGS += $(MMLOGSVR_CFLAGS) -DMMF_LOG_OWNER=0x020 -DMMF_DEBUG_PREFIX=\"MMF-SOUND\" +libmmfsound_la_LIBADD += $(MMLOGSVR_LIBS) + + + + + + + +lib_LTLIBRARIES += libmmfkeysound.la + +includelibmmfkeysounddir = $(includedir)/mmf + +libmmfkeysound_la_SOURCES = mm_sound_keysound.c + +libmmfkeysound_la_CFLAGS = -I$(srcdir)/include \ + $(MMCOMMON_CFLAGS) \ + -D_USE_INTERNAL_SOUND_PATH_ + +libmmfkeysound_la_LIBADD = $(MMCOMMON_LIBS) +libmmfkeysound_la_CFLAGS += $(MMLOGSVR_CFLAGS) -DMMF_LOG_OWNER=0x020 -DMMF_DEBUG_PREFIX=\"MMF-SOUND\" +libmmfkeysound_la_LIBADD += $(MMLOGSVR_LIBS) diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..ccdad52 --- /dev/null +++ b/NOTICE @@ -0,0 +1,3 @@ +Copyright (c) Samsung Electronics Co., Ltd. All rights reserved. +Except as noted, this software is licensed under Apache License, Version 2. +Please, see the LICENSE file for Apache License terms and conditions. diff --git a/audio_device.png b/audio_device.png new file mode 100644 index 0000000000000000000000000000000000000000..66c42d299b58e110bfdb19617c634967770ab377 GIT binary patch literal 27428 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file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#define FIX_PROCESS 1 + +#include +#include +#include + +#include + +#define AUDIO_ROUTE_POLICY_LOCK "audio_route_policy_lock" +#define LOCK_TIMEOUT_SEC 6 + +EXPORT_API +int __mm_sound_lock() +{ + sem_t *sem = NULL; + int ret; + int err = MM_ERROR_NONE; + struct timespec wait_time; + + sem = sem_open(AUDIO_ROUTE_POLICY_LOCK, O_CREAT, 0666, 1); + if (sem == SEM_FAILED) + { + debug_error("Semaphore open Fail! (name:%s, %s)\n", AUDIO_ROUTE_POLICY_LOCK, strerror(errno)); + return MM_ERROR_SOUND_INTERNAL; + } +retry_lock: + wait_time.tv_sec = (long int)(time(NULL)) + LOCK_TIMEOUT_SEC; + wait_time.tv_nsec = 0; + ret = sem_timedwait(sem, &wait_time); + if(ret == -1) + { + switch(errno) + { + case EINTR: + debug_error("Lock RETRY LOCK\n"); + goto retry_lock; + break; + case EINVAL: + debug_error("Invalid semaphore\n"); + err = MM_ERROR_SOUND_INTERNAL; + break; + case EAGAIN: + debug_error("EAGAIN\n"); + err = MM_ERROR_SOUND_INTERNAL; + break; + case ETIMEDOUT: + debug_error("sem_wait leached %d seconds timeout.\n", LOCK_TIMEOUT_SEC); + { + //Recovery of sem_wait lock....in abnormal condition + int sem_value = -1; + if(0 == sem_getvalue(sem, &sem_value)) + { + debug_error("%s sem value is %d\n",AUDIO_ROUTE_POLICY_LOCK, sem_value); + if(sem_value == 0) + { + ret = sem_post(sem); + if(ret == -1) + { + debug_error("sem_post error %s : %d\n", AUDIO_ROUTE_POLICY_LOCK, sem_value); + } + else + { + debug_error("lock recovery success...try lock again\n"); + goto retry_lock; + } + } + else + { + debug_error("sem value is not 0. but failed sem_timedwait so retry.. : %s\n",AUDIO_ROUTE_POLICY_LOCK); + usleep(5); + goto retry_lock; + } + } + else + { + debug_error("sem_getvalue failed : %s\n",AUDIO_ROUTE_POLICY_LOCK); + } + } + err = MM_ERROR_SOUND_INTERNAL; + break; + } + } + sem_close(sem); + return err; +} + +EXPORT_API +int __mm_sound_unlock() +{ + sem_t *sem = NULL; + int ret; + int err = MM_ERROR_NONE; + + sem = sem_open(AUDIO_ROUTE_POLICY_LOCK, O_CREAT, 0666, 1); + if (sem == SEM_FAILED) + { + debug_error("Semaphore open Fail! (name:%s, errno %d)\n", AUDIO_ROUTE_POLICY_LOCK, errno); + return MM_ERROR_SOUND_INTERNAL; + } + + ret = sem_post(sem); + if (ret == -1) + { + debug_error("UNLOCK FAIL\n"); + err = MM_ERROR_SOUND_INTERNAL; + } + + sem_close(sem); + return err; +} + diff --git a/common/mm_sound_utils.c b/common/mm_sound_utils.c new file mode 100644 index 0000000..5100556 --- /dev/null +++ b/common/mm_sound_utils.c @@ -0,0 +1,222 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include "../include/mm_sound_private.h" +#include "../include/mm_sound.h" +#include "../include/mm_sound_common.h" +#include "../include/mm_sound_utils.h" + +static mm_sound_route g_valid_route[] = { + MM_SOUND_ROUTE_OUT_SPEAKER, MM_SOUND_ROUTE_OUT_WIRED_ACCESSORY, MM_SOUND_ROUTE_OUT_BLUETOOTH, + MM_SOUND_ROUTE_OUT_DOCK, MM_SOUND_ROUTE_OUT_HDMI, MM_SOUND_ROUTE_OUT_WFD, MM_SOUND_ROUTE_OUT_USB_AUDIO, + MM_SOUND_ROUTE_IN_MIC, MM_SOUND_ROUTE_IN_WIRED_ACCESSORY, MM_SOUND_ROUTE_IN_MIC_OUT_RECEIVER, + MM_SOUND_ROUTE_IN_MIC_OUT_SPEAKER, MM_SOUND_ROUTE_IN_MIC_OUT_HEADPHONE, + MM_SOUND_ROUTE_INOUT_HEADSET, MM_SOUND_ROUTE_INOUT_BLUETOOTH +}; + +#define MM_SOUND_DEFAULT_VOLUME_SYSTEM 5 +#define MM_SOUND_DEFAULT_VOLUME_NOTIFICATION 7 +#define MM_SOUND_DEFAULT_VOLUME_ALARAM 6 +#define MM_SOUND_DEFAULT_VOLUME_RINGTONE 13 +#define MM_SOUND_DEFAULT_VOLUME_MEDIA 7 +#define MM_SOUND_DEFAULT_VOLUME_CALL 7 +#define MM_SOUND_DEFAULT_VOLUME_VOIP 7 +#define MM_SOUND_DEFAULT_VOLUME_ANDROID 0 +#define MM_SOUND_DEFAULT_VOLUME_JAVA 11 +static int g_default_volume[VOLUME_TYPE_MAX] = { + MM_SOUND_DEFAULT_VOLUME_SYSTEM, + MM_SOUND_DEFAULT_VOLUME_NOTIFICATION, + MM_SOUND_DEFAULT_VOLUME_ALARAM, + MM_SOUND_DEFAULT_VOLUME_RINGTONE, + MM_SOUND_DEFAULT_VOLUME_MEDIA, + MM_SOUND_DEFAULT_VOLUME_CALL, + MM_SOUND_DEFAULT_VOLUME_VOIP, + MM_SOUND_DEFAULT_VOLUME_ANDROID, + MM_SOUND_DEFAULT_VOLUME_JAVA, +}; +static char *g_volume_vconf[VOLUME_TYPE_MAX] = { + VCONF_KEY_VOLUME_TYPE_SYSTEM, /* VOLUME_TYPE_SYSTEM */ + VCONF_KEY_VOLUME_TYPE_NOTIFICATION, /* VOLUME_TYPE_NOTIFICATION */ + VCONF_KEY_VOLUME_TYPE_ALARM, /* VOLUME_TYPE_ALARM */ + VCONF_KEY_VOLUME_TYPE_RINGTONE, /* VOLUME_TYPE_RINGTONE */ + VCONF_KEY_VOLUME_TYPE_MEDIA, /* VOLUME_TYPE_MEDIA */ + VCONF_KEY_VOLUME_TYPE_CALL, /* VOLUME_TYPE_CALL */ + VCONF_KEY_VOLUME_TYPE_VOIP, /* VOLUME_TYPE_VOIP */ + VCONF_KEY_VOLUME_TYPE_ANDROID, /* VOLUME_TYPE_FIXED */ + VCONF_KEY_VOLUME_TYPE_JAVA /* VOLUME_TYPE_EXT_JAVA */ +}; +static char *g_volume_str[VOLUME_TYPE_MAX] = { + "SYSTEM", + "NOTIFICATION", + "ALARM", + "RINGTONE", + "MEDIA", + "CALL", + "VOIP", + "FIXED", + "JAVA", +}; + +EXPORT_API +int _mm_sound_get_valid_route_list(mm_sound_route **route_list) +{ + *route_list = g_valid_route; + + return (int)(sizeof(g_valid_route) / sizeof(mm_sound_route)); +} + +EXPORT_API +bool _mm_sound_is_route_valid(mm_sound_route route) +{ + mm_sound_route *route_list = 0; + int route_index = 0; + int route_list_count = 0; + + route_list_count = _mm_sound_get_valid_route_list(&route_list); + for (route_index = 0; route_index < route_list_count; route_index++) { + if (route_list[route_index] == route) + return 1; + } + + return 0; +} + +EXPORT_API +void _mm_sound_get_devices_from_route(mm_sound_route route, mm_sound_device_in *device_in, mm_sound_device_out *device_out) +{ + if (device_in && device_out) { + *device_in = route & 0x00FF; + *device_out = route & 0xFFF00; + } +} + +EXPORT_API +bool _mm_sound_check_hibernation (const char *path) +{ + int fd = -1; + if (path == NULL) { + debug_error ("Path is null\n"); + return false; + } + + fd = open (path, O_RDONLY | O_CREAT, 0644); + if (fd != -1) { + debug_log ("Open [%s] success!!\n", path); + } else { + debug_error ("Can't create [%s] with errno [%d]\n", path, errno); + return false; + } + + close (fd); + return true; +} + +EXPORT_API +int _mm_sound_volume_add_callback(volume_type_t type, void *func, void* user_data) +{ + if (vconf_notify_key_changed(g_volume_vconf[type], func, user_data)) { + debug_error ("vconf_notify_key_changed failed..\n"); + return MM_ERROR_SOUND_INTERNAL; + } + + return MM_ERROR_NONE; +} + +EXPORT_API +int _mm_sound_volume_remove_callback(volume_type_t type, void *func) +{ + if (vconf_ignore_key_changed(g_volume_vconf[type], func)) { + debug_error ("vconf_ignore_key_changed failed..\n"); + return MM_ERROR_SOUND_INTERNAL; + } + + return MM_ERROR_NONE; +} + +EXPORT_API +int _mm_sound_volume_get_value_by_type(volume_type_t type, unsigned int *value) +{ + int vconf_value = 0; + + /* Get volume value from VCONF */ + if (vconf_get_int(g_volume_vconf[type], &vconf_value)) { + debug_error ("vconf_get_int(%s) failed..\n", g_volume_vconf[type]); + return MM_ERROR_SOUND_INTERNAL; + } + + *value = vconf_value; + debug_log("volume_get_value %s %d", g_volume_str[type], *value); + + return MM_ERROR_NONE; +} + +EXPORT_API +int _mm_sound_volume_set_value_by_type(volume_type_t type, unsigned int value) +{ + int vconf_value = 0; + + vconf_value = value; + debug_log("volume_set_value %s %d", g_volume_str[type], value); + + /* Set volume value to VCONF */ + if (vconf_set_int(g_volume_vconf[type], vconf_value)) { + debug_error ("vconf_set_int(%s) failed..\n", g_volume_vconf[type]); + return MM_ERROR_SOUND_INTERNAL; + } + + return MM_ERROR_NONE; +} + +EXPORT_API +int _mm_sound_volume_get_values_on_bootup(int *values) +{ + int i, vconf_value = 0; + + for (i = 0; i < VOLUME_TYPE_MAX; i++) { + if (!vconf_get_int(g_volume_vconf[i], &vconf_value)) { + values[i] = vconf_value; + debug_log("volume_get_value %s %d", g_volume_str[i], values[i]); + } else { + debug_error ("vconf_get_int(%s) failed..\n", g_volume_vconf[i]); + values[i] = g_default_volume[i]; + vconf_value = values[i]; + if (vconf_set_int(g_volume_vconf[i], vconf_value)) { + debug_error ("vconf_set_int(%s) failed..\n", g_volume_vconf[i]); + } + } + } + + return MM_ERROR_NONE; +} + diff --git a/common/mm_source.c b/common/mm_source.c new file mode 100644 index 0000000..c4766e9 --- /dev/null +++ b/common/mm_source.c @@ -0,0 +1,299 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mm_types.h" +#include "mm_debug.h" +#include "mm_error.h" +#include "mm_source.h" + + +bool _is_drm_file( + const char *filePath +) +{ + if(!filePath || filePath[0] == '\0') + { + debug_error("invalid argument\n"); + return false; + } + char *p = NULL; + p = (char*) strrchr(filePath, '.'); + + if( p && ((strncasecmp(p, ".odf", 4) == 0) || (strncasecmp(p, ".dcf", 4) == 0) || (strncasecmp(p, ".o4a", 4) == 0) || (strncasecmp(p, ".o4v", 4) == 0))) + { + return true; + } + return false; +} + +EXPORT_API +int mm_source_open_file(const char *filename, MMSourceType *source, int drmsupport) +{ + struct stat finfo = {0, }; + int fd = -1; + void *mmap_buf = NULL; + + if(filename == NULL) + { + debug_error("filename is null\n"); + return MM_ERROR_SOUND_INVALID_FILE; + } + if(drmsupport) + { + if(_is_drm_file(filename)) + { + debug_error("%s is DRM contents\n", filename); + return MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE; + } + } + + fd = open(filename, O_RDONLY); + debug_fenter(); + debug_msg("Open file name is %s\n", filename); + unsigned int mediaSize,readSize,offSet=0; + char genStr[20],i; + + if (fd == -1) + { + debug_error("file open fail\n\n"); + return MM_ERROR_SOUND_INTERNAL; + } + if (fstat(fd, &finfo) == -1) + { + debug_error("file get info fail\n"); + close(fd); + return MM_ERROR_SOUND_INTERNAL; + } + + mediaSize = (unsigned int)finfo.st_size; + + { + /* get the extension (3 characters from last including NULL)*/ + strncpy((void *)genStr,(void *)(filename+(strlen(filename)-2)),3); + + debug_msg("ExtName of the Sound file %s\n",genStr); + + + if(strcasecmp (genStr, "dm") == 0) + { + debug_msg("It is DM file going ahead with special decoding\n"); + + /* Vlidation of the DM file */ + readSize = read(fd,(void*)genStr,0x8); + if(readSize != 0x8) + { + debug_error("Error in Reading the file Header %x/0x8\n",readSize); + return MM_ERROR_SOUND_INTERNAL; + } + + genStr[readSize] ='\0'; + + debug_msg("Header details of DM file %s\n",genStr); + + if(strcasecmp (genStr, "--random") != 0) + { + debug_error("It is not a valied DM file"); + return MM_ERROR_SOUND_INTERNAL; + } + + /*checking the Media Type */ + readSize = lseek(fd, 0x32, SEEK_SET); + if(readSize != 0x32) + { + debug_error("Error in Seeking the file to offset %x/0x32\n",readSize); + return MM_ERROR_SOUND_INTERNAL; + } + + readSize = read(fd,(void*)genStr,0xf); + + for(i=0;i<0xf;i++) + { + if(genStr[i] == (char)0xD) + { + genStr[i] ='\0'; + break; + } + } + + debug_msg("Header details of DM file %s\n",genStr); + + /*Finding the Media Offset */ + + if(strcasecmp (genStr, "audio/mpeg") == 0) + { + offSet = 0x63; + } + else if(strcasecmp (genStr, "audio/wav") == 0) + { + offSet = 0x62; + } + else + { + debug_error("It is not MP3/Wav DM file \n"); + return MM_ERROR_SOUND_INTERNAL; + } + + /*Finding the Media Size */ + + mediaSize -= (offSet + 0x28); + + /*Seeking the file to start */ + readSize = lseek(fd, 0x0, SEEK_SET); + + if( readSize != 0x0) + { + debug_error("Error in Seeking the file to offset %x/0x32\n",readSize); + return MM_ERROR_SOUND_INTERNAL; + } + + } + else + { + debug_msg("It is NON DM file going ahead with normal decoding\n"); + } + } + + mmap_buf = mmap(0, finfo.st_size, PROT_READ, MAP_SHARED, fd,0); + + if (mmap_buf == NULL) + { + debug_error("MMAP fail\n"); + close(fd); + return MM_ERROR_SOUND_INTERNAL; + } + source->ptr = mmap_buf+offSet; + source->medOffset = offSet; + debug_msg("source ptr = %p\n", source->ptr); + debug_msg("Med Offset Size : %d",source->medOffset); + source->tot_size = finfo.st_size; + source->cur_size = mediaSize; + source->type = MM_SOURCE_FILE; + source->fd = fd; + + return MM_ERROR_NONE; +} + +EXPORT_API +int mm_source_open_full_memory(const void *ptr, int totsize, int alloc, MMSourceType *source) +{ + int err = MM_ERROR_NONE; + if (ptr == NULL) + { + debug_error("PTR is NULL\n"); + return MM_ERROR_INVALID_ARGUMENT; + } + if (alloc) + { + err = mm_source_open_memory(ptr, totsize, totsize, source); + } + else + { + source->ptr = ptr; + source->tot_size = totsize; + source->cur_size = totsize; + + source->type = MM_SOURCE_MEMORY_NOTALLOC; + source->fd = -1; + } + return err; +} + +EXPORT_API +int mm_source_open_memory(const void *ptr, int totsize, int size, MMSourceType *source) +{ + source->ptr = (unsigned char*) malloc(totsize); + if (source->ptr == NULL) + { + debug_error("memory alloc fail\n"); + return MM_ERROR_SOUND_NO_FREE_SPACE; + } + source->tot_size = totsize; + source->cur_size = 0; + source->type = MM_SOURCE_MEMORY; + source->fd = -1; + + return mm_source_append_memory(ptr, size, source); +} + +EXPORT_API +int mm_source_append_memory(const void *ptr, int size, MMSourceType *source) +{ + if (source->cur_size + size > source->tot_size) + { + debug_error("memory too large\n"); + return MM_ERROR_SOUND_NO_FREE_SPACE; + } + + memcpy(source->ptr + source->cur_size, ptr, size); + source->cur_size += size; + return MM_ERROR_NONE; +} + +EXPORT_API +int mm_source_close(MMSourceType *source) +{ + debug_fenter(); + + ////PREVENT + if(source == NULL) + { + debug_critical("source is null %s\n", __func__); + return MM_ERROR_CLASS; + } + ///// + debug_msg("Source type = %d\n", source->type); + switch(source->type) + { + case MM_SOURCE_FILE: + if(source->ptr != NULL) + { + source->ptr -= source->medOffset; + debug_msg("Med Offset Size : %d/%d",source->medOffset,source->tot_size); + if (munmap(source->ptr, source->tot_size) == -1) { + debug_error("MEM UNMAP fail\n\n"); + } + } + close(source->fd); + break; + case MM_SOURCE_MEMORY: + if(source->ptr != NULL) + free(source->ptr); + break; + case MM_SOURCE_MEMORY_NOTALLOC: + break; + default: + debug_critical("Unknown Source\n"); + break; + } + memset(source, 0, sizeof(MMSourceType)); + return MM_ERROR_NONE; +} + diff --git a/configure b/configure new file mode 100755 index 0000000..1fdc3f7 --- /dev/null +++ b/configure @@ -0,0 +1,15649 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.67 for avsystem 1.0. +# +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +ECHO=${lt_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 <<_LT_EOF +$* +_LT_EOF + exit 0 +fi + +# 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 + +if test -z "$lt_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 && + { 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. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='avsystem' +PACKAGE_TARNAME='avsystem' +PACKAGE_VERSION='1.0' +PACKAGE_STRING='avsystem 1.0' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +ac_header_list= +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +ALLOCA +USE_PULSE_FALSE +USE_PULSE_TRUE +PULSE_LIBS +PULSE_CFLAGS +HEYNOTI_LIBS +HEYNOTI_CFLAGS +VCONF_LIBS +VCONF_CFLAGS +GLIB2_LIBS +GLIB2_CFLAGS +AUDIOSESSIONMGR_LIBS +AUDIOSESSIONMGR_CFLAGS +MMSESSION_LIBS +MMSESSION_CFLAGS +MMLOG_LIBS +MMLOG_CFLAGS +MMCOMMON_LIBS +MMCOMMON_CFLAGS +AVSYSTEM_LIBS +AVSYSTEM_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG +IS_SDK_FALSE +IS_SDK_TRUE +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +lt_ECHO +RANLIB +AR +OBJDUMP +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +SED +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL +LIBOBJS +EGREP +GREP +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +enable_libtool_lock +enable_sdk +enable_pulse +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +AVSYSTEM_CFLAGS +AVSYSTEM_LIBS +MMCOMMON_CFLAGS +MMCOMMON_LIBS +MMLOG_CFLAGS +MMLOG_LIBS +MMSESSION_CFLAGS +MMSESSION_LIBS +AUDIOSESSIONMGR_CFLAGS +AUDIOSESSIONMGR_LIBS +GLIB2_CFLAGS +GLIB2_LIBS +VCONF_CFLAGS +VCONF_LIBS +HEYNOTI_CFLAGS +HEYNOTI_LIBS +PULSE_CFLAGS +PULSE_LIBS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# 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. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +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 + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -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) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$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 ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$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 ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + 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 ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=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 ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_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'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +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 + $as_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 + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# 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 the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + 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 + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# 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 avsystem 1.0 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 \`..'] + +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] + --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] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/avsystem] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_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 + case $ac_init_help in + short | recursive ) echo "Configuration of avsystem 1.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --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) + --enable-sdk sdk build + --enable-pulse enable pulseaudio client + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + +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 + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + AVSYSTEM_CFLAGS + C compiler flags for AVSYSTEM, overriding pkg-config + AVSYSTEM_LIBS + linker flags for AVSYSTEM, overriding pkg-config + MMCOMMON_CFLAGS + C compiler flags for MMCOMMON, overriding pkg-config + MMCOMMON_LIBS + linker flags for MMCOMMON, overriding pkg-config + MMLOG_CFLAGS + C compiler flags for MMLOG, overriding pkg-config + MMLOG_LIBS linker flags for MMLOG, overriding pkg-config + MMSESSION_CFLAGS + C compiler flags for MMSESSION, overriding pkg-config + MMSESSION_LIBS + linker flags for MMSESSION, overriding pkg-config + AUDIOSESSIONMGR_CFLAGS + C compiler flags for AUDIOSESSIONMGR, overriding pkg-config + AUDIOSESSIONMGR_LIBS + linker flags for AUDIOSESSIONMGR, overriding pkg-config + GLIB2_CFLAGS + C compiler flags for GLIB2, overriding pkg-config + GLIB2_LIBS linker flags for GLIB2, overriding pkg-config + VCONF_CFLAGS + C compiler flags for VCONF, overriding pkg-config + VCONF_LIBS linker flags for VCONF, overriding pkg-config + HEYNOTI_CFLAGS + C compiler flags for HEYNOTI, overriding pkg-config + HEYNOTI_LIBS + linker flags for HEYNOTI, overriding pkg-config + PULSE_CFLAGS + C compiler flags for PULSE, overriding pkg-config + PULSE_LIBS linker flags for PULSE, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested 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 + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +avsystem configure 1.0 +generated by GNU Autoconf 2.67 + +Copyright (C) 2010 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 +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* 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_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_func + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval "test \"\${$3+set}\"" = set; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_type +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by avsystem $as_me 1.0, which was +generated by GNU Autoconf 2.67. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +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` +/usr/bin/hostinfo = `(/usr/bin/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=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append 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 + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > 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 + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5 ; } + 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. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +as_fn_append ac_header_list " stdlib.h" +as_fn_append ac_header_list " unistd.h" +as_fn_append ac_header_list " sys/param.h" +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; 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,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_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 + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_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. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +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 + + +am__api_version='1.11' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# 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. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$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' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; +esac + +# 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". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "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 $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +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='avsystem' + VERSION='1.0' + + +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"} + +# 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 -' + + + + + +ac_config_headers="$ac_config_headers config.h:config.hin" + + + + +# Checks for programs. +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5 ; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5 ; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5 ; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5 ; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5 ; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 -std 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 -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 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 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +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 +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-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 + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&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 + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + 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 + + # 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. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$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 + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* 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"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 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; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&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 : + $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5 ; } +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 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#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)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + for ac_header in $ac_header_list +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + +for ac_func in getpagesize +do : + ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETPAGESIZE 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 +$as_echo_n "checking for working mmap... " >&6; } +if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_mmap_fixed_mapped=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 !defined STDC_HEADERS && !defined HAVE_STDLIB_H +char *malloc (); +#endif + +/* This mess was copied from the GNU getpagesize.h. */ +#ifndef HAVE_GETPAGESIZE +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# ifdef 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; + const char *cdata2; + int i, pagesize; + int fd, fd2; + + pagesize = getpagesize (); + + /* First, make a file with some known garbage in it. */ + data = (char *) malloc (pagesize); + if (!data) + return 1; + for (i = 0; i < pagesize; ++i) + *(data + i) = rand (); + umask (0); + fd = creat ("conftest.mmap", 0600); + if (fd < 0) + return 2; + if (write (fd, data, pagesize) != pagesize) + return 3; + close (fd); + + /* Next, check that the tail of a page is zero-filled. File must have + non-zero length, otherwise we risk SIGBUS for entire page. */ + fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); + if (fd2 < 0) + return 4; + cdata2 = ""; + if (write (fd2, cdata2, 1) != 1) + return 5; + data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); + if (data2 == MAP_FAILED) + return 6; + for (i = 0; i < pagesize; ++i) + if (*(data2 + i)) + return 7; + close (fd2); + if (munmap (data2, pagesize)) + return 8; + + /* 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) + return 9; + if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + return 10; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + return 11; + + /* 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) + return 12; + if (read (fd, data3, pagesize) != pagesize) + return 13; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + return 14; + close (fd); + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_mmap_fixed_mapped=yes +else + ac_cv_func_mmap_fixed_mapped=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 +$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } +if test $ac_cv_func_mmap_fixed_mapped = yes; then + +$as_echo "#define HAVE_MMAP 1" >>confdefs.h + +fi +rm -f conftest.mmap conftest.txt + +for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 +$as_echo_n "checking for GNU libc compatible realloc... " >&6; } +if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_realloc_0_nonnull=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *realloc (); +#endif + +int +main () +{ +return ! realloc (0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_realloc_0_nonnull=yes +else + ac_cv_func_realloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } +if test $ac_cv_func_realloc_0_nonnull = yes; then : + +$as_echo "#define HAVE_REALLOC 1" >>confdefs.h + +else + $as_echo "#define HAVE_REALLOC 0" >>confdefs.h + + case " $LIBOBJS " in + *" realloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS realloc.$ac_objext" + ;; +esac + + +$as_echo "#define realloc rpl_realloc" >>confdefs.h + +fi + + +for ac_header in sys/select.h sys/socket.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5 +$as_echo_n "checking types of arguments for select... " >&6; } +if test "${ac_cv_func_select_args+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + for ac_arg234 in 'fd_set *' 'int *' 'void *'; do + for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do + for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +#ifdef HAVE_SYS_SELECT_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif + +int +main () +{ +extern int select ($ac_arg1, + $ac_arg234, $ac_arg234, $ac_arg234, + $ac_arg5); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done + done +done +# Provide a safe default value. +: ${ac_cv_func_select_args='int,int *,struct timeval *'} + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5 +$as_echo "$ac_cv_func_select_args" >&6; } +ac_save_IFS=$IFS; IFS=',' +set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` +IFS=$ac_save_IFS +shift + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG1 $1 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG234 ($2) +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG5 ($3) +_ACEOF + +rm -f conftest* + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 +$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } +if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + rm -f conftest.sym conftest.file +echo >conftest.file +if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then + if test "$cross_compiling" = yes; then : + ac_cv_func_lstat_dereferences_slashed_symlink=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + /* Linux will dereference the symlink and fail, as required by POSIX. + That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_lstat_dereferences_slashed_symlink=yes +else + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +else + # If the `ln -s' command failed, then we probably don't even + # have an lstat function. + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f conftest.sym conftest.file + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } + +test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && + +cat >>confdefs.h <<_ACEOF +#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 +_ACEOF + + +if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then + case " $LIBOBJS " in + *" lstat.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS lstat.$ac_objext" + ;; +esac + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 +$as_echo_n "checking whether stat accepts an empty string... " >&6; } +if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_stat_empty_string_bug=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + return stat ("", &sbuf) == 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_stat_empty_string_bug=no +else + ac_cv_func_stat_empty_string_bug=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5 +$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; } +if test $ac_cv_func_stat_empty_string_bug = yes; then + case " $LIBOBJS " in + *" stat.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS stat.$ac_objext" + ;; +esac + + +cat >>confdefs.h <<_ACEOF +#define HAVE_STAT_EMPTY_STRING_BUG 1 +_ACEOF + +fi + +for ac_func in vprintf +do : + ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" +if test "x$ac_cv_func_vprintf" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VPRINTF 1 +_ACEOF + +ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" +if test "x$ac_cv_func__doprnt" = x""yes; then : + +$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h + +fi + +fi +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } +if test "${ac_cv_header_stdbool_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifndef bool + "error: bool is not defined" +#endif +#ifndef false + "error: false is not defined" +#endif +#if false + "error: false is not 0" +#endif +#ifndef true + "error: true is not defined" +#endif +#if true != 1 + "error: true is not 1" +#endif +#ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" +#endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + bool e = &s; + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; +# if defined __xlc__ || defined __GNUC__ + /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 + reported by James Lemley on 2005-10-05; see + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html + This test is not quite right, since xlc is allowed to + reject this program, as the initializer for xlcbug is + not one of the forms that C requires support for. + However, doing the test right would require a runtime + test, and that would make cross-compilation harder. + Let us hope that IBM fixes the xlc bug, and also adds + support for this kind of constant expression. In the + meantime, this test will reject xlc, which is OK, since + our stdbool.h substitute should suffice. We also test + this with GCC, where it should work, to detect more + quickly whether someone messes up the test in the + future. */ + char digs[] = "0123456789"; + int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); +# endif + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + +int +main () +{ + + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdbool_h=yes +else + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +$as_echo "$ac_cv_header_stdbool_h" >&6; } +ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = x""yes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 +_ACEOF + + +fi + +if test $ac_cv_header_stdbool_h = yes; then + +$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#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)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if test "${ac_cv_header_time+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_time=yes +else + ac_cv_header_time=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h + +fi + +if test $ac_cv_c_compiler_gnu = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 +$as_echo_n "checking whether $CC needs -traditional... " >&6; } +if test "${ac_cv_prog_gcc_traditional+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_pattern="Autoconf.*'x'" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 +$as_echo "$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.2.6b' +macro_revision='1.3017' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + 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_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-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. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then : + $as_echo_n "(cached) " >&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 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test "${lt_cv_path_NM+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_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" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$ac_tool_prefix"; then + for ac_prog in "dumpbin -symbols" "link -dump -symbols" + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in "dumpbin -symbols" "link -dump -symbols" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if test "${lt_cv_nm_interface+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:5730: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:5733: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:5736: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then : + $as_echo_n "(cached) " >&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* | cegcc*) + # 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` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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 + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + 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` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # 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. + while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + 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` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$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='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then : + $as_echo_n "(cached) " >&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 +aix[4-9]*) + 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', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | 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 + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +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* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-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=pass_all + ;; + +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 + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + 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 + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$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 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru + + + + + + + + + + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : + $as_echo_n "(cached) " >&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]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +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 + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \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\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# 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 + +# Try without a prefix underscore, 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. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$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=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && 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 <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_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\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && 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 -rf 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + + + + + + + + + + + + + + + + + + + + + + +# Check whether --enable-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\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 6941 "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + 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-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + 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" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then : + $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$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 + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if test "${lt_cv_apple_cc_single_mod+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-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 + + + + + + + + + + # Check whether --enable-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 --with-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 + + + + + + + + # Check whether --enable-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 + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if test "${lt_cv_objdir+set}" = set; then : + $as_echo_n "(cached) " >&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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + + + + + + + + + + + + + + +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. +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 delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +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 +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 + +_LT_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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF 1>&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 + +_LT_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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +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;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$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:8199: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:8203: \$? = $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 -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$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= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&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*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # 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' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # 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). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + 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' + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + 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 + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + 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 + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # 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' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + 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' + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + 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*) + 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 + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + 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 + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } + + + + + + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$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:8538: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:8542: \$? = $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 -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_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 + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test "${lt_cv_prog_compiler_static_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$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 -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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:8643: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:8647: \$? = $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 -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || 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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$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:8698: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:8702: \$? = $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 -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || 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 .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_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 + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # 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_|_GLOBAL__F[ID]_.*' + # 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. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # 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 + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu) + link_all_deplibs=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>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [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 + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&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. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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 + ;; + esac + ;; + + 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* | cegcc*) + # _LT_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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + 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' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; 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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; 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~ + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd* | netbsdelf*-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*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&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. + +_LT_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 + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + 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 + ;; + + 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 "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + 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].*|aix[5-9]*) + 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_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + 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 + : + 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 + link_all_deplibs=no + 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 + + export_dynamic_flag_spec='${wl}-bexpall' + # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# 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 "$lt_aix_libpath_sed"` +fi +fi +rm -f core 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 '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${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 '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# 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 "$lt_aix_libpath_sed"` +fi +fi +rm -f core 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' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + 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 ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + 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 + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # 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 "X$deplibs" | $Xsed -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*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "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 $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + 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* | 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*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=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 + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -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*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=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 "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo(void) {} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd* | netbsdelf*-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 + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + 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 + else + ld_shlibs=no + 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 "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + 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 "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -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; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -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 + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-z ${wl}text ${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}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + 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' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $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 -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + 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 and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + 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*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + 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 + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# 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. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + 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\":${as_lineno-$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=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + 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* + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 +$as_echo "$archive_cmds_need_lc" >&6; } + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_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. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +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" +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' + ;; + +aix[4-9]*) + 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*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + 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' + ;; + esac + ;; + +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* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + 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~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + 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* | cegcc*) + # 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}${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`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + 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 + ;; + +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 + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + 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' + ;; + +interix[3-9]*) + 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' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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* | k*bsd*-gnu | kopensolaris*-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' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # 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>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;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' + ;; + +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=qnx + 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='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + 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" + ;; + +rdos*) + dynamic_linker=no + ;; + +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.3*) + 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 + 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 + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/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}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = 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 + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent 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_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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; 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 + + + + + + + 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* | cegcc*) + 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""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 + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +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" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF +#line 11082 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +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); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && 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_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then : + $as_echo_n "(cached) " >&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 <<_LT_EOF +#line 11178 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#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 + +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); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && 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_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$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 + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&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" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "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" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&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 + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +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" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + +# Check whether --enable-sdk was given. +if test "${enable_sdk+set}" = set; then : + enableval=$enable_sdk; + case "${enableval}" in + yes) IS_SDK=yes ;; + no) IS_SDK=no ;; + *) as_fn_error $? "bad value ${enableval} for --enable-sdk" "$LINENO" 5 ;; + esac + +else + IS_SDK=no +fi + + if test "x$IS_SDK" = "xyes"; then + IS_SDK_TRUE= + IS_SDK_FALSE='#' +else + IS_SDK_TRUE='#' + IS_SDK_FALSE= +fi + + +# Checks for libraries. + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVSYSTEM" >&5 +$as_echo_n "checking for AVSYSTEM... " >&6; } + +if test -n "$AVSYSTEM_CFLAGS"; then + pkg_cv_AVSYSTEM_CFLAGS="$AVSYSTEM_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"avsysaudio\""; } >&5 + ($PKG_CONFIG --exists --print-errors "avsysaudio") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_AVSYSTEM_CFLAGS=`$PKG_CONFIG --cflags "avsysaudio" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$AVSYSTEM_LIBS"; then + pkg_cv_AVSYSTEM_LIBS="$AVSYSTEM_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"avsysaudio\""; } >&5 + ($PKG_CONFIG --exists --print-errors "avsysaudio") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_AVSYSTEM_LIBS=`$PKG_CONFIG --libs "avsysaudio" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + AVSYSTEM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "avsysaudio" 2>&1` + else + AVSYSTEM_PKG_ERRORS=`$PKG_CONFIG --print-errors "avsysaudio" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$AVSYSTEM_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (avsysaudio) were not met: + +$AVSYSTEM_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables AVSYSTEM_CFLAGS +and AVSYSTEM_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables AVSYSTEM_CFLAGS +and AVSYSTEM_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5 ; } +else + AVSYSTEM_CFLAGS=$pkg_cv_AVSYSTEM_CFLAGS + AVSYSTEM_LIBS=$pkg_cv_AVSYSTEM_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MMCOMMON" >&5 +$as_echo_n "checking for MMCOMMON... " >&6; } + +if test -n "$MMCOMMON_CFLAGS"; then + pkg_cv_MMCOMMON_CFLAGS="$MMCOMMON_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mm-common\""; } >&5 + ($PKG_CONFIG --exists --print-errors "mm-common") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_MMCOMMON_CFLAGS=`$PKG_CONFIG --cflags "mm-common" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$MMCOMMON_LIBS"; then + pkg_cv_MMCOMMON_LIBS="$MMCOMMON_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mm-common\""; } >&5 + ($PKG_CONFIG --exists --print-errors "mm-common") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_MMCOMMON_LIBS=`$PKG_CONFIG --libs "mm-common" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + MMCOMMON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "mm-common" 2>&1` + else + MMCOMMON_PKG_ERRORS=`$PKG_CONFIG --print-errors "mm-common" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$MMCOMMON_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (mm-common) were not met: + +$MMCOMMON_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables MMCOMMON_CFLAGS +and MMCOMMON_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables MMCOMMON_CFLAGS +and MMCOMMON_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5 ; } +else + MMCOMMON_CFLAGS=$pkg_cv_MMCOMMON_CFLAGS + MMCOMMON_LIBS=$pkg_cv_MMCOMMON_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + + + +if test "x$IS_SDK" = "xyes"; +then +echo "SDK build does not use mm-log" +else + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MMLOG" >&5 +$as_echo_n "checking for MMLOG... " >&6; } + +if test -n "$MMLOG_CFLAGS"; then + pkg_cv_MMLOG_CFLAGS="$MMLOG_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mm-log\""; } >&5 + ($PKG_CONFIG --exists --print-errors "mm-log") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_MMLOG_CFLAGS=`$PKG_CONFIG --cflags "mm-log" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$MMLOG_LIBS"; then + pkg_cv_MMLOG_LIBS="$MMLOG_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mm-log\""; } >&5 + ($PKG_CONFIG --exists --print-errors "mm-log") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_MMLOG_LIBS=`$PKG_CONFIG --libs "mm-log" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + MMLOG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "mm-log" 2>&1` + else + MMLOG_PKG_ERRORS=`$PKG_CONFIG --print-errors "mm-log" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$MMLOG_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (mm-log) were not met: + +$MMLOG_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables MMLOG_CFLAGS +and MMLOG_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables MMLOG_CFLAGS +and MMLOG_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5 ; } +else + MMLOG_CFLAGS=$pkg_cv_MMLOG_CFLAGS + MMLOG_LIBS=$pkg_cv_MMLOG_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + + +fi + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MMSESSION" >&5 +$as_echo_n "checking for MMSESSION... " >&6; } + +if test -n "$MMSESSION_CFLAGS"; then + pkg_cv_MMSESSION_CFLAGS="$MMSESSION_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mm-session\""; } >&5 + ($PKG_CONFIG --exists --print-errors "mm-session") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_MMSESSION_CFLAGS=`$PKG_CONFIG --cflags "mm-session" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$MMSESSION_LIBS"; then + pkg_cv_MMSESSION_LIBS="$MMSESSION_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mm-session\""; } >&5 + ($PKG_CONFIG --exists --print-errors "mm-session") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_MMSESSION_LIBS=`$PKG_CONFIG --libs "mm-session" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + MMSESSION_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "mm-session" 2>&1` + else + MMSESSION_PKG_ERRORS=`$PKG_CONFIG --print-errors "mm-session" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$MMSESSION_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (mm-session) were not met: + +$MMSESSION_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables MMSESSION_CFLAGS +and MMSESSION_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables MMSESSION_CFLAGS +and MMSESSION_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5 ; } +else + MMSESSION_CFLAGS=$pkg_cv_MMSESSION_CFLAGS + MMSESSION_LIBS=$pkg_cv_MMSESSION_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AUDIOSESSIONMGR" >&5 +$as_echo_n "checking for AUDIOSESSIONMGR... " >&6; } + +if test -n "$AUDIOSESSIONMGR_CFLAGS"; then + pkg_cv_AUDIOSESSIONMGR_CFLAGS="$AUDIOSESSIONMGR_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"audio-session-mgr\""; } >&5 + ($PKG_CONFIG --exists --print-errors "audio-session-mgr") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_AUDIOSESSIONMGR_CFLAGS=`$PKG_CONFIG --cflags "audio-session-mgr" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$AUDIOSESSIONMGR_LIBS"; then + pkg_cv_AUDIOSESSIONMGR_LIBS="$AUDIOSESSIONMGR_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"audio-session-mgr\""; } >&5 + ($PKG_CONFIG --exists --print-errors "audio-session-mgr") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_AUDIOSESSIONMGR_LIBS=`$PKG_CONFIG --libs "audio-session-mgr" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + AUDIOSESSIONMGR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "audio-session-mgr" 2>&1` + else + AUDIOSESSIONMGR_PKG_ERRORS=`$PKG_CONFIG --print-errors "audio-session-mgr" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$AUDIOSESSIONMGR_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (audio-session-mgr) were not met: + +$AUDIOSESSIONMGR_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables AUDIOSESSIONMGR_CFLAGS +and AUDIOSESSIONMGR_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables AUDIOSESSIONMGR_CFLAGS +and AUDIOSESSIONMGR_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5 ; } +else + AUDIOSESSIONMGR_CFLAGS=$pkg_cv_AUDIOSESSIONMGR_CFLAGS + AUDIOSESSIONMGR_LIBS=$pkg_cv_AUDIOSESSIONMGR_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB2" >&5 +$as_echo_n "checking for GLIB2... " >&6; } + +if test -n "$GLIB2_CFLAGS"; then + pkg_cv_GLIB2_CFLAGS="$GLIB2_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 gthread-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 gthread-2.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLIB2_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 gthread-2.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GLIB2_LIBS"; then + pkg_cv_GLIB2_LIBS="$GLIB2_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 gthread-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 gthread-2.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLIB2_LIBS=`$PKG_CONFIG --libs "glib-2.0 gthread-2.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GLIB2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0 gthread-2.0" 2>&1` + else + GLIB2_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0 gthread-2.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GLIB2_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (glib-2.0 gthread-2.0) were not met: + +$GLIB2_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GLIB2_CFLAGS +and GLIB2_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables GLIB2_CFLAGS +and GLIB2_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5 ; } +else + GLIB2_CFLAGS=$pkg_cv_GLIB2_CFLAGS + GLIB2_LIBS=$pkg_cv_GLIB2_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for VCONF" >&5 +$as_echo_n "checking for VCONF... " >&6; } + +if test -n "$VCONF_CFLAGS"; then + pkg_cv_VCONF_CFLAGS="$VCONF_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"vconf\""; } >&5 + ($PKG_CONFIG --exists --print-errors "vconf") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_VCONF_CFLAGS=`$PKG_CONFIG --cflags "vconf" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$VCONF_LIBS"; then + pkg_cv_VCONF_LIBS="$VCONF_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"vconf\""; } >&5 + ($PKG_CONFIG --exists --print-errors "vconf") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_VCONF_LIBS=`$PKG_CONFIG --libs "vconf" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + VCONF_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "vconf" 2>&1` + else + VCONF_PKG_ERRORS=`$PKG_CONFIG --print-errors "vconf" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$VCONF_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (vconf) were not met: + +$VCONF_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables VCONF_CFLAGS +and VCONF_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables VCONF_CFLAGS +and VCONF_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5 ; } +else + VCONF_CFLAGS=$pkg_cv_VCONF_CFLAGS + VCONF_LIBS=$pkg_cv_VCONF_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for HEYNOTI" >&5 +$as_echo_n "checking for HEYNOTI... " >&6; } + +if test -n "$HEYNOTI_CFLAGS"; then + pkg_cv_HEYNOTI_CFLAGS="$HEYNOTI_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"heynoti\""; } >&5 + ($PKG_CONFIG --exists --print-errors "heynoti") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_HEYNOTI_CFLAGS=`$PKG_CONFIG --cflags "heynoti" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$HEYNOTI_LIBS"; then + pkg_cv_HEYNOTI_LIBS="$HEYNOTI_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"heynoti\""; } >&5 + ($PKG_CONFIG --exists --print-errors "heynoti") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_HEYNOTI_LIBS=`$PKG_CONFIG --libs "heynoti" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + HEYNOTI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "heynoti" 2>&1` + else + HEYNOTI_PKG_ERRORS=`$PKG_CONFIG --print-errors "heynoti" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$HEYNOTI_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (heynoti) were not met: + +$HEYNOTI_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables HEYNOTI_CFLAGS +and HEYNOTI_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables HEYNOTI_CFLAGS +and HEYNOTI_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5 ; } +else + HEYNOTI_CFLAGS=$pkg_cv_HEYNOTI_CFLAGS + HEYNOTI_LIBS=$pkg_cv_HEYNOTI_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + + + + +# Check whether --enable-pulse was given. +if test "${enable_pulse+set}" = set; then : + enableval=$enable_pulse; + case "${enableval}" in + yes) USE_PULSE=yes ;; + no) USE_PULSE=no ;; + *) as_fn_error $? "bad value ${enableval} for --enable-pulse" "$LINENO" 5 ;; + esac + +else + USE_PULSE=no +fi + +if test "x$USE_PULSE" = "xyes"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PULSE" >&5 +$as_echo_n "checking for PULSE... " >&6; } + +if test -n "$PULSE_CFLAGS"; then + pkg_cv_PULSE_CFLAGS="$PULSE_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpulse\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpulse") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PULSE_CFLAGS=`$PKG_CONFIG --cflags "libpulse" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$PULSE_LIBS"; then + pkg_cv_PULSE_LIBS="$PULSE_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpulse\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpulse") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PULSE_LIBS=`$PKG_CONFIG --libs "libpulse" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + PULSE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libpulse" 2>&1` + else + PULSE_PKG_ERRORS=`$PKG_CONFIG --print-errors "libpulse" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$PULSE_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (libpulse) were not met: + +$PULSE_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables PULSE_CFLAGS +and PULSE_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables PULSE_CFLAGS +and PULSE_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5 ; } +else + PULSE_CFLAGS=$pkg_cv_PULSE_CFLAGS + PULSE_LIBS=$pkg_cv_PULSE_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + + +fi + if test "x$USE_PULSE" = "xyes"; then + USE_PULSE_TRUE= + USE_PULSE_FALSE='#' +else + USE_PULSE_TRUE='#' + USE_PULSE_FALSE= +fi + + + +# Checks for header files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#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)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +for ac_header in fcntl.h memory.h stdlib.h string.h sys/time.h unistd.h errno.h sys/types.h sys/stat.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* 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"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 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; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + + +# Checks for library functions. +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +$as_echo_n "checking for working alloca.h... " >&6; } +if test "${ac_cv_working_alloca_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_working_alloca_h=yes +else + ac_cv_working_alloca_h=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +$as_echo "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then + +$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +$as_echo_n "checking for alloca... " >&6; } +if test "${ac_cv_func_alloca_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# ifdef 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); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_func_alloca_works=yes +else + ac_cv_func_alloca_works=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +$as_echo "$ac_cv_func_alloca_works" >&6; } + +if test $ac_cv_func_alloca_works = yes; then + +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h + +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=\${LIBOBJDIR}alloca.$ac_objext + +$as_echo "#define C_ALLOCA 1" >>confdefs.h + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 +$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } +if test "${ac_cv_os_cray+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 +$as_echo "$ac_cv_os_cray" >&6; } +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func +_ACEOF + + break +fi + + done +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +$as_echo_n "checking stack direction for C alloca... " >&6; } +if test "${ac_cv_c_stack_direction+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_c_stack_direction=0 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +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 () +{ + return find_stack_direction () < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_stack_direction=1 +else + ac_cv_c_stack_direction=-1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +$as_echo "$ac_cv_c_stack_direction" >&6; } +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +_ACEOF + + +fi + +for ac_header in vfork.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" +if test "x$ac_cv_header_vfork_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VFORK_H 1 +_ACEOF + +fi + +done + +for ac_func in fork vfork +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +if test "x$ac_cv_func_fork" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 +$as_echo_n "checking for working fork... " >&6; } +if test "${ac_cv_func_fork_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_fork_works=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* By Ruediger Kuhlmann. */ + return fork () < 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_fork_works=yes +else + ac_cv_func_fork_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 +$as_echo "$ac_cv_func_fork_works" >&6; } + +else + ac_cv_func_fork_works=$ac_cv_func_fork +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 +$as_echo_n "checking for working vfork... " >&6; } +if test "${ac_cv_func_vfork_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_vfork_works=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Thanks to Paul Eggert for this test. */ +$ac_includes_default +#include +#ifdef HAVE_VFORK_H +# include +#endif +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include , but some compilers + (e.g. gcc -O) don't grok . Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static void +#ifdef __cplusplus +sparc_address_test (int arg) +# else +sparc_address_test (arg) int arg; +#endif +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} + +int +main () +{ + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (0); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + return ( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_vfork_works=yes +else + ac_cv_func_vfork_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 +$as_echo "$ac_cv_func_vfork_works" >&6; } + +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=$ac_cv_func_vfork + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} +fi + +if test "x$ac_cv_func_vfork_works" = xyes; then + +$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h + +else + +$as_echo "#define vfork fork" >>confdefs.h + +fi +if test "x$ac_cv_func_fork_works" = xyes; then + +$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h + +fi + +for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +$as_echo_n "checking for GNU libc compatible malloc... " >&6; } +if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_malloc_0_nonnull=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *malloc (); +#endif + +int +main () +{ +return ! malloc (0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_malloc_0_nonnull=yes +else + ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then : + +$as_echo "#define HAVE_MALLOC 1" >>confdefs.h + +else + $as_echo "#define HAVE_MALLOC 0" >>confdefs.h + + case " $LIBOBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; +esac + + +$as_echo "#define malloc rpl_malloc" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 +$as_echo_n "checking for working memcmp... " >&6; } +if test "${ac_cv_func_memcmp_working+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_memcmp_working=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Some versions of memcmp are not 8-bit clean. */ + char c0 = '\100', c1 = '\200', c2 = '\201'; + if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) + return 1; + + /* The Next x86 OpenStep bug shows up only when comparing 16 bytes + or more and with at least one buffer not starting on a 4-byte boundary. + William Lewis provided this test program. */ + { + char foo[21]; + char bar[21]; + int i; + for (i = 0; i < 4; i++) + { + char *a = foo + i; + char *b = bar + i; + strcpy (a, "--------01111111"); + strcpy (b, "--------10000000"); + if (memcmp (a, b, 16) >= 0) + return 1; + } + return 0; + } + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_memcmp_working=yes +else + ac_cv_func_memcmp_working=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 +$as_echo "$ac_cv_func_memcmp_working" >&6; } +test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in + *" memcmp.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" + ;; +esac + + +for ac_header in sys/select.h sys/socket.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5 +$as_echo_n "checking types of arguments for select... " >&6; } +if test "${ac_cv_func_select_args+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + for ac_arg234 in 'fd_set *' 'int *' 'void *'; do + for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do + for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +#ifdef HAVE_SYS_SELECT_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif + +int +main () +{ +extern int select ($ac_arg1, + $ac_arg234, $ac_arg234, $ac_arg234, + $ac_arg5); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done + done +done +# Provide a safe default value. +: ${ac_cv_func_select_args='int,int *,struct timeval *'} + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5 +$as_echo "$ac_cv_func_select_args" >&6; } +ac_save_IFS=$IFS; IFS=',' +set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` +IFS=$ac_save_IFS +shift + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG1 $1 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG234 ($2) +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG5 ($3) +_ACEOF + +rm -f conftest* + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } +if test "${ac_cv_type_signal+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +return *(signal (0, 0)) (0) == 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_signal=int +else + ac_cv_type_signal=void +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + +for ac_func in memset select +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +ac_config_files="$ac_config_files common/Makefile Makefile server/Makefile server/plugin/Makefile server/plugin/wav/Makefile server/plugin/keytone/Makefile server/plugin/headset/Makefile server/plugin/tone/Makefile pkgconfig/Makefile pkgconfig/mm-sound.pc pkgconfig/mm-keysound.pc pkgconfig-sdk/Makefile pkgconfig-sdk/mm-sound.pc pkgconfig-sdk/mm-keysound.pc testsuite/Makefile init/Makefile" + +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, we kill variables containing newlines. +# 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. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + 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" && + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + 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}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${IS_SDK_TRUE}" && test -z "${IS_SDK_FALSE}"; then + as_fn_error $? "conditional \"IS_SDK\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_PULSE_TRUE}" && test -z "${USE_PULSE_FALSE}"; then + as_fn_error $? "conditional \"USE_PULSE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $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} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by avsystem $as_me 1.0, which was +generated by GNU Autoconf 2.67. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + 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 the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +avsystem config.status 1.0 +configured by $0, generated by GNU Autoconf 2.67, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +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=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + 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 || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# 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 + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' +macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' +enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' +pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' +host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' +host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' +host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' +build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' +build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' +build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' +SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' +Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' +GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' +EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' +FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' +LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' +NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' +LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' +ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' +exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' +lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' +reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' +AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' +STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' +RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' +compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' +GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' +SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' +ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' +need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' +LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' +libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' +version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' +runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' +libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' +soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' +old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' +striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +AR \ +AR_FLAGS \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +SHELL \ +ECHO \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_wl \ +lt_prog_compiler_pic \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +fix_srcfile_path \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` + ;; +esac + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.hin" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "server/Makefile") CONFIG_FILES="$CONFIG_FILES server/Makefile" ;; + "server/plugin/Makefile") CONFIG_FILES="$CONFIG_FILES server/plugin/Makefile" ;; + "server/plugin/wav/Makefile") CONFIG_FILES="$CONFIG_FILES server/plugin/wav/Makefile" ;; + "server/plugin/keytone/Makefile") CONFIG_FILES="$CONFIG_FILES server/plugin/keytone/Makefile" ;; + "server/plugin/headset/Makefile") CONFIG_FILES="$CONFIG_FILES server/plugin/headset/Makefile" ;; + "server/plugin/tone/Makefile") CONFIG_FILES="$CONFIG_FILES server/plugin/tone/Makefile" ;; + "pkgconfig/Makefile") CONFIG_FILES="$CONFIG_FILES pkgconfig/Makefile" ;; + "pkgconfig/mm-sound.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/mm-sound.pc" ;; + "pkgconfig/mm-keysound.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/mm-keysound.pc" ;; + "pkgconfig-sdk/Makefile") CONFIG_FILES="$CONFIG_FILES pkgconfig-sdk/Makefile" ;; + "pkgconfig-sdk/mm-sound.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig-sdk/mm-sound.pc" ;; + "pkgconfig-sdk/mm-keysound.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig-sdk/mm-keysound.pc" ;; + "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;; + "init/Makefile") CONFIG_FILES="$CONFIG_FILES init/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; + 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 against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #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. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # 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. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + 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. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_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=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # 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 + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# 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 + +# 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//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# 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 + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# 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 + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that does not interpret backslashes. +ECHO=$lt_ECHO + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# 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 + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# 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 + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# 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 + +# 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 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# 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 + +# 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 + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# 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 a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# 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 DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# 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 + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_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 + +# 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 + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_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 +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # 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 '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $* )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$@"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} + +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# 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 || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..da77f1a --- /dev/null +++ b/configure.ac @@ -0,0 +1,127 @@ +AC_PREREQ(2.52) + +AC_INIT([avsystem], [1.0]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AC_CONFIG_HEADERS([config.h:config.hin]) + +AC_CONFIG_MACRO_DIR([m4]) + +# Checks for programs. +AC_PROG_CC +AC_C_CONST +dnl AC_FUNC_MALLOC +AC_FUNC_MMAP +AC_FUNC_REALLOC +AC_FUNC_SELECT_ARGTYPES +AC_FUNC_STAT +AC_FUNC_VPRINTF +AC_HEADER_STDBOOL +AC_HEADER_STDC +AC_HEADER_TIME +AC_PROG_GCC_TRADITIONAL +AC_PROG_LIBTOOL + +# Checks for libraries. +PKG_CHECK_MODULES(AVSYSTEM, avsysaudio) +AC_SUBST(AVSYSTEM_CFLAGS) +AC_SUBST(AVSYSTEM_LIBS) + +PKG_CHECK_MODULES(MMCOMMON, mm-common) +AC_SUBST(MMCOMMON_CFLAGS) +AC_SUBST(MMCOMMON_LIBS) + +if [test "x$IS_SDK" = "xyes"]; +then +echo "SDK build does not use mm-log" +else +PKG_CHECK_MODULES(MMLOG, mm-log) +AC_SUBST(MMLOG_CFLAGS) +AC_SUBST(MMLOG_LIBS) +fi + +PKG_CHECK_MODULES(MMSESSION, mm-session) +AC_SUBST(MMSESSION_CFLAGS) +AC_SUBST(MMSESSION_LIBS) + +PKG_CHECK_MODULES(AUDIOSESSIONMGR, audio-session-mgr) +AC_SUBST(AUDIOSESSIONMGR_CFLAGS) +AC_SUBST(AUDIOSESSIONMGR_LIBS) + +PKG_CHECK_MODULES(GLIB2, glib-2.0 gthread-2.0) +AC_SUBST(GLIB2_CFLAGS) +AC_SUBST(GLIB2_LIBS) + +PKG_CHECK_MODULES(VCONF, vconf) +AC_SUBST(VCONF_CFLAGS) +AC_SUBST(VCONF_LIBS) + +PKG_CHECK_MODULES(HEYNOTI, heynoti) +AC_SUBST(HEYNOTI_CFLAGS) +AC_SUBST(HEYNOTI_LIBS) + +AC_ARG_ENABLE(pulse, AC_HELP_STRING([--enable-pulse], [enable pulseaudio client]), +[ + case "${enableval}" in + yes) USE_PULSE=yes ;; + no) USE_PULSE=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-pulse) ;; + esac + ],[USE_PULSE=no]) +if test "x$USE_PULSE" = "xyes"; then +PKG_CHECK_MODULES(PULSE, libpulse) +AC_SUBST(PULSE_CFLAGS) +AC_SUBST(PULSE_LIBS) +fi +AM_CONDITIONAL([USE_PULSE], [test "x$USE_PULSE" = "xyes"]) + +dnl use security -------------------------------------------------------------------------- +AC_ARG_ENABLE(security, AC_HELP_STRING([--enable-security], [using security]), +[ + case "${enableval}" in + yes) USE_SECURITY=yes ;; + no) USE_SECURITY=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-security) ;; + esac + ],[USE_SECURITY=no]) + +if test "x$USE_SECURITY" = "xyes"; then +PKG_CHECK_MODULES(SECURITY, security-server) +AC_SUBST(SECURITY_CFLAGS) +AC_SUBST(SECURITY_LIBS) +fi +AM_CONDITIONAL(USE_SECURITY, test "x$USE_SECURITY" = "xyes") +dnl end -------------------------------------------------------------------- + + +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([fcntl.h memory.h stdlib.h string.h sys/time.h unistd.h errno.h sys/types.h sys/stat.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_PID_T +AC_TYPE_SIZE_T + +# Checks for library functions. +AC_FUNC_ALLOCA +AC_FUNC_FORK +AC_FUNC_MALLOC +AC_FUNC_MEMCMP +AC_FUNC_SELECT_ARGTYPES +AC_TYPE_SIGNAL +AC_CHECK_FUNCS([memset select]) +AC_CONFIG_FILES([ +common/Makefile +Makefile +server/Makefile +server/plugin/Makefile +server/plugin/wav/Makefile +server/plugin/keytone/Makefile +server/plugin/tone/Makefile +pkgconfig/Makefile +pkgconfig/mm-sound.pc +pkgconfig/mm-keysound.pc +testsuite/Makefile +init/Makefile +]) +AC_OUTPUT diff --git a/depcomp b/depcomp new file mode 100755 index 0000000..e5f9736 --- /dev/null +++ b/depcomp @@ -0,0 +1,589 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2007-03-29.01 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 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., 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. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +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 + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +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. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + 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. In older versions, 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. + # Version 6 uses the directory in both cases. + 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$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$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" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + 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$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +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 + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space 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 preprocessed 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'. + 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 + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $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 $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # 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 ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + 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 preprocessed 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 -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [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 preprocessed 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 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/include/mm_ipc.h b/include/mm_ipc.h new file mode 100644 index 0000000..9c7997f --- /dev/null +++ b/include/mm_ipc.h @@ -0,0 +1,97 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __MM_SOUND_IPC_H__ +#define __MM_SOUND_IPC_H__ + +#include +#include + +#include "mm_sound.h" + +#define FILE_PATH 512 + +typedef enum { + MM_IPC_SUCCESS, + MM_IPC_WARNING, + MM_IPC_ERROR, + MM_IPC_PROCESS, +} mm_ipc_async_state; + +typedef struct +{ + /* Recieve data */ + int msgid; + int msgtype; + int code; + + /* Send data */ + int keytone; + int repeat; + int tone; + double volume; + int memptr; + int memsize; + int sharedkey; + char filename[FILE_PATH]; + + /* Device */ + int route; + int device_in; + int device_out; + int is_available; + int route_list[MM_SOUND_ROUTE_NUM]; + + /* Common data */ + int handle; + void *callback; + void *cbdata; + int samplerate; + int channels; + int volume_config; + int session_type; + int priority; + int handle_route; +} mmsound_ipc_t; + +typedef struct +{ + long msg_type; + mmsound_ipc_t sound_msg; +} mm_ipc_msg_t; + +typedef void (*mm_ipc_callback_t)(int code, int size); + +int MMSoundGetTime(char *position); +int MMIpcCreate(const int key); +int MMIpcDestroy(const int key); +int MMIpcSendMsg(const int key, mm_ipc_msg_t *msg); +int MMIpcRecvMsg(const int key, mm_ipc_msg_t *msg); + +int MMIpcSendMsgAsync(const char *ipcname, mm_ipc_msg_t *msg, mm_ipc_callback_t callback); +int MMIpcRecvMsgAsync(const char *ipcname, mm_ipc_msg_t **msg, mm_ipc_callback_t callback); +int MMIpcRecvData(const char *ipcname, void *data, int *size); +int MMIpcSendDataAsync(const char *ipcname, void *data, int size, mm_ipc_callback_t callback); +int __mm_sound_lock(void); +int __mm_sound_unlock(void); + +#endif /* __MM_SOUND_IPC_H__ */ + diff --git a/include/mm_sound.h b/include/mm_sound.h new file mode 100644 index 0000000..6446d03 --- /dev/null +++ b/include/mm_sound.h @@ -0,0 +1,2163 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/** + * @file mm_sound.h + * @brief Application interface library for sound module. + * @date + * @version Release + * + * Application interface library for sound module. + */ + +#ifndef __MM_SOUND_H__ +#define __MM_SOUND_H__ + +#include +#include +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + @addtogroup SOUND + @{ + @par + This part is describes the sound module of multimedia framework. Sound + module provides APIs to implement play wav file with simple api, to handle volume information, + to handle audio route policy. + + @par + There is six different volume type for normal usage. application should set proper volume type to multimedia playback APIs. +
+ + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
VOLUME_TYPE_SYSTEMvolume for normal system sound (e.g. keysound, camera shutter)
VOLUME_TYPE_NOTIFICATIONvolume for notification (e.g. message, email notification)
VOLUME_TYPE_RINGTONEvolume for incoming call ring
VOLUME_TYPE_MEDIAvolume for media playback (e.g. music, video playback)
VOLUME_TYPE_CALLvolume for call
+ + @par + application can change audio route policy with mm-sound API. + Audio route is input and output of audio stream. + + @par + @image html audio_device.png "Figure1. Audio Devices of mobile phone" width=12cm + @image latex audio_device.png "Figure1. Audio Devices of mobile phone" width=12cm + + @par + Default audio route policy is like follows + @par + for playback +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Bluetooth headsetWired headsetPlayback Device
connectedpluggedBluetooth headset
connectedunpluggedBluetooth headset
disconnectedpluggedWired headset
disconnectedunpluggedLoud speaker
+ + @par + for capture (bluetooth headset mic used only in call mode) +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Bluetooth headset micWired headset micCapture Device
connectedpluggedWired headset mic
connectedunpluggedmicrophone
disconnectedpluggedWired headset mic
disconnectedunpluggedWired headset mic
+ + @par + If application changes routing policy to SYSTEM_AUDIO_ROUTE_POLICY_IGNORE_A2DP with mm_sound_route_set_system_policy + audio routing policy has changed to ignore bluetooth headset connection. + @par + for playback +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Bluetooth headsetWired headsetPlayback Device
connectedpluggedWired headset
connectedunpluggedLoud speaker
disconnectedpluggedWired headset
disconnectedunpluggedLoud speaker
+ + @par + for capture (bluetooth headset mic used only in call mode) +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Bluetooth headset micWired headset micCapture Device
connectedpluggedWired headset mic
connectedunpluggedmicrophone
disconnectedpluggedWired headset mic
disconnectedunpluggedWired headset mic
+ + @par + If application changes routing policy to SYSTEM_AUDIO_ROUTE_POLICY_HANDSET_ONLY with mm_sound_route_set_system_policy + audio routing policy has changed to use only loud speaker and microphone. + @par + for playback +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Bluetooth headsetWired headsetPlayback Device
connectedpluggedLoud speaker
connectedunpluggedLoud speaker
disconnectedpluggedLoud speaker
disconnectedunpluggedLoud speaker
+ + @par + for capture (bluetooth headset mic used only in call mode) +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Bluetooth headset micWired headset micCapture Device
connectedpluggedmicrophone
connectedunpluggedmicrophone
disconnectedpluggedmicrophone
disconnectedunpluggedmicrophone
+ + */ + +/* + * MMSound Volume APIs + */ + +/** + * Enumerations of Volume type. + */ + +typedef enum { + VOLUME_TYPE_SYSTEM, /**< System volume type */ + VOLUME_TYPE_NOTIFICATION, /**< Notification volume type */ + VOLUME_TYPE_ALARM, /**< Alarm volume type */ + VOLUME_TYPE_RINGTONE, /**< Ringtone volume type */ + VOLUME_TYPE_MEDIA, /**< Media volume type */ + VOLUME_TYPE_CALL, /**< Call volume type */ + VOLUME_TYPE_VOIP, /**< VOIP volume type */ + VOLUME_TYPE_FIXED, /**< Volume type for fixed acoustic level */ + VOLUME_TYPE_EXT_JAVA, /**< External system volume for Java */ + VOLUME_TYPE_MAX, /**< Volume type count */ + VOLUME_TYPE_EXT_ANDROID = VOLUME_TYPE_FIXED, /**< External system volume for Android */ +} volume_type_t; + +typedef enum { + VOLUME_GAIN_DEFAULT = 0, + VOLUME_GAIN_DIALER = 1<<8, + VOLUME_GAIN_TOUCH = 2<<8, + VOLUME_GAIN_AF = 3<<8, + VOLUME_GAIN_SHUTTER1 = 4<<8, + VOLUME_GAIN_SHUTTER2 = 5<<8, + VOLUME_GAIN_CAMCORDING = 6<<8, + VOLUME_GAIN_MIDI = 7<<8, + VOLUME_GAIN_BOOTING = 8<<8, + VOLUME_GAIN_VIDEO = 9<<8, + VOLUME_GAIN_VIDEO_HDMI = 10<<8, +} volume_gain_t; + +/** + * Volume change callback function type. + * + * @param user_data [in] Argument passed when callback has called + * + * @return No return value + * @remark None. + * @see mm_sound_volume_add_callback mm_sound_volume_remove_callback + */ +typedef void (*volume_callback_fn)(void* user_data); + +/** + * This function is to retrieve number of volume level. + * + * @param type [in] volume type to query + * @param step [out] number of volume steps + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark step means number of steps. so actual volume step can be 0 ~ step-1 + * @see volume_type_t + * @pre None. + * @post None. + * @par Example + * @code +int step = 0; +int ret = 0; +int max = 0; + +ret = mm_sound_volume_get_step(VOLUME_TYPE_SYSTEM, &step); +if(ret < 0) +{ + printf("Can not get volume step\n"); +} +else +{ + max = step - 1; + //set system volume to max value + mm_sound_volume_set_value(VOLUME_TYPE_SYSTEM, max); +} + * @endcode + */ +int mm_sound_volume_get_step(volume_type_t type, int *step); + + +/** + * This function is to add volume changed callback. + * + * @param type [in] volume type to set change callback function + * @param func [in] callback function pointer + * @param user_data [in] user data passing to callback function + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark Only one callback function per volume type will be registered. + * if you want to change callback function for certain volume type, + * remove callback first via mm_sound_volume_remove_callback(). + * @see volume_type_t volume_callback_fn + * @pre There should be not be pre-registered callback fuction to given volume type. + * @post Callback function will be registered to given volume type + * @par Example + * @code +volume_type_t g_vol_type = VOLUME_TYPE_MEDIA; + +void _volume_callback(void *data) +{ + unsigned int value = 0; + int result = 0; + volume_type_t *type = (volume_type_t*)data; + + result = mm_sound_volume_get_value(*type, &value); + if(result == MM_ERROR_NONE) + { + printf("Current volume value is %d\n", value); + } + else + { + printf("Can not get volume\n"); + } +} + +int volume_control() +{ + int ret = 0; + + ret = mm_sound_volume_add_callback(g_vol_type, _volume_callback, (void*)&g_vol_type); + if ( MM_ERROR_NONE != ret) + { + printf("Can not add callback\n"); + } + else + { + printf("Add callback success\n"); + } + + return 0; +} + + * @endcode + */ +int mm_sound_volume_add_callback(volume_type_t type, volume_callback_fn func, void* user_data); + + +/** + * This function is to remove volume changed callback. + * + * @param type [in] volume type to set change callback function + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark None. + * @pre Callback function should be registered previously for given volume type. + * @post Callback function will not be called anymore. + * @see volume_type_t + * @par Example + * @code +void _volume_callback(void *data) +{ + printf("Callback function\n"); +} + +int volume_callback() +{ + int ret = 0; + int vol_type = VOLUME_TYPE_MEDIA; + + mm_sound_volume_add_callback(vol_type, _volume_callback, NULL); + + ret = mm_sound_volume_remove_callback(vol_type); + if ( MM_ERROR_NONE == ret) + { + printf("Remove callback success\n"); + } + else + { + printf("Remove callback failed\n"); + } + + return ret; +} + + * @endcode + */ +int mm_sound_volume_remove_callback(volume_type_t type); + + +/** + * This function is to set volume level of certain volume type. + * + * @param type [in] volume type to set value. + * @param value [in] volume value. + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark value should be 0 ~ mm_sound_volume_get_step() -1 + * @see mm_sound_volume_get_step, mm_sound_volume_get_value volume_type_t + * @pre None. + * @post Volume value will be changed to given value for given volume type. + * @par Example + * @code +int step = 0; +int ret = 0; +int max = 0; + +ret = mm_sound_volume_get_step(VOLUME_TYPE_SYSTEM, &step); +if(ret < 0) +{ + printf("Can not get volume step\n"); +} +else +{ + max = step - 1; + //set system volume to max value + ret = mm_sound_volume_set_value(VOLUME_TYPE_SYSTEM, max); + if(ret < 0) + { + printf("Can not set volume value\n"); + } +} + * @endcode + */ +int mm_sound_volume_set_value(volume_type_t type, const unsigned int value); + + + +/** + * This function is to get volume level of certain volume type. + * + * @param type [in] volume type to get value. + * @param value [out] volume value. + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark None. + * @pre None. + * @post None. + * @see volume_type_t mm_sound_volume_set_value + * @par Example + * @code +int value = 0; +int ret = 0; + +ret = mm_sound_volume_get_value(VOLUME_TYPE_SYSTEM, &value); +if(ret < 0) +{ + printf("Can not get volume\n"); +} +else +{ + printf("System type volume is %d\n", value); +} + * @endcode + * @see mm_sound_volume_set_value + */ +int mm_sound_volume_get_value(volume_type_t type, unsigned int *value); + + + +/** + * This function is to set primary volume type. + * + * @param type [in] volume type to set as primary volume type. + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark Application should use this function during foreground. + * Application should clear primary volume type by mm_sound_volume_primary_type_clear() when it goes background. + * @pre None. + * @post Volume app. will be update given volume type when H/W volume control key pressed. + * @see mm_sound_volume_primary_type_clear volume_type_t + * @par Example + * @code +static int _resume(void *data) +{ + int ret = 0; + + ret = mm_sound_volume_primary_type_set(VOLUME_TYPE_MEDIA); + if(ret < 0) + { + printf("Can not set primary volume type\n"); + } + ... +} + +static int _pause(void* data) +{ + int ret = 0; + + ret = mm_sound_volume_primary_type_clear(); + if(ret < 0) + { + printf("Can not clear primary volume type\n"); + } + ... +} + +int main() +{ + ... + struct appcore_ops ops = { + .create = _create, + .terminate = _terminate, + .pause = _pause, + .resume = _resume, + .reset = _reset, + }; + ... + return appcore_efl_main(PACKAGE, ..., &ops); +} + * @endcode + */ +int mm_sound_volume_primary_type_set(volume_type_t type); + + + +/** + * This function is to clear primary volume type. + * + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark mm_sound_volume_primary_type_set() and mm_sound_volume_primary_type_clear() should be used as pair + * @see mm_sound_volume_primary_type_set + * @pre primary volume should be set at same process. + * @post primary volume will be cleared. + * @par Example + * @code +static int _resume(void *data) +{ + int ret = 0; + + ret = mm_sound_volume_primary_type_set(VOLUME_TYPE_MEDIA); + if(ret < 0) + { + printf("Can not set primary volume type\n"); + } + ... +} + +static int _pause(void* data) +{ + int ret = 0; + + ret = mm_sound_volume_primary_type_clear(); + if(ret < 0) + { + printf("Can not clear primary volume type\n"); + } + ... +} + +int main() +{ + ... + struct appcore_ops ops = { + .create = _create, + .terminate = _terminate, + .pause = _pause, + .resume = _resume, + .reset = _reset, + }; + ... + return appcore_efl_main(PACKAGE, ..., &ops); +} + * @endcode + */ +int mm_sound_volume_primary_type_clear(); + + + +/** + * This function is to get current playing volume type + * + * @param type [out] current playing volume type + * + * @return This function returns MM_ERROR_NONE on success, + * or MM_ERROR_SOUND_VOLUME_NO_INSTANCE when there is no existing playing instance, + * or MM_ERROR_SOUND_VOLUME_CAPTURE_ONLY when only capture audio instances are exist. + * or negative value with error code for other errors. + * @remark None. + * @pre None. + * @post None. + * @see mm_sound_volume_get_value, mm_sound_volume_set_value + * @par Example + * @code +int ret=0; +volume_type_t type = 0; + +ret = mm_sound_volume_get_current_playing_type(&type); +switch(ret) +{ +case MM_ERROR_NONE: + printf("Current playing is %d\n", type); + break; +case MM_ERROR_SOUND_VOLUME_NO_INSTANCE: + printf("No sound instance\n"); + break; +case MM_ERROR_SOUND_VOLUME_CAPTURE_ONLY: + printf("Only sound capture instances are exist\n"); + break; +default: + printf("Error\n"); + break; +} + + * @endcode + */ +int mm_sound_volume_get_current_playing_type(volume_type_t *type); + + +/* + * MMSound PCM APIs + */ +typedef void* MMSoundPcmHandle_t; /**< MMsound PCM handle type */ + +/** + * Enumerations of Format used in MMSoundPcm operation. + */ +typedef enum { + MMSOUND_PCM_U8 = 0x70, /**< unsigned 8bit audio */ + MMSOUND_PCM_S16_LE, /**< signed 16bit audio */ +} MMSoundPcmFormat_t; + +/** + * Enumerations of Channel count used in MMSoundPcm operation. + */ +typedef enum { + MMSOUND_PCM_MONO = 0x80, /**< Mono channel */ + MMSOUND_PCM_STEREO, /**< Stereo channel */ +}MMSoundPcmChannel_t; + + +/** + * This function is to create handle for PCM playback. + * + * @param handle [out] handle to play pcm data + * @param rate [in] sample rate (8000Hz ~ 44100Hz) + * @param channel [in] number of channels (mono or stereo) + * @param format [in] S8 or S16LE + * @param volume [in] volume type + * + * @return This function returns suggested buffer size (in bytes) on success, or negative value + * with error code. + * @remark use mm_sound_volume_set_value() function to change volume + * @see mm_sound_pcm_play_write, mm_sound_pcm_play_close, mm_sound_volume_set_value, MMSoundPcmFormat_t, MMSoundPcmChannel_t volume_type_t + * @pre None. + * @post PCM play handle will be created. + * @par Example + * @code +#include +#include +#include + +int main(int argc, char* argv[]) +{ + FILE *fp = NULL; + char *buffer = NULL; + int ret = 0; + int size = 0; + int readed = 0; + MMSoundPcmHandle_t handle; + char *filename = NULL; + + if(argc !=2 ) + { + printf("Usage) %s filename\n", argv[0]); + return -1; + } + filename = argv[1]; + + fp = fopen(filename,"r"); + if(fp ==NULL) + { + printf("Can not open file %s\n", filename); + return -1; + } + + size = mm_sound_pcm_play_open(&handle, 44100, MMSOUND_PCM_STEREO, MMSOUND_PCM_S16_LE, VOLUME_TYPE_SYSTEM); + if(size < 0) + { + printf("Can not open playback handle\n"); + return -2; + } + + buffer = alloca(size); + while((readed = fread(buffer, size, sizeof(char), fp)) > 0 ) + { + ret = mm_sound_pcm_play_write(handle, (void*)buffer, readed); + if(ret < 0) + { + printf("write fail\n"); + break; + } + memset(buffer, '\0', sizeof(buffer)); + } + + fclose(fp); + mm_sound_pcm_play_close(handle); + return 0; +} + * @endcode + */ +int mm_sound_pcm_play_open(MMSoundPcmHandle_t *handle, const unsigned int rate, MMSoundPcmChannel_t channel, MMSoundPcmFormat_t format, const volume_type_t volume); + +/** + * This function start pcm playback + * + * @param handle [in] handle to start playback + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark + * @see + * @pre PCM playback handle should be allocated. + * @post PCM playback is ready to write. + */ +int mm_sound_pcm_play_start(MMSoundPcmHandle_t handle); + +/** + * This function stop pcm playback + * + * @param handle [in] handle to stop playback + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark + * @see + * @pre PCM playback handle should be allocated. + * @post PCM playback data will not be buffered. + */ +int mm_sound_pcm_play_stop(MMSoundPcmHandle_t handle); + +/** + * This function is to play PCM memory buffer. + * + * @param handle [in] handle to play pcm data + * @param ptr [in] pcm buffer address + * @param length_byte [in] size of pcm buffer (in bytes) + * + * @return This function returns written data size on success, or negative value + * with error code. + * @remark Make pcm buffer size with returned value of mm_sound_pcm_play_open() + * @see mm_sound_pcm_play_open, mm_sound_pcm_play_close + * @pre PCM play handle should be created. + * @post Sound will be generated with given PCM buffer data. + * @par Example + * @code +#include +#include +#include + +int main(int argc, char* argv[]) +{ + FILE *fp = NULL; + char *buffer = NULL; + int ret = 0; + int size = 0; + int readed = 0; + MMSoundPcmHandle_t handle; + char *filename = NULL; + + if(argc !=2 ) + { + printf("Usage) %s filename\n", argv[0]); + return -1; + } + filename = argv[1]; + + fp = fopen(filename,"r"); + if(fp ==NULL) + { + printf("Can not open file %s\n", filename); + return -1; + } + + size = mm_sound_pcm_play_open(&handle, 44100, MMSOUND_PCM_STEREO, MMSOUND_PCM_S16_LE, VOLUME_TYPE_SYSTEM); + if(size < 0) + { + printf("Can not open playback handle\n"); + return -2; + } + + buffer = alloca(size); + while((readed = fread(buffer, size, sizeof(char), fp)) > 0 ) + { + ret = mm_sound_pcm_play_write(handle, (void*)buffer, readed); + if(ret < 0) + { + printf("write fail\n"); + break; + } + memset(buffer, '\0', sizeof(buffer)); + } + + fclose(fp); + mm_sound_pcm_play_close(handle); + return 0; +} + * @endcode + */ +int mm_sound_pcm_play_write(MMSoundPcmHandle_t handle, void* ptr, unsigned int length_byte); + + + +/** + * This function is to close PCM memory playback handle + * + * @param handle [in] handle to play pcm data + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark None + * @see mm_sound_pcm_play_open, mm_sound_pcm_play_write + * @pre PCM play handle should be created + * @post PCM play handle will be terminated. + * @par Example + * @code +#include +#include +#include + +int main(int argc, char* argv[]) +{ + FILE *fp = NULL; + char *buffer = NULL; + int ret = 0; + int size = 0; + int readed = 0; + MMSoundPcmHandle_t handle; + char *filename = NULL; + + if(argc !=2 ) + { + printf("Usage) %s filename\n", argv[0]); + return -1; + } + filename = argv[1]; + + fp = fopen(filename,"r"); + if(fp ==NULL) + { + printf("Can not open file %s\n", filename); + return -1; + } + + size = mm_sound_pcm_play_open(&handle, 44100, MMSOUND_PCM_STEREO, MMSOUND_PCM_S16_LE, VOLUME_TYPE_SYSTEM); + if(size < 0) + { + printf("Can not open playback handle\n"); + return -2; + } + + buffer = alloca(size); + while((readed = fread(buffer, size, sizeof(char), fp)) > 0 ) + { + ret = mm_sound_pcm_play_write(handle, (void*)buffer, readed); + if(ret < 0) + { + printf("write fail\n"); + break; + } + memset(buffer, '\0', sizeof(buffer)); + } + + fclose(fp); + mm_sound_pcm_play_close(handle); + return 0; +} + * @endcode + */ +int mm_sound_pcm_play_close(MMSoundPcmHandle_t handle); + + + +/** + * This function is to create handle for PCM capture. + * + * @param handle [out] handle to capture pcm data + * @param rate [in] sample rate (8000Hz ~ 44100Hz) + * @param channel [in] number of channels (mono or stereo) + * @param format [in] S8 or S16LE + * + * @return This function returns suggested buffer size (in bytes) on success, or negative value + * with error code. + * @remark only mono channel is valid for now. + * @see mm_sound_pcm_capture_read, mm_sound_pcm_capture_close, MMSoundPcmFormat_t, MMSoundPcmChannel_t + * @pre None. + * @post PCM capture handle will be allocated. + * @par Example + * @code +#include +#include +#include + +int main(int argc, char* argv[]) +{ + FILE *fp = NULL; + char *buffer = NULL; + int ret = 0; + int size = 0; + int count = 0; + MMSoundPcmHandle_t handle; + char *filename = NULL; + + if(argc !=2 ) + { + printf("Usage) %s filename\n", argv[0]); + return -1; + } + filename = argv[1]; + + fp = fopen(filename,"w"); + if(fp ==NULL) + { + printf("Can not open file %s\n", filename); + return -1; + } + + size = mm_sound_pcm_capture_open(&handle, 44100, MMSOUND_PCM_MONO, MMSOUND_PCM_S16_LE); + if(size < 0) + { + printf("Can not open capture handle\n"); + return -2; + } + + buffer = alloca(size); + while(1) + { + ret = mm_sound_pcm_capture_read(handle, (void*)buffer, size); + if(ret < 0) + { + printf("read fail\n"); + break; + } + fwrite(buffer, ret, sizeof(char), fp); + if(count++ > 20) { + break; + } + } + + fclose(fp); + mm_sound_pcm_capture_close(handle); + return 0; +} + + * @endcode + */ +int mm_sound_pcm_capture_open(MMSoundPcmHandle_t *handle, const unsigned int rate, MMSoundPcmChannel_t channel, MMSoundPcmFormat_t format); + +/** + * This function start pcm capture + * + * @param handle [in] handle to start capture + * + * @return This function returns read data size on success, or negative value + * with error code. + * @remark + * @see + * @pre PCM capture handle should be allocated. + * @post PCM capture data will be buffered. + */ +int mm_sound_pcm_capture_start(MMSoundPcmHandle_t handle); + +/** + * This function stop pcm capture + * + * @param handle [in] handle to stop capture + * + * @return This function returns read data size on success, or negative value + * with error code. + * @remark + * @see + * @pre PCM capture handle should be allocated. + * @post PCM capture data will not be buffered. + */ +int mm_sound_pcm_capture_stop(MMSoundPcmHandle_t handle); + +/** + * This function captures PCM to memory buffer. (Samsung extension) + * + * @param handle [in] handle to play pcm data + * @param buffer [in] pcm buffer address + * @param length [in] size of pcm buffer (in bytes) + * + * @return This function returns read data size on success, or negative value + * with error code. + * @remark Make pcm buffer size with returned value of mm_sound_pcm_capture_open() + * @see mm_sound_pcm_capture_open, mm_sound_pcm_capture_close + * @pre PCM capture handle should be allcated. + * @post PCM data will be filled to given memory pointer. + * @par Example + * @code +#include +#include +#include + +int main(int argc, char* argv[]) +{ + FILE *fp = NULL; + char *buffer = NULL; + int ret = 0; + int size = 0; + int count = 0; + MMSoundPcmHandle_t handle; + char *filename = NULL; + + if(argc !=2 ) + { + printf("Usage) %s filename\n", argv[0]); + return -1; + } + filename = argv[1]; + + fp = fopen(filename,"w"); + if(fp ==NULL) + { + printf("Can not open file %s\n", filename); + return -1; + } + + size = mm_sound_pcm_capture_open(&handle, 44100, MMSOUND_PCM_MONO, MMSOUND_PCM_S16_LE); + if(size < 0) + { + printf("Can not open capture handle\n"); + return -2; + } + + buffer = alloca(size); + while(1) + { + ret = mm_sound_pcm_capture_read(handle, (void*)buffer, size); + if(ret < 0) + { + printf("read fail\n"); + break; + } + fwrite(buffer, ret, sizeof(char), fp); + if(count++ > 20) { + break; + } + } + + fclose(fp); + mm_sound_pcm_capture_close(handle); + return 0; +} + + * @endcode + */ +int mm_sound_pcm_capture_read(MMSoundPcmHandle_t handle, void *buffer, const unsigned int length ); + +/** + * This function captures PCM memory to memory buffer (Samsung extension) + * + * @param handle [in] handle to capture pcm data + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark None. + * @see mm_sound_pcm_capture_open, mm_sound_pcm_capture_read + * @pre PCM capture handle should be opend. + * @post PCM capture handle will be freed. + * @par Example + * @code +#include +#include +#include + +int main(int argc, char* argv[]) +{ + FILE *fp = NULL; + char *buffer = NULL; + int ret = 0; + int size = 0; + int count = 0; + MMSoundPcmHandle_t handle; + char *filename = NULL; + + if(argc !=2 ) + { + printf("Usage) %s filename\n", argv[0]); + return -1; + } + filename = argv[1]; + + fp = fopen(filename,"w"); + if(fp ==NULL) + { + printf("Can not open file %s\n", filename); + return -1; + } + + size = mm_sound_pcm_capture_open(&handle, 44100, MMSOUND_PCM_MONO, MMSOUND_PCM_S16_LE); + if(size < 0) + { + printf("Can not open capture handle\n"); + return -2; + } + + buffer = alloca(size); + while(1) + { + ret = mm_sound_pcm_capture_read(handle, (void*)buffer, size); + if(ret < 0) + { + printf("read fail\n"); + break; + } + fwrite(buffer, ret, sizeof(char), fp); + if(count++ > 20) { + break; + } + } + + fclose(fp); + mm_sound_pcm_capture_close(handle); + return 0; +} + + * @endcode + */ +int mm_sound_pcm_capture_close(MMSoundPcmHandle_t handle); + +/** + * This function sets callback function for receiving messages from pcm API. + * + * @param handle [in] Handle of pcm. + * @param callback [in] Message callback function. + * @param user_param [in] User parameter which is passed to callback function. + * + * @return This function returns MM_ERROR_NONE on success, or negative value with error code. + * @see MMMessageCallback + * @remark None + * @par Example + * @code +int msg_callback(int message, MMMessageParamType *param, void *user_param) +{ + switch (message) + { + case MM_MESSAGE_SOUND_PCM_CAPTURE_RESTRICTED: + //do something + break; + + case MM_MESSAGE_SOUND_PCM_INTERRUPTED: + //do something + break; + + default: + break; + } + return TRUE; +} + +mm_sound_pcm_set_message_callback(pcmHandle, msg_callback, (void *)pcmHandle); + * @endcode + */ +int mm_sound_pcm_set_message_callback (MMSoundPcmHandle_t handle, MMMessageCallback callback, void *user_param); + +/** + * Terminate callback function type. + * + * @param param [in] Argument passed when callback was set + * + * @return No return value + * @remark It is not allowed to call MMSound API recursively or do time-consuming + * task in this callback because this callback is called synchronously. + * @see mm_sound_play_sound + */ +typedef void (*mm_sound_stop_callback_func) (void *data); + +/* + * MMSound Play APIs + */ + +/** + * This function is to play system sound. + * + * @param filename [in] Sound filename to play + * @param volume config [in] Volume type & volume gain + * @param callback [in] Callback function pointer when playing is terminated. + * @param data [in] Pointer to user data when callback is called. + * @param handle [out] Handle of sound play. + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark When the stop callback is set, it will be called when system sound is + * terminated. If mm_sound_stop_sound() is called apparently before + * system sound is terminated, stop_callback will not be called. + * @see mm_sound_stop_sound mm_sound_stop_callback_func volume_type_t volume_gain_t + * @pre None. + * @post Sound will be generated with given filename. + * @par Example + * @code +int g_stop=0; +void _stop_callback(void* data) +{ + printf("Stop callback\n"); + g_stop = 1; +} + +int play_file() +{ + char filename[] ="/opt/media/Sound/testfile.wav"; + volume_type_t volume = VOLUME_TYPE_SYSTEM; + int ret = 0; + int handle = -1; + + ret = mm_sound_play_sound(filename, volume, _stop_callback, NULL, &handle); + if(ret < 0) + { + printf("play file failed\n"); + } + else + { + printf("play file success\n"); + } + while(g_stop == 0) + { + sleep(1); + } + printf("play stopped\n"); + return 0; +} + * @endcode + */ +int mm_sound_play_sound(const char *filename, int volume_config, mm_sound_stop_callback_func callback, void *data, int *handle); + +/** + * This function is to play system sound. And other audio stream will be mute during playing time + * + * @param filename [in] Sound filename to play + * @param volume config [in] Volume type & volume gain + * @param callback [in] Callback function pointer when playing is terminated. + * @param data [in] Pointer to user data when callback is called. + * @param handle [out] Handle of sound play. + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark This function is almost same with mm_sound_play_sound, + * but this make other audio playback stream to mute during playing time. + * @see mm_sound_stop_sound mm_sound_stop_callback_func volume_type_t volume_gain_t + * @pre None. + * @post Sound will be generated with given filename. + * @par Example + * @code +int g_stop=0; +void _stop_callback(void* data) +{ + printf("Stop callback\n"); + g_stop = 1; +} + +int play_file() +{ + char filename[] ="/opt/media/Sound/testfile.wav"; + volume_type_t volume = VOLUME_TYPE_SYSTEM; + int ret = 0; + int handle = -1; + + ret = mm_sound_play_loud_solo_sound(filename, volume, _stop_callback, NULL, &handle); + if(ret < 0) + { + printf("play file failed\n"); + } + else + { + printf("play file success\n"); + } + while(g_stop == 0) + { + sleep(1); + } + printf("play stopped\n"); + return 0; +} + * @endcode + */ +int mm_sound_play_loud_solo_sound(const char *filename, int volume_config, mm_sound_stop_callback_func callback, void *data, int *handle); + +int mm_sound_play_loud_solo_sound_no_restore(const char *filename, int volume_config, mm_sound_stop_callback_func callback, void *data, int *handle); + +/** + * This function is to stop playing system sound. + * + * @param handle [in] Handle of mm_sound_play_sound + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * + * @remark When system sound is terminated with this function call, it does not + * call stop callback which was set when start playing system sound. + * @see mm_sound_play_sound + * @pre An sound play handle should be valid. + * @post Playing sound file will be stopped. + * @par Example + * @code +int g_stop=0; +void _stop_callback(void* data) +{ + printf("Stop callback\n"); + g_stop = 1; +} + +int play_file_one_second() +{ + char filename[] ="/opt/media/Sound/testfile.wav"; + volume_type_t volume = VOLUME_TYPE_SYSTEM; + int ret = 0; + int handle = -1; + + ret = mm_sound_play_sound(filename, volume, _stop_callback, NULL, &handle); + if(ret < 0) + { + printf("play file failed\n"); + } + else + { + printf("play file success\n"); + } + + sleep(1); //wait 1 second + + ret = mm_sound_stop_sound(handle); + if(ret < 0) + { + printf("stop failed\n"); + } + else + { + printf("play stopped\n"); + } + return 0; +} + * @endcode + */ +int mm_sound_stop_sound(int handle); + + +/** + * Enumerations for TONE + */ + +typedef enum { + MM_SOUND_TONE_DTMF_0 = 0, /**< Predefined DTMF 0 */ + MM_SOUND_TONE_DTMF_1, /**< Predefined DTMF 1 */ + MM_SOUND_TONE_DTMF_2, /**< Predefined DTMF 2 */ + MM_SOUND_TONE_DTMF_3, /**< Predefined DTMF 3 */ + MM_SOUND_TONE_DTMF_4, /**< Predefined DTMF 4 */ + MM_SOUND_TONE_DTMF_5, /**< Predefined DTMF 5 */ + MM_SOUND_TONE_DTMF_6, /**< Predefined DTMF 6 */ + MM_SOUND_TONE_DTMF_7, /**< Predefined DTMF 7 */ + MM_SOUND_TONE_DTMF_8, /**< Predefined DTMF 8 */ + MM_SOUND_TONE_DTMF_9, /**< Predefined DTMF 9 */ + MM_SOUND_TONE_DTMF_S, /**< Predefined DTMF Star - Asterisk (*) */ + MM_SOUND_TONE_DTMF_P, /**< Predefined DTMF sharP (#) */ + MM_SOUND_TONE_DTMF_A, /**< Predefined DTMF A (A) */ + MM_SOUND_TONE_DTMF_B, /**< Predefined DTMF B (B) */ + MM_SOUND_TONE_DTMF_C, /**< Predefined DTMF C (C) */ + MM_SOUND_TONE_DTMF_D, /**< Predefined DTMF D (D) */ + + /**< Pre-defined TONE */ + MM_SOUND_TONE_SUP_DIAL, /**Call supervisory tone, Dial tone: CEPT: 425Hz, continuous */ + MM_SOUND_TONE_ANSI_DIAL, /**Call supervisory tone, Dial tone: ANSI (IS-95): 350Hz+440Hz, continuous */ + MM_SOUND_TONE_JAPAN_DIAL, /**Call supervisory tone, Dial tone: JAPAN: 400Hz, continuous*/ + MM_SOUND_TONE_SUP_BUSY, /**Call supervisory tone, Busy: CEPT: 425Hz, 500ms ON, 500ms OFF... */ + MM_SOUND_TONE_ANSI_BUSY, /**Call supervisory tone, Busy: ANSI (IS-95): 480Hz+620Hz, 500ms ON, 500ms OFF... */ + MM_SOUND_TONE_JAPAN_BUSY, /**Call supervisory tone, Busy: JAPAN: 400Hz, 500ms ON, 500ms OFF...*/ + MM_SOUND_TONE_SUP_CONGESTION, /**Call supervisory tone, Congestion: CEPT, JAPAN: 425Hz, 200ms ON, 200ms OFF */ + MM_SOUND_TONE_ANSI_CONGESTION, /**Call supervisory tone, Congestion: ANSI (IS-95): 480Hz+620Hz, 250ms ON, 250ms OFF... */ + MM_SOUND_TONE_SUP_RADIO_ACK, /**Call supervisory tone, Radio path acknowlegment : CEPT, ANSI: 425Hz, 200ms ON */ + MM_SOUND_TONE_JAPAN_RADIO_ACK, /**Call supervisory tone, Radio path acknowlegment : JAPAN: 400Hz, 1s ON, 2s OFF...*/ + MM_SOUND_TONE_SUP_RADIO_NOTAVAIL, /**Call supervisory tone, Radio path not available: 425Hz, 200ms ON, 200 OFF 3 bursts */ + MM_SOUND_TONE_SUP_ERROR, /**Call supervisory tone, Error/Special info: 950Hz+1400Hz+1800Hz, 330ms ON, 1s OFF... */ + MM_SOUND_TONE_SUP_CALL_WAITING, /**Call supervisory tone, Call Waiting: CEPT, JAPAN: 425Hz, 200ms ON, 600ms OFF, 200ms ON, 3s OFF... */ + MM_SOUND_TONE_ANSI_CALL_WAITING, /**Call supervisory tone, Call Waiting: ANSI (IS-95): 440 Hz, 300 ms ON, 9.7 s OFF, (100 ms ON, 100 ms OFF, 100 ms ON, 9.7s OFF ...) */ + MM_SOUND_TONE_SUP_RINGTONE, /**Call supervisory tone, Ring Tone: CEPT, JAPAN: 425Hz, 1s ON, 4s OFF... */ + MM_SOUND_TONE_ANSI_RINGTONE, /**Call supervisory tone, Ring Tone: ANSI (IS-95): 440Hz + 480Hz, 2s ON, 4s OFF... */ + MM_SOUND_TONE_PROP_BEEP, /**General beep: 400Hz+1200Hz, 35ms ON */ + MM_SOUND_TONE_PROP_ACK, /**Proprietary tone, positive acknowlegement: 1200Hz, 100ms ON, 100ms OFF 2 bursts */ + MM_SOUND_TONE_PROP_NACK, /**Proprietary tone, negative acknowlegement: 300Hz+400Hz+500Hz, 400ms ON */ + MM_SOUND_TONE_PROP_PROMPT, /**Proprietary tone, prompt tone: 400Hz+1200Hz, 200ms ON */ + MM_SOUND_TONE_PROP_BEEP2, /**Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON */ + MM_SOUND_TONE_SUP_INTERCEPT, /**Call supervisory tone (IS-95), intercept tone: alternating 440 Hz and 620 Hz tones, each on for 250 ms */ + MM_SOUND_TONE_SUP_INTERCEPT_ABBREV, /**Call supervisory tone (IS-95), abbreviated intercept: intercept tone limited to 4 seconds */ + MM_SOUND_TONE_SUP_CONGESTION_ABBREV, /**Call supervisory tone (IS-95), abbreviated congestion: congestion tone limited to 4 seconds */ + MM_SOUND_TONE_SUP_CONFIRM, /**Call supervisory tone (IS-95), confirm tone: a 350 Hz tone added to a 440 Hz tone repeated 3 times in a 100 ms on, 100 ms off cycle */ + MM_SOUND_TONE_SUP_PIP, /**Call supervisory tone (IS-95), pip tone: four bursts of 480 Hz tone (0.1 s on, 0.1 s off). */ + MM_SOUND_TONE_CDMA_DIAL_TONE_LITE, /**425Hz continuous */ + MM_SOUND_TONE_CDMA_NETWORK_USA_RINGBACK, /**CDMA USA Ringback: 440Hz+480Hz 2s ON, 4000 OFF ...*/ + MM_SOUND_TONE_CDMA_INTERCEPT, /**CDMA Intercept tone: 440Hz 250ms ON, 620Hz 250ms ON ...*/ + MM_SOUND_TONE_CDMA_ABBR_INTERCEPT, /**CDMA Abbr Intercept tone: 440Hz 250ms ON, 620Hz 250ms ON */ + MM_SOUND_TONE_CDMA_REORDER, /**CDMA Reorder tone: 480Hz+620Hz 250ms ON, 250ms OFF... */ + MM_SOUND_TONE_CDMA_ABBR_REORDER, /**CDMA Abbr Reorder tone: 480Hz+620Hz 250ms ON, 250ms OFF repeated for 8 times */ + MM_SOUND_TONE_CDMA_NETWORK_BUSY, /**CDMA Network Busy tone: 480Hz+620Hz 500ms ON, 500ms OFF continuous */ + MM_SOUND_TONE_CDMA_CONFIRM, /**CDMA Confirm tone: 350Hz+440Hz 100ms ON, 100ms OFF repeated for 3 times */ + MM_SOUND_TONE_CDMA_ANSWER, /**CDMA answer tone: silent tone - defintion Frequency 0, 0ms ON, 0ms OFF */ + MM_SOUND_TONE_CDMA_NETWORK_CALLWAITING, /**CDMA Network Callwaiting tone: 440Hz 300ms ON */ + MM_SOUND_TONE_CDMA_PIP, /**CDMA PIP tone: 480Hz 100ms ON, 100ms OFF repeated for 4 times */ + MM_SOUND_TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL, /**ISDN Call Signal Normal tone: {2091Hz 32ms ON, 2556 64ms ON} 20 times, 2091 32ms ON, 2556 48ms ON, 4s OFF */ + MM_SOUND_TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP, /**ISDN Call Signal Intergroup tone: {2091Hz 32ms ON, 2556 64ms ON} 8 times, 2091Hz 32ms ON, 400ms OFF, {2091Hz 32ms ON, 2556Hz 64ms ON} 8times, 2091Hz 32ms ON, 4s OFF.*/ + MM_SOUND_TONE_CDMA_CALL_SIGNAL_ISDN_SP_PRI, /**ISDN Call Signal SP PRI tone:{2091Hz 32ms ON, 2556 64ms ON} 4 times 2091Hz 16ms ON, 200ms OFF, {2091Hz 32ms ON, 2556Hz 64ms ON} 4 times, 2091Hz 16ms ON, 200ms OFF */ + MM_SOUND_TONE_CDMA_CALL_SIGNAL_ISDN_PAT3, /**SDN Call sign PAT3 tone: silent tone */ + MM_SOUND_TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING, /**ISDN Ping Ring tone: {2091Hz 32ms ON, 2556Hz 64ms ON} 5 times 2091Hz 20ms ON */ + MM_SOUND_TONE_CDMA_CALL_SIGNAL_ISDN_PAT5, /**ISDN Pat5 tone: silent tone */ + MM_SOUND_TONE_CDMA_CALL_SIGNAL_ISDN_PAT6, /**ISDN Pat6 tone: silent tone */ + MM_SOUND_TONE_CDMA_CALL_SIGNAL_ISDN_PAT7, /**ISDN Pat7 tone: silent tone */ + MM_SOUND_TONE_CDMA_HIGH_L, /**TONE_CDMA_HIGH_L tone: {3700Hz 25ms, 4000Hz 25ms} 40 times 4000ms OFF, Repeat .... */ + MM_SOUND_TONE_CDMA_MED_L, /**TONE_CDMA_MED_L tone: {2600Hz 25ms, 2900Hz 25ms} 40 times 4000ms OFF, Repeat .... */ + MM_SOUND_TONE_CDMA_LOW_L, /**TONE_CDMA_LOW_L tone: {1300Hz 25ms, 1450Hz 25ms} 40 times, 4000ms OFF, Repeat .... */ + MM_SOUND_TONE_CDMA_HIGH_SS, /**CDMA HIGH SS tone: {3700Hz 25ms, 4000Hz 25ms} repeat 16 times, 400ms OFF, repeat .... */ + MM_SOUND_TONE_CDMA_MED_SS, /**CDMA MED SS tone: {2600Hz 25ms, 2900Hz 25ms} repeat 16 times, 400ms OFF, repeat .... */ + MM_SOUND_TONE_CDMA_LOW_SS, /**CDMA LOW SS tone: {1300z 25ms, 1450Hz 25ms} repeat 16 times, 400ms OFF, repeat .... */ + MM_SOUND_TONE_CDMA_HIGH_SSL, /**CDMA HIGH SSL tone: {3700Hz 25ms, 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} repeat 8 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} repeat 16 times, 4000ms OFF, repeat ... */ + MM_SOUND_TONE_CDMA_MED_SSL, /**CDMA MED SSL tone: {2600Hz 25ms, 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} repeat 8 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} repeat 16 times, 4000ms OFF, repeat ... */ + MM_SOUND_TONE_CDMA_LOW_SSL, /**CDMA LOW SSL tone: {1300Hz 25ms, 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} repeat 8 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} repeat 16 times, 4000ms OFF, repeat ... */ + MM_SOUND_TONE_CDMA_HIGH_SS_2, /**CDMA HIGH SS2 tone: {3700Hz 25ms, 4000Hz 25ms} 20 times, 1000ms OFF, {3700Hz 25ms, 4000Hz 25ms} 20 times, 3000ms OFF, repeat .... */ + MM_SOUND_TONE_CDMA_MED_SS_2, /**CDMA MED SS2 tone: {2600Hz 25ms, 2900Hz 25ms} 20 times, 1000ms OFF, {2600Hz 25ms, 2900Hz 25ms} 20 times, 3000ms OFF, repeat .... */ + MM_SOUND_TONE_CDMA_LOW_SS_2, /**CDMA LOW SS2 tone: {1300Hz 25ms, 1450Hz 25ms} 20 times, 1000ms OFF, {1300Hz 25ms, 1450Hz 25ms} 20 times, 3000ms OFF, repeat .... */ + MM_SOUND_TONE_CDMA_HIGH_SLS, /**CDMA HIGH SLS tone: {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 20 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 3000ms OFF, REPEAT */ + MM_SOUND_TONE_CDMA_MED_SLS, /**CDMA MED SLS tone: {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 20 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 3000ms OFF, REPEAT */ + MM_SOUND_TONE_CDMA_LOW_SLS, /**CDMA LOW SLS tone: {1300Hz 25ms, 1450Hz 25ms} 10 times, 500ms OFF, {1300Hz 25ms, 1450Hz 25ms} 20 times, 500ms OFF, {1300Hz 25ms, 1450Hz 25ms} 10 times, 3000ms OFF, REPEAT */ + MM_SOUND_TONE_CDMA_HIGH_S_X4, /**CDMA HIGH S X4 tone: {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 2500ms OFF, REPEAT.... */ + MM_SOUND_TONE_CDMA_MED_S_X4, /**CDMA MED S X4 tone: {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 2500ms OFF, REPEAT.... */ + MM_SOUND_TONE_CDMA_LOW_S_X4, /**CDMA LOW S X4 tone: {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 2500ms OFF, REPEAT....*/ + MM_SOUND_TONE_CDMA_HIGH_PBX_L, /**CDMA HIGH PBX L: {3700Hz 25ms, 4000Hz 25ms}20 times, 2000ms OFF, REPEAT.... */ + MM_SOUND_TONE_CDMA_MED_PBX_L, /**CDMA MED PBX L: {2600Hz 25ms, 2900Hz 25ms}20 times, 2000ms OFF, REPEAT.... */ + MM_SOUND_TONE_CDMA_LOW_PBX_L, /**CDMA LOW PBX L: {1300Hz 25ms,1450Hz 25ms}20 times, 2000ms OFF, REPEAT.... */ + MM_SOUND_TONE_CDMA_HIGH_PBX_SS, /**CDMA HIGH PBX SS tone: {3700Hz 25ms, 4000Hz 25ms} 8 times 200 ms OFF, {3700Hz 25ms 4000Hz 25ms}8 times, 2000ms OFF, REPEAT.... */ + MM_SOUND_TONE_CDMA_MED_PBX_SS, /**CDMA MED PBX SS tone: {2600Hz 25ms, 2900Hz 25ms} 8 times 200 ms OFF, {2600Hz 25ms 2900Hz 25ms}8 times, 2000ms OFF, REPEAT.... */ + MM_SOUND_TONE_CDMA_LOW_PBX_SS, /**CDMA LOW PBX SS tone: {1300Hz 25ms, 1450Hz 25ms} 8 times 200 ms OFF, {1300Hz 25ms 1450Hz 25ms}8 times, 2000ms OFF, REPEAT.... */ + MM_SOUND_TONE_CDMA_HIGH_PBX_SSL, /**CDMA HIGH PBX SSL tone:{3700Hz 25ms, 4000Hz 25ms} 8 times 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 16 times, 1000ms OFF, REPEAT.... */ + MM_SOUND_TONE_CDMA_MED_PBX_SSL, /**CDMA MED PBX SSL tone:{2600Hz 25ms, 2900Hz 25ms} 8 times 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 16 times, 1000ms OFF, REPEAT.... */ + MM_SOUND_TONE_CDMA_LOW_PBX_SSL, /**CDMA LOW PBX SSL tone:{1300Hz 25ms, 1450Hz 25ms} 8 times 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 16 times, 1000ms OFF, REPEAT.... */ + MM_SOUND_TONE_CDMA_HIGH_PBX_SLS, /**CDMA HIGH PBX SLS tone:{3700Hz 25ms, 4000Hz 25ms} 8 times 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 16 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 8 times, 1000ms OFF, REPEAT.... */ + MM_SOUND_TONE_CDMA_MED_PBX_SLS, /**CDMA MED PBX SLS tone:{2600Hz 25ms, 2900Hz 25ms} 8 times 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 16 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 8 times, 1000ms OFF, REPEAT.... */ + MM_SOUND_TONE_CDMA_LOW_PBX_SLS, /**CDMA LOW PBX SLS tone:{1300Hz 25ms, 1450Hz 25ms} 8 times 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 16 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 8 times, 1000ms OFF, REPEAT.... */ + MM_SOUND_TONE_CDMA_HIGH_PBX_S_X4, /**CDMA HIGH PBX X S4 tone: {3700Hz 25ms 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms 4000Hz 25ms} 8 times, 800ms OFF, REPEAT... */ + MM_SOUND_TONE_CDMA_MED_PBX_S_X4, /**CDMA MED PBX X S4 tone: {2600Hz 25ms 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms 2900Hz 25ms} 8 times, 800ms OFF, REPEAT... */ + MM_SOUND_TONE_CDMA_LOW_PBX_S_X4, /**CDMA LOW PBX X S4 tone: {1300Hz 25ms 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms 1450Hz 25ms} 8 times, 800ms OFF, REPEAT... */ + MM_SOUND_TONE_CDMA_ALERT_NETWORK_LITE, /**CDMA Alert Network Lite tone: 1109Hz 62ms ON, 784Hz 62ms ON, 740Hz 62ms ON 622Hz 62ms ON, 1109Hz 62ms ON */ + MM_SOUND_TONE_CDMA_ALERT_AUTOREDIAL_LITE, /**CDMA Alert Auto Redial tone: {1245Hz 62ms ON, 659Hz 62ms ON} 3 times, 1245 62ms ON */ + MM_SOUND_TONE_CDMA_ONE_MIN_BEEP, /**CDMA One Min Beep tone: 1150Hz+770Hz 400ms ON */ + MM_SOUND_TONE_CDMA_KEYPAD_VOLUME_KEY_LITE, /**CDMA KEYPAD Volume key lite tone: 941Hz+1477Hz 120ms ON */ + MM_SOUND_TONE_CDMA_PRESSHOLDKEY_LITE, /**CDMA PRESSHOLDKEY LITE tone: 587Hz 375ms ON, 1175Hz 125ms ON */ + MM_SOUND_TONE_CDMA_ALERT_INCALL_LITE, /**CDMA ALERT INCALL LITE tone: 587Hz 62ms, 784 62ms, 831Hz 62ms, 784Hz 62ms, 1109 62ms, 784Hz 62ms, 831Hz 62ms, 784Hz 62ms*/ + MM_SOUND_TONE_CDMA_EMERGENCY_RINGBACK, /**CDMA EMERGENCY RINGBACK tone: {941Hz 125ms ON, 10ms OFF} 3times 4990ms OFF, REPEAT... */ + MM_SOUND_TONE_CDMA_ALERT_CALL_GUARD, /**CDMA ALERT CALL GUARD tone: {1319Hz 125ms ON, 125ms OFF} 3 times */ + MM_SOUND_TONE_CDMA_SOFT_ERROR_LITE, /**CDMA SOFT ERROR LITE tone: 1047Hz 125ms ON, 370Hz 125ms */ + MM_SOUND_TONE_CDMA_CALLDROP_LITE, /**CDMA CALLDROP LITE tone: 1480Hz 125ms, 1397Hz 125ms, 784Hz 125ms */ + MM_SOUND_TONE_CDMA_NETWORK_BUSY_ONE_SHOT, /**CDMA_NETWORK_BUSY_ONE_SHOT tone: 425Hz 500ms ON, 500ms OFF. */ + MM_SOUND_TONE_CDMA_ABBR_ALERT, /**CDMA_ABBR_ALERT tone: 1150Hz+770Hz 400ms ON */ + MM_SOUND_TONE_CDMA_SIGNAL_OFF, /**CDMA_SIGNAL_OFF - silent tone */ + MM_SOUND_TONE_NUM, +}MMSoundTone_t; + +typedef unsigned long sound_time_msec_t; /**< millisecond unit */ + +/** + * This function is to play tone sound. + * + * @param num [in] predefined tone type (MMSoundTone_t) + * volume config [in] volume type & volume gain + * volume [in] volume ratio (0.0 ~1.0) + * duration [in] millisecond (-1 for infinite) + * handle [in] Handle of mm_sound_play_tone + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * + * @remark It doesn't provide stop + * @see volume_type_t volume_gain_t MMSoundTone_t + * @pre None. + * @post TONE sound will be played. + * @par Example + * @code +int ret = 0; + +ret = mm_sound_play_tone(MM_SOUND_TONE_DTMF_9, VOLUME_TYPE_SYSTEM, 1.0, 1000, &handle); //play 1 second with volume ratio 1.0 +if(ret < 0) +{ + printf("play tone failed\n"); +} +else +{ + printf("play tone success\n"); +} + * @endcode + */ +int mm_sound_play_tone (MMSoundTone_t num, int volume_config, const double volume, const int duration, int *handle); + +/* + * Enumerations of System audio route policy + */ +typedef enum { + SYSTEM_AUDIO_ROUTE_POLICY_DEFAULT, /**< Play via a2dp headset if connected. or play via headset if connected. or play via speaker. + And capture via 4pole headset-mic if connected. or capture via mic */ + SYSTEM_AUDIO_ROUTE_POLICY_IGNORE_A2DP, /**< Play via headset if connected. or play via speaker + And capture via 4pole headset-mic if connected. or capture via mic */ + SYSTEM_AUDIO_ROUTE_POLICY_HANDSET_ONLY, /**< Play via speaker. and capture via mic */ + SYSTEM_AUDIO_ROUTE_POLICY_MAX +}system_audio_route_t; + +typedef enum { + SYSTEM_AUDIO_ROUTE_PLAYBACK_DEVICE_NONE, /**< Abnormal case */ + SYSTEM_AUDIO_ROUTE_PLAYBACK_DEVICE_HANDSET, /**< Speaker or Headset or Earpiece */ + SYSTEM_AUDIO_ROUTE_PLAYBACK_DEVICE_BLUETOOTH, /**< Bluetooth */ + SYSTEM_AUDIO_ROUTE_PLAYBACK_DEVICE_EARPHONE, /**< Earphone */ + SYSTEM_AUDIO_ROUTE_PLAYBACK_DEVICE_MAX, +}system_audio_route_device_t; + +typedef enum { + SYSTEM_AUDIO_CAPTURE_NONE, /**< Capture device is not in use */ + SYSTEM_AUDIO_CAPTURE_ACTIVE, /**< Capture device is in use */ + SYSTEM_AUDIO_CAPTURE_MAX, +}system_audio_capture_status_t; + + +/** + * This function set system route policy. + * + * @param route [in] audio route type + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark If bluetooth has disconnected during SYSTEM_AUDIO_ROUTE_POLICY_IGNORE_A2DP policy, + * The audio route policy will be changed to SYSTEM_AUDIO_ROUTE_POLICY_DEFAULT. + * @see mm_sound_route_get_system_policy system_audio_route_t mm_sound_route_is_a2dp_on + * @pre None. + * @post Audio routing policy will be changed with given type. And route change callback function will be called if registered. + * @par Example + * @code +int g_stop = 0; +void _stop_callback() +{ + g_stop = 1; +} + +int play_file_via_speaker() +{ + int ret = 0; + system_audio_route_t route, original_route; + + //get backup current policy + ret = mm_sound_route_get_system_policy(&original_route); + if(ret < 0) + { + printf("Can not get system audio route policy\n"); + } + else + { + //set route policy to ignore a2dp + route = SYSTEM_AUDIO_ROUTE_POLICY_IGNORE_A2DP; + ret = mm_sound_route_set_system_policy(route); + if(ret < 0) + { + printf("Ca not set route policy\n"); + } + else + { + int handle; + //play wav file + ret = mm_sound_play_sound("/opt/media/Sound/alert.wav", VOLUME_TYPE_SYSTEM, NULL, NULL, &handle); + if(ret < 0) + { + printf("Can not play wav file\n"); + } + else + { + while(g_stop == 0) + { + sleep(1); + } + //restore original policy + mm_sound_route_set_system_policy(original_route); + } + } + } + return 0; +} + * @endcode + */ +int mm_sound_route_set_system_policy (system_audio_route_t route); + +/** + * This function get sysytem route policy. + * + * @param route [out] audio route type + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark None. + * @see mm_sound_route_set_system_policy system_audio_route_t mm_sound_route_is_a2dp_on + * @pre None. + * @post None. + * @par Example + * @code +int g_stop = 0; +void _stop_callback() +{ + g_stop = 1; +} + +int play_file_via_speaker() +{ + int ret = 0; + system_audio_route_t route, original_route; + + //get backup current policy + ret = mm_sound_route_get_system_policy(&original_route); + if(ret < 0) + { + printf("Can not get system audio route policy\n"); + } + else + { + //set route policy to ignore a2dp + route = SYSTEM_AUDIO_ROUTE_POLICY_IGNORE_A2DP; + ret = mm_sound_route_set_system_policy(route); + if(ret < 0) + { + printf("Can not set route policy\n"); + } + else + { + int handle; + //play wav file + ret = mm_sound_play_sound("/opt/media/Sound/alert.wav", VOLUME_TYPE_SYSTEM, NULL, NULL, &handle); + if(ret < 0) + { + printf("Can not play wav file\n"); + } + else + { + while(g_stop == 0) + { + sleep(1); + } + //restore original policy + mm_sound_route_set_system_policy(original_route); + } + } + } + return 0; +} + * @endcode + */ +int mm_sound_route_get_system_policy (system_audio_route_t *route); + + + +/** + * This function get a2dp activation information. + * + * @param connected [out] is Bluetooth A2DP connected (1:connected, 0:not connected) + * bt_name [out] Bluetooth A2DP connected device name (allocated by internal when connected=1 otherwise set to null) + * + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark This function allocation memory to given bt_name pointer internally. + * So application should free given memory pointer later after use. + * bt_name will be null if there's no a2dp device is connected (connected is 0) + * @see mm_sound_route_set_system_policy mm_sound_route_get_system_policy + * @pre None. + * @post memory buffer will be allocated and fill with bluetooth device name. + * @par Example + * @code +int ret; +int connected = 0; +char* bt_name = NULL; +ret = mm_sound_route_get_a2dp_status (&connected, &bt_name); + +if (ret == MM_ERROR_NONE) { + g_print ("### Is Bluetooth A2DP On Success : connected=[%d] name=[%s]\n", connected, bt_name); + if (bt_name) + free (bt_name); +} else { + g_print ("### Is Bluetooth A2DP On Error : errno [%d]\n", ret); + + * @endcode + */ +int mm_sound_route_get_a2dp_status (bool* connected, char** bt_name); + + +/** + * This function get current playing device. + * + * @param dev [out] current playing device information + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark if there is no running instance in system, + * output parameter dev can be SYSTEM_AUDIO_ROUTE_PLAYING_DEVICE_NONE. + * + * @see system_audio_route_device_t + * @pre None. + * @post None. + * @par Example + * @code +int ret = 0; +system_audio_route_device_t dev; + +ret = mm_sound_route_get_playing_device (&dev); +if(ret == MM_ERROR_NONE) +{ + switch(dev) + { + case SYSTEM_AUDIO_ROUTE_PLAYBACK_DEVICE_HANDSET: + printf("Handset is playing\n"); + break; + case SYSTEM_AUDIO_ROUTE_PLAYBACK_DEVICE_BLUETOOTH: + printf("Bluetooth is playing\n"); + break; + case SYSTEM_AUDIO_ROUTE_PLAYBACK_DEVICE_NONE: + default: + printf("Unexptected\n"); + break; + } +} +else +{ + printf ("Can not get current running device\n"); +} + + * @endcode + */ +int mm_sound_route_get_playing_device(system_audio_route_device_t *dev); + + +/** + * Audio route policy change callback function type. + * + * @param user_data [in] Argument passed when callback has called + * @param policy [in] changed policy type + * + * @return No return value + * @remark + * @see mm_sound_volume_add_callback mm_sound_volume_remove_callback + */ +typedef void (*audio_route_policy_changed_callback_fn)(void* user_data, system_audio_route_t policy); + +/** + * This function set system audio policy changed callback function. + * + * @param func [in] callback function pointer + * @param user_data [in] user data will be called with func + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark None. + * @see mm_sound_route_remove_change_callback mm_sound_route_set_system_policy mm_sound_route_get_system_policy system_audio_route_t + * @pre None. + * @post None. + * @par Example + * @code +void audio_route_policy_changed_callback(void* data, system_audio_route_t policy) +{ + int value = (int) data; + system_audio_route_t lv_policy; + char *str_route[SYSTEM_AUDIO_ROUTE_POLICY_MAX] = { + "DEFAULT","IGN_A2DP","HANDSET" + }; + printf("Audio Route Policy has changed to [%s]\n", str_route[policy]); + printf("user data : %d\n", value); + if(0 > mm_sound_route_get_system_policy(&lv_policy)) { + printf("Can not get policy...in callback function\n"); + } + else { + printf("readed policy [%s]\n", str_route[lv_policy]); + } +} +int make_callback() +{ + int ret = 0; + ret = mm_sound_route_add_change_callback(audio_route_policy_changed_callback, (void*)111); + if(ret < 0) + { + printf("Can not add callback\n"); + } + return 0; +} + * @endcode + */ +int mm_sound_route_add_change_callback(audio_route_policy_changed_callback_fn func, void* user_data); + +/** + * This function remove system audio policy changed callback function. + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark None. + * @see mm_sound_route_add_change_callback mm_sound_route_set_system_policy mm_sound_route_get_system_policy system_audio_route_t + * @pre Sound route change callback should be registered. + * @post Sound route change callback deregistered and does not be called anymore. + * @par Example + * @code +void audio_route_policy_changed_callback(void* data, system_audio_route_t policy) +{ + int value = (int) data; + system_audio_route_t lv_policy; + char *str_route[SYSTEM_AUDIO_ROUTE_POLICY_MAX] = { + "DEFAULT","IGN_A2DP","HANDSET" + }; + printf("Audio Route Policy has changed to [%s]\n", str_route[policy]); + printf("user data : %d\n", value); + if(0 > mm_sound_route_get_system_policy(&lv_policy)) { + printf("Can not get policy...in callback function\n"); + } + else { + printf("readed policy [%s]\n", str_route[lv_policy]); + } +} +int make_callback() +{ + int ret = 0; + ret = mm_sound_route_add_change_callback(audio_route_policy_changed_callback, (void*)111); + if(ret < 0) + { + printf("Can not add callback\n"); + } + else + { + ret = mm_sound_route_remove_change_callback(); + if(ret < 0) + { + printf("Can not remove callback\n"); + } + } + return 0; +} + * @endcode + */ +int mm_sound_route_remove_change_callback(void); + +/* + * Enumerations of device & route + */ + +typedef enum{ + MM_SOUND_DEVICE_IN_NONE = 0x00, + MM_SOUND_DEVICE_IN_MIC = 0x01, /**< Device builtin mic. */ + MM_SOUND_DEVICE_IN_WIRED_ACCESSORY = 0x02, /**< Wired input devices */ + MM_SOUND_DEVICE_IN_BT_SCO = 0x04, /**< Bluetooth SCO device */ +} mm_sound_device_in; + +typedef enum{ + MM_SOUND_DEVICE_OUT_NONE = 0x000, + MM_SOUND_DEVICE_OUT_SPEAKER = 0x001<<8, /**< Device builtin speaker */ + MM_SOUND_DEVICE_OUT_RECEIVER = 0x002<<8, /**< Device builtin receiver */ + MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY = 0x004<<8, /**< Wired output devices such as headphone, headset, and so on. */ + MM_SOUND_DEVICE_OUT_BT_SCO = 0x008<<8, /**< Bluetooth SCO device */ + MM_SOUND_DEVICE_OUT_BT_A2DP = 0x010<<8, /**< Bluetooth A2DP device */ + MM_SOUND_DEVICE_OUT_DOCK = 0x020<<8, /**< DOCK device */ + MM_SOUND_DEVICE_OUT_HDMI = 0x040<<8, /**< HDMI device */ + MM_SOUND_DEVICE_OUT_WFD = 0x080<<8, /**< WFD device */ + MM_SOUND_DEVICE_OUT_USB_AUDIO = 0x100<<8, /**< USB Audio device */ +} mm_sound_device_out; + +#define MM_SOUND_ROUTE_NUM 14 + +typedef enum{ + MM_SOUND_ROUTE_OUT_SPEAKER = MM_SOUND_DEVICE_OUT_SPEAKER, /**< Routing audio output to builtin device such as internal speaker. */ + MM_SOUND_ROUTE_OUT_WIRED_ACCESSORY = MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY,/**< Routing audio output to wired accessory such as headphone, headset, and so on. */ + MM_SOUND_ROUTE_OUT_BLUETOOTH = MM_SOUND_DEVICE_OUT_BT_A2DP, /**< Routing audio output to bluetooth A2DP. */ + MM_SOUND_ROUTE_OUT_DOCK = MM_SOUND_DEVICE_OUT_DOCK, /**< Routing audio output to DOCK */ + MM_SOUND_ROUTE_OUT_HDMI = MM_SOUND_DEVICE_OUT_HDMI, /**< Routing audio output to HDMI */ + MM_SOUND_ROUTE_OUT_WFD = MM_SOUND_DEVICE_OUT_WFD, /**< Routing audio output to WFD */ + MM_SOUND_ROUTE_OUT_USB_AUDIO = MM_SOUND_DEVICE_OUT_USB_AUDIO, /**< Routing audio output to USB Audio */ + MM_SOUND_ROUTE_IN_MIC = MM_SOUND_DEVICE_IN_MIC, /**< Routing audio input to device builtin mic. */ + MM_SOUND_ROUTE_IN_WIRED_ACCESSORY = MM_SOUND_DEVICE_IN_WIRED_ACCESSORY, /**< Routing audio input to wired accessory. */ + MM_SOUND_ROUTE_IN_MIC_OUT_RECEIVER = MM_SOUND_DEVICE_IN_MIC | MM_SOUND_DEVICE_OUT_RECEIVER, /**< Routing audio input to device builtin mic and routing audio output to builtin receiver*/ + MM_SOUND_ROUTE_IN_MIC_OUT_SPEAKER = MM_SOUND_DEVICE_IN_MIC | MM_SOUND_DEVICE_OUT_SPEAKER , /**< Routing audio input to device builtin mic and routing audio output to builtin speaker */ + MM_SOUND_ROUTE_IN_MIC_OUT_HEADPHONE = MM_SOUND_DEVICE_IN_MIC | MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY,/**< Routing audio input to device builtin mic and routing audio output to headphone */ + MM_SOUND_ROUTE_INOUT_HEADSET = MM_SOUND_DEVICE_IN_WIRED_ACCESSORY | MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY, /**< Routing audio input and output to headset*/ + MM_SOUND_ROUTE_INOUT_BLUETOOTH = MM_SOUND_DEVICE_IN_BT_SCO | MM_SOUND_DEVICE_OUT_BT_SCO /**< Routing audio input and output to bluetooth SCO */ +} mm_sound_route; + +typedef int (*mm_sound_available_route_cb)(mm_sound_route route, void *user_data); + +int mm_sound_is_route_available(mm_sound_route route, bool *is_available); + +int mm_sound_foreach_available_route_cb(mm_sound_available_route_cb, void *user_data); + +int mm_sound_set_active_route(mm_sound_route route); + +/** + * This function is to get active playback device and capture device. + * + * @param playback_device [out] playback device. + * @param capture_device [out] capture device. + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark None. + * @pre None. + * @post None. + * @see mm_sound_set_active_route mm_sound_device_in mm_sound_device_out + */ +int mm_sound_get_active_device(mm_sound_device_in *device_in, mm_sound_device_out *device_out); + +/** + * Active device changed callback function type. + * + * @param user_data [in] Argument passed when callback has called + * + * @return No return value + * @remark None. + * @see mm_sound_add_active_device_changed_callback mm_sound_remove_active_device_changed_callback + */ +typedef void (*mm_sound_active_device_changed_cb) (mm_sound_device_in device_in, mm_sound_device_out device_out, void *user_data); + +/** + * This function is to add active device callback. + * + * @param func [in] callback function pointer + * @param user_data [in] user data passing to callback function + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark None. + * @see mm_sound_remove_active_device_changed_callback mm_sound_active_device_changed_cb + * @pre None. + * @post None. + * @par Example + * @code + +void __active_device_callback(void *user_data) +{ + printf("Callback function\n"); +} + +int active_device_control() +{ + int ret = 0; + + ret = mm_sound_add_active_device_changed_callback(__active_device_callback, NULL); + if ( MM_ERROR_NONE != ret) + { + printf("Can not add callback\n"); + } + else + { + printf("Add callback success\n"); + } + + return ret; +} + + * @endcode + */ +int mm_sound_add_active_device_changed_callback(mm_sound_active_device_changed_cb func, void *user_data); + +/** + * This function is to remove active device callback. + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark None. + * @pre Active device callback should be registered. + * @post Active device callback deregistered and does not be called anymore. + * @see mm_sound_add_active_device_changed_callback mm_sound_active_device_changed_cb + * @par Example + * @code +void __active_device_callback(void *data) +{ + printf("Callback function\n"); +} + +int active_device_control() +{ + int ret = 0; + + mm_sound_add_active_device_changed_callback(__active_device_callback, NULL); + + ret = mm_sound_remove_active_device_changed_callback(); + if ( MM_ERROR_NONE == ret) + { + printf("Remove callback success\n"); + } + else + { + printf("Remove callback failed\n"); + } + + return ret; +} + + * @endcode + */ +int mm_sound_remove_active_device_changed_callback(void); + +/** + * Available route changed callback function type. + * + * @param user_data [in] Argument passed when callback has called + * + * @return No return value + * @remark None. + * @see mm_sound_add_active_device_changed_callback mm_sound_remove_active_device_changed_callback + */ +typedef void (*mm_sound_available_route_changed_cb) (mm_sound_route route, bool available, void *user_data); + +/** + * This function is to add available device callback. + * + * @param func [in] callback function pointer + * @param user_data [in] user data passing to callback function + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark None. + * @see mm_sound_remove_available_route_changed_callback mm_sound_active_device_changed_cb + * @pre None. + * @post None. + * @par Example + * @code + +void __available_device_callback(void *user_data) +{ + printf("Callback function\n"); +} + +int available_device_control() +{ + int ret = 0; + + ret = mm_sound_add_available_route_changed_callback(__available_device_callback, NULL); + if ( MM_ERROR_NONE != ret) + { + printf("Can not add callback\n"); + } + else + { + printf("Add callback success\n"); + } + + return ret; +} + + * @endcode + */ +int mm_sound_add_available_route_changed_callback(mm_sound_available_route_changed_cb func, void *user_data); + +/** + * This function is to remove available device callback. + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark None. + * @pre available device callback should be registered. + * @post available device callback deregistered and does not be called anymore. + * @see mm_sound_add_available_route_changed_callback mm_sound_active_device_changed_cb + * @par Example + * @code +void __available_device_callback(void *data) +{ + printf("Callback function\n"); +} + +int available_device_control() +{ + int ret = 0; + + mm_sound_add_available_route_changed_callback(__available_device_callback, NULL); + + ret = mm_sound_remove_available_route_changed_callback(); + if ( MM_ERROR_NONE == ret) + { + printf("Remove callback success\n"); + } + else + { + printf("Remove callback failed\n"); + } + + return ret; +} + + * @endcode + */ +int mm_sound_remove_available_route_changed_callback(void); +/** + @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __MM_SOUND_H__ */ + diff --git a/include/mm_sound_client.h b/include/mm_sound_client.h new file mode 100644 index 0000000..e29044e --- /dev/null +++ b/include/mm_sound_client.h @@ -0,0 +1,46 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __MM_SOUND_CLIENT_H__ +#define __MM_SOUND_CLIENT_H__ + +#include "mm_sound_private.h" + +//#define MEMTYPE_TRANS_PER_MAX (1024 * 1024) /* 1MB */ + +int MMSoundClientInit(void); +int MMSoundClientCallbackFini(void); +int MMSoundClientPlayTone(int number, int volume_config, double volume, int time, int *handle); +int MMSoundClientPlaySound(MMSoundPlayParam *param, int tone, int keytone, int *handle); +int MMSoundClientStopSound(int handle); +int _mm_sound_client_is_route_available(mm_sound_route route, bool *is_available); +int _mm_sound_client_foreach_available_route_cb(mm_sound_available_route_cb, void *user_data); +int _mm_sound_client_set_active_route(mm_sound_route route); +int _mm_sound_client_get_active_device(mm_sound_device_in *device_in, mm_sound_device_out *device_out); +int _mm_sound_client_add_active_device_changed_callback(mm_sound_active_device_changed_cb func, void* user_data); +int _mm_sound_client_remove_active_device_changed_callback(void); +int _mm_sound_client_add_available_route_changed_callback(mm_sound_available_route_changed_cb func, void* user_data); +int _mm_sound_client_remove_available_route_changed_callback(void); +#ifdef PULSE_CLIENT +int MMSoundClientIsBtA2dpOn (bool *connected, char** bt_name); +#endif + +#endif /* __MM_SOUND_CLIENT_H__ */ diff --git a/include/mm_sound_common.h b/include/mm_sound_common.h new file mode 100644 index 0000000..84d9d27 --- /dev/null +++ b/include/mm_sound_common.h @@ -0,0 +1,83 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __MM_SOUND_COMMON_H__ +#define __MM_SOUND_COMMON_H__ + +/////////////////////////////////// +//// MMSOUND VOLUME APIs +/////////////////////////////////// +#define VCONF_KEY_VOLUME_PREFIX "file/private/sound/volume" +#define VCONF_KEY_VOLUME_TYPE_SYSTEM VCONF_KEY_VOLUME_PREFIX"/system" +#define VCONF_KEY_VOLUME_TYPE_NOTIFICATION VCONF_KEY_VOLUME_PREFIX"/notification" +#define VCONF_KEY_VOLUME_TYPE_ALARM VCONF_KEY_VOLUME_PREFIX"/alarm" +#define VCONF_KEY_VOLUME_TYPE_RINGTONE VCONF_KEY_VOLUME_PREFIX"/ringtone" +#define VCONF_KEY_VOLUME_TYPE_MEDIA VCONF_KEY_VOLUME_PREFIX"/media" +#define VCONF_KEY_VOLUME_TYPE_CALL VCONF_KEY_VOLUME_PREFIX"/call" +#define VCONF_KEY_VOLUME_TYPE_VOIP VCONF_KEY_VOLUME_PREFIX"/voip" +#define VCONF_KEY_VOLUME_TYPE_ANDROID VCONF_KEY_VOLUME_PREFIX"/fixed" +#define VCONF_KEY_VOLUME_TYPE_JAVA VCONF_KEY_VOLUME_PREFIX"/java" + +#define ASM_READY_KEY "memory/Sound/ASMReady" + +#define MMSOUND_ENTER_CRITICAL_SECTION(x_mutex) \ +switch ( pthread_mutex_lock( x_mutex ) ) \ +{ \ +case EINVAL: \ + debug_warning("try mutex init..\n"); \ + if( 0 > pthread_mutex_init( x_mutex, NULL) ) { \ + return; \ + } else { \ + break; \ + } \ + return; \ +case 0: \ + break; \ +default: \ + debug_error("mutex lock failed\n"); \ + return; \ +} + +#define MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(x_mutex,x_return) \ +switch ( pthread_mutex_lock( x_mutex ) ) \ +{ \ +case EINVAL: \ + debug_warning("try mutex init..\n"); \ + if( 0 > pthread_mutex_init( x_mutex, NULL) ) { \ + return x_return; \ + } else { \ + break; \ + } \ + return x_return; \ +case 0: \ + break; \ +default: \ + debug_error("mutex lock failed\n"); \ + return x_return; \ +} + +#define MMSOUND_LEAVE_CRITICAL_SECTION(x_mutex) \ +if( pthread_mutex_unlock( x_mutex ) ) { \ + debug_error("mutex unlock failed\n"); \ +} + +#endif /* __MM_SOUND_COMMON_H__ */ + diff --git a/include/mm_sound_msg.h b/include/mm_sound_msg.h new file mode 100644 index 0000000..e98bf28 --- /dev/null +++ b/include/mm_sound_msg.h @@ -0,0 +1,80 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __MM_SOUND_MSG_H__ +#define __MM_SOUND_MSG_H__ + +#include +#include +#include + +#define KEY_BASE_PATH "/tmp" +#define RCV_MSG 0x21 /* rcv key */ +#define SND_MSG 0x24 /* snd key */ +#define CB_MSG 0x64 /* cb key */ + +#define MEMTYPE_SUPPORT_MAX (1024 * 1024) /* 1MB */ + +enum { + MM_SOUND_MSG_REQ_FILE = 1, + MM_SOUND_MSG_REQ_MEMORY = 2, + MM_SOUND_MSG_REQ_STOP = 3, + MM_SOUND_MSG_RES_FILE = 4, + MM_SOUND_MSG_RES_MEMORY = 5, + MM_SOUND_MSG_RES_STOP = 6, + MM_SOUND_MSG_INF_STOP_CB = 7, + MM_SOUND_MSG_RES_ERROR = 8, + MM_SOUND_MSG_INF_DESTROY_CB = 9, +#ifdef PULSE_CLIENT + MM_SOUND_MSG_REQ_GET_AUDIO_ROUTE = 16, + MM_SOUND_MSG_RES_GET_AUDIO_ROUTE = 17, + MM_SOUND_MSG_REQ_SET_AUDIO_ROUTE = 18, + MM_SOUND_MSG_RES_SET_AUDIO_ROUTE = 19, +#endif // PULSE_CLIENT + MM_SOUND_MSG_REQ_IS_BT_A2DP_ON = 20, + MM_SOUND_MSG_RES_IS_BT_A2DP_ON = 21, + MM_SOUND_MSG_REQ_DTMF = 22, + MM_SOUND_MSG_RES_DTMF = 23, + MM_SOUND_MSG_REQ_IS_ROUTE_AVAILABLE, + MM_SOUND_MSG_RES_IS_ROUTE_AVAILABLE, + MM_SOUND_MSG_REQ_FOREACH_AVAILABLE_ROUTE_CB, + MM_SOUND_MSG_RES_FOREACH_AVAILABLE_ROUTE_CB, + MM_SOUND_MSG_INF_FOREACH_AVAILABLE_ROUTE_CB, + MM_SOUND_MSG_REQ_SET_ACTIVE_ROUTE, + MM_SOUND_MSG_RES_SET_ACTIVE_ROUTE, + MM_SOUND_MSG_REQ_GET_ACTIVE_DEVICE, + MM_SOUND_MSG_RES_GET_ACTIVE_DEVICE, + MM_SOUND_MSG_REQ_ADD_ACTIVE_DEVICE_CB, + MM_SOUND_MSG_RES_ADD_ACTIVE_DEVICE_CB, + MM_SOUND_MSG_REQ_REMOVE_ACTIVE_DEVICE_CB, + MM_SOUND_MSG_RES_REMOVE_ACTIVE_DEVICE_CB, + MM_SOUND_MSG_INF_ACTIVE_DEVICE_CB, + MM_SOUND_MSG_REQ_ADD_AVAILABLE_ROUTE_CB, + MM_SOUND_MSG_RES_ADD_AVAILABLE_ROUTE_CB, + MM_SOUND_MSG_REQ_REMOVE_AVAILABLE_ROUTE_CB, + MM_SOUND_MSG_RES_REMOVE_AVAILABLE_ROUTE_CB, + MM_SOUND_MSG_INF_AVAILABLE_ROUTE_CB, +}; + +#define DSIZE sizeof(mm_ipc_msg_t)-sizeof(long) /* data size for rcv & snd */ + +#endif /* __MM_SOUND_MSG_H__ */ + diff --git a/include/mm_sound_private.h b/include/mm_sound_private.h new file mode 100644 index 0000000..760ce70 --- /dev/null +++ b/include/mm_sound_private.h @@ -0,0 +1,211 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/** + * @file mm_sound.h + * @brief Application interface library for sound module. + * @date + * @version Release + * + * Application interface library for sound module. + */ + +#ifndef __MM_SOUND_PRIVATE_H__ +#define __MM_SOUND_PRIVATE_H__ + +#include +#include +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + @internal + @addtogroup SOUND_PRIVATE + @{ + + */ + +#define MM_SOUND_VOLUME_CONFIG_TYPE(vol) (vol && 0x00FF) +#define MM_SOUND_VOLUME_CONFIG_GAIN(vol) (vol && 0xFF00) + +enum MMSoundGainType { + MM_SOUND_GAIN_KEYTONE = 0, /**< hw gain configuration for keytone play */ + MM_SOUND_GAIN_RINGTONE, /**< hw gain configuration for ringtone play */ + MM_SOUND_GAIN_ALARMTONE, /**< hw gain configuration for alarmtone play */ + MM_SOUND_GAIN_CALLTONE, /**< hw gain configuration for calltone play */ + MM_SOUND_GAIN_AUDIOPLAYER, /**< hw gain configuration for music play */ + MM_SOUND_GAIN_VIDEOPLAYER, /**< hw gain configuration for video play */ + MM_SOUND_GAIN_VOICECALL, /**< hw gain configuration for voice call */ + MM_SOUND_GAIN_VIDEOCALL, /**< hw gain configuration for video call */ + MM_SOUND_GAIN_FMRADIO, /**< hw gain configuration for fm radio play */ + MM_SOUND_GAIN_VOICEREC, /**< hw gain configuration for voice recording */ + MM_SOUND_GAIN_CAMCORDER, /**< hw gain configuration for camcording */ + MM_SOUND_GAIN_CAMERA, /**< hw gain configuration for camera shutter sound */ + MM_SOUND_GAIN_GAME, /**< hw gain configuration for game play */ + MM_SOUND_GAIN_CNT, /**< hw gain configuration count */ + MM_SOUND_GAIN_MUSIC = MM_SOUND_GAIN_AUDIOPLAYER, /**< remained for legacy application */ + MM_SOUND_GAIN_VIDEO, /**< remained for legacy application */ + MM_SOUND_GAIN_NONE = MM_SOUND_GAIN_KEYTONE, /**< remained for legacy application */ +}; + +/** + * Enumerations for sound path + */ +enum MMSoundPathExType { + MM_SOUND_PATH_NONE = 0, /**< no route path */ + MM_SOUND_PATH_SPK, /**< sound route to speaker */ + MM_SOUND_PATH_RECV, /**< sound route to receiver */ + MM_SOUND_PATH_HEADSET, /**< sound route to headset */ + MM_SOUND_PATH_BTHEADSET, /**< sound route to bluetooth headset */ + MM_SOUND_PATH_A2DP, /**< not used */ + MM_SOUND_PATH_HANDSFREE, /**< not used */ + MM_SOUND_PATH_HDMI, /**< not used */ + MM_SOUND_PATH_OUTMAX, /**< output route count */ + MM_SOUND_PATH_MIC = 1, /**< sound route from microphone */ + MM_SOUND_PATH_HEADSETMIC, /**< sound route from headset microphone */ + MM_SOUND_PATH_BTMIC, /**< sound route from bluetooth microphone */ + MM_SOUND_PATH_FMINPUT, /**< sound route from FM radio module */ + MM_SOUND_PATH_HANDSFREEMIC, /**< not used */ + MM_SOUND_PATH_INMAX, /**< input route count */ +}; + +/** + * Enumerations for sound path option + */ +enum MMSoundPathOptionType { + MM_SOUND_PATH_OPTION_NONE = 0x00000000, /**< no sound path option */ + MM_SOUND_PATH_OPTION_AUTO_HEADSET_CONTROL = 0x00000001, /**< automatic sound path change by earphone event */ + MM_SOUND_PATH_OPTION_SPEAKER_WITH_HEADSET = 0x00000002, /**< play sound via speaker and earphone (if inserted) */ + MM_SOUND_PATH_OPTION_VOICECALL_REC = 0x00000010, /**< voice call recording option */ + MM_SOUND_PATH_OPTION_USE_SUB_MIC = 0x00000020, /**< use sub-mic on call and recording */ +}; + + +enum mm_sound_handle_route_t { + MM_SOUND_HANDLE_ROUTE_USING_CURRENT, + MM_SOUND_HANDLE_ROUTE_SPEAKER, + MM_SOUND_HANDLE_ROUTE_SPEAKER_NO_RESTORE +}; + +typedef struct { + const char *filename; /**< filename to play */ + int volume; /**< relative volume level */ + int loop; /**< loop count */ + mm_sound_stop_callback_func callback; /**< callback function when playing is terminated */ + void *data; /**< user data to callback */ + void *mem_ptr; /**< memory buffer to play */ + int mem_size; /**< size of memory buffer */ + int handle_route; /**< 1 for speaker, 0 for current */ + int volume_config; /**< volume type & volume gain */ + int priority; /**< 0 or 1 */ +} MMSoundPlayParam; + + +/** + * This function is to play system sound with specified parameters. + * + * @param param [in] Reference pointer to MMSoundPlayParam structure + * @param handle [out] Handle of sound play. + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark When the stop callback is set, it will be called when system sound is + * terminated. If mm_sound_stop_sound() is called apparently before + * system sound is terminated, stop_callback will not be called. + * This function can use various sound route path with mm_sound_set_path + * @see mm_sound_stop_sound mm_sound_set_path + * @since R1, 1.0 + * @limo + */ +int mm_sound_play_sound_ex(MMSoundPlayParam *param, int *handle); + + +/** + * This function is to play key sound. + * + * @param filename [in] keytone filename to play + * @param volume_config [in] Volume type & volume gain + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * + * @remark This function provide low latency sound play (such as dialer keytone) + * using fixed spec of wave file (44100Hz, mono channel) + * @see volume_type_t volume_gain_t mm_sound_volume_set_value + */ +int mm_sound_play_keysound(const char *filename, int volume_config); + + +/** + * This function is to set sound device path. + * + * @param gain [in] sound path gain + * @param output [in] sound path out device + * @param input [in] sound path in device + * @param option [in] Sound path option + * MM_SOUND_PATH_OPTION_NONE + * MM_SOUND_PATH_OPTION_AUTO_HEADSET_CONTROL + * MM_SOUND_PATH_OPTION_SPEAKER_WITH_HEADSET + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark + * @see mm_sound_get_path + * @since 1.0 + */ +int mm_sound_set_path(int gain, int output, int input, int option); + + +/** + * This function retreives current sound device path. + * + * @param gain [out] Sound device path + * @param output [out] Sound output device on/off + * @param input [out] Sound input device on/off + * @param option [out] Sound path option + * MM_SOUND_PATH_OPTION_NONE + * MM_SOUND_PATH_OPTION_AUTO_HEADSET_CONTROL + * MM_SOUND_PATH_OPTION_SPEAKER_WITH_HEADSET + * + * @return This function returns MM_ERROR_NONE on success, or negative value + * with error code. + * @remark + * @see mm_sound_set_path + */ +int mm_sound_get_path(int *gain, int *output, int *input, int *option); + +int mm_sound_pcm_play_open_ex (MMSoundPcmHandle_t *handle, const unsigned int rate, MMSoundPcmChannel_t channel, MMSoundPcmFormat_t format, int volume_config, int asm_event); + +int mm_sound_pcm_play_open_no_session(MMSoundPcmHandle_t *handle, const unsigned int rate, MMSoundPcmChannel_t channel, MMSoundPcmFormat_t format); + +/** + @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __MM_SOUND_H__ */ + diff --git a/include/mm_sound_utils.h b/include/mm_sound_utils.h new file mode 100644 index 0000000..0d854cc --- /dev/null +++ b/include/mm_sound_utils.h @@ -0,0 +1,58 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/** + * @file mm_sound_utils.h + * @brief Internal utility library for sound module. + * @date + * @version Release + * + * Internal utility library for sound module. + */ + +#ifndef __MM_SOUND_UTILS_H__ +#define __MM_SOUND_UTILS_H__ + +#include +#include + +#include "../include/mm_sound.h" + +#ifdef __cplusplus + extern "C" { +#endif + +int _mm_sound_get_valid_route_list(mm_sound_route **route_list); +bool _mm_sound_is_route_valid(mm_sound_route route); +void _mm_sound_get_devices_from_route(mm_sound_route route, mm_sound_device_in *device_in, mm_sound_device_out *device_out); +bool _mm_sound_check_hibernation (const char *path); +int _mm_sound_volume_add_callback(volume_type_t type, void *func, void* user_data); +int _mm_sound_volume_remove_callback(volume_type_t type, void *func); +int _mm_sound_volume_get_value_by_type(volume_type_t type, unsigned int *value); +int _mm_sound_volume_set_value_by_type(volume_type_t type, unsigned int value); +int _mm_sound_volume_get_values_on_bootup(int *values); + +#ifdef __cplusplus +} +#endif + +#endif /* __MM_SOUND_UTILS_H__ */ + diff --git a/include/mm_source.h b/include/mm_source.h new file mode 100644 index 0000000..1cf09db --- /dev/null +++ b/include/mm_source.h @@ -0,0 +1,72 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __MM_SOURCE_H__ +#define __MM_SOURCE_H__ + +enum { + MM_SOURCE_NONE = 0, + MM_SOURCE_FILE, + MM_SOURCE_MEMORY, + MM_SOURCE_MEMORY_NOTALLOC, + MM_SOURCE_NUM, +}; + +enum { + MM_SOURCE_NOT_DRM_CONTENTS = 0, + MM_SOURCE_CHECK_DRM_CONTENTS +}; + +typedef struct { + int type; /**< source type (file or memory) */ + void *ptr; /**< pointer to buffer */ + unsigned int cur_size; /**< size of current memory */ + unsigned int tot_size; /**< size of current memory */ + int fd; /**< file descriptor for file */ + unsigned int medOffset; /**Media Offset */ +} MMSourceType; + +#define MMSourceIsUnUsed(psource) \ + ((psource)->type == MM_SOUND_SOURCE_NONE) + +#define MMSourceIsFile(psource) \ + ((psource)->type == MM_SOUND_SOURCE_FILE) + +#define MMSourceIsMemory(psource) \ + ((psource)->type == MM_SOUND_SOURCE_MEMORY) + +#define MMSourceGetPtr(psource) \ + ((psource)->ptr) + +#define MMSourceGetCurSize(psource) \ + ((psource)->cur_size) + +#define MMSourceGetTotSize(psource) \ + ((psource)->tot_size) + +int mm_source_open_file(const char *filename, MMSourceType* source, int drmsupport); +int mm_source_open_full_memory(const void *ptr, int totsize, int alloc, MMSourceType *source); +int mm_source_open_memory(const void *ptr, int totsize, int size, MMSourceType *source); +int mm_source_append_memory(const void *ptr, int size, MMSourceType *source); +int mm_source_close(MMSourceType *source); + +#endif /* __MM_SOURCE_H__ */ + diff --git a/init/Makefile.am b/init/Makefile.am new file mode 100644 index 0000000..504f7b4 --- /dev/null +++ b/init/Makefile.am @@ -0,0 +1,2 @@ +installinitscriptdir = /etc/rc.d/init.d +installinitscript_SCRIPTS = $(srcdir)/soundserver diff --git a/init/mmfwaudio b/init/mmfwaudio new file mode 100755 index 0000000..9ddc192 --- /dev/null +++ b/init/mmfwaudio @@ -0,0 +1,10 @@ +#!/bin/sh +# +### BEGIN INIT INFO +# Provides: mmfwaudio +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: start sound_server daemon +### END INIT INFO + +dlogutil -v threadtime -f /var/log/mmfw_audio.log -r 1000 -n 10 MMFW_AVAUDIO:W MMFW_SOUND MMFW_SESSIONMGR & diff --git a/init/soundserver b/init/soundserver new file mode 100755 index 0000000..d7b7884 --- /dev/null +++ b/init/soundserver @@ -0,0 +1,12 @@ +#!/bin/sh +# +### BEGIN INIT INFO +# Provides: soundserver +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: start sound_server daemon +### END INIT INFO + +if [ -x /usr/bin/sound_server ]; then + /usr/bin/sound_server -S& +fi diff --git a/libmm-sound.manifest b/libmm-sound.manifest new file mode 100644 index 0000000..db36e81 --- /dev/null +++ b/libmm-sound.manifest @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/missing b/missing new file mode 100755 index 0000000..1c8ff70 --- /dev/null +++ b/missing @@ -0,0 +1,367 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2006-05-10.23 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 +# 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., 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. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# 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 + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -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' + autom4te touch the output file, or create a stub one + 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] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case $1 in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $1 in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + 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' $msg. 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 test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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 test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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 "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # 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 is $msg. + 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 prerequisites 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 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/mm_sound.c b/mm_sound.c new file mode 100644 index 0000000..ad2cd5c --- /dev/null +++ b/mm_sound.c @@ -0,0 +1,1560 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include "include/mm_sound_private.h" +#include "include/mm_sound.h" +#include "include/mm_sound_utils.h" +#include "include/mm_sound_client.h" +#include "include/mm_ipc.h" +#include "include/mm_sound_common.h" + + +#include +#include +#include + +#define MAX_FILE_LENGTH 256 +#define MAX_MEMORY_SIZE 1048576 /* Max memory size 1024*1024 (1MB) */ +#define _MIN_SYSTEM_SAMPLERATE 8000 +#define _MAX_SYSTEM_SAMPLERATE 48000 +#define MIN_TONE_PLAY_TIME 300 + +typedef struct { + volume_callback_fn func; + void* data; + volume_type_t type; +}volume_cb_param; + +volume_cb_param g_volume_param[VOLUME_TYPE_MAX]; + +static pthread_mutex_t _volume_mutex = PTHREAD_MUTEX_INITIALIZER; + +#define PCM_LOCK_INTERNAL(LOCK) do { pthread_mutex_lock(LOCK); } while (0) +#define PCM_UNLOCK_INTERNAL(LOCK) do { pthread_mutex_unlock(LOCK); } while (0) +#define PCM_LOCK_DESTROY_INTERNAL(LOCK) do { pthread_mutex_destroy(LOCK); } while (0) + +typedef struct { + avsys_handle_t audio_handle; + int asm_handle; + ASM_sound_events_t asm_event; + + bool is_started; + bool is_playback; + bool skip_session; + pthread_mutex_t pcm_mutex_internal; + MMMessageCallback msg_cb; + void *msg_cb_param; + + +} mm_sound_pcm_t; + +static int _pcm_sound_start (MMSoundPcmHandle_t handle); +static int _pcm_sound_stop_internal (MMSoundPcmHandle_t handle); +static int _pcm_sound_stop(MMSoundPcmHandle_t handle); + +static void __sound_pcm_send_message (mm_sound_pcm_t *pcmHandle, int message, int code); + +static int __validate_volume(volume_type_t type, int value) +{ + if (value < 0) + return -1; + + switch (type) + { + case VOLUME_TYPE_CALL: + case VOLUME_TYPE_VOIP: + if (value >= AVSYS_AUDIO_VOLUME_MAX_BASIC) { + return -1; + } + break; + case VOLUME_TYPE_SYSTEM: + case VOLUME_TYPE_MEDIA: + case VOLUME_TYPE_ALARM: + case VOLUME_TYPE_EXT_JAVA: + case VOLUME_TYPE_NOTIFICATION: + case VOLUME_TYPE_RINGTONE: + if (value >= AVSYS_AUDIO_VOLUME_MAX_MULTIMEDIA) { + return -1; + } + break; + case VOLUME_TYPE_EXT_ANDROID: + if (value >= AVSYS_AUDIO_VOLUME_MAX_SINGLE) { + return -1; + } + break; + default: + return -1; + break; + } + return 0; +} + +static void volume_changed_cb(keynode_t* node, void* data) +{ + volume_cb_param* param = (volume_cb_param*) data; + + debug_msg("%s changed callback called\n",vconf_keynode_get_name(node)); + + MMSOUND_ENTER_CRITICAL_SECTION( &_volume_mutex ) + + if(param && (param->func != NULL)) { + debug_msg("funcion 0x%x\n", param->func); + ((volume_callback_fn)param->func)(param->data); + } + + MMSOUND_LEAVE_CRITICAL_SECTION( &_volume_mutex ) +} + +EXPORT_API +int mm_sound_volume_add_callback(volume_type_t type, volume_callback_fn func, void* user_data) +{ + debug_fenter(); + + /* Check input param */ + if (type < 0 || type >= VOLUME_TYPE_MAX) { + return MM_ERROR_INVALID_ARGUMENT; + } + if (!func) { + debug_warning("callback function is null\n"); + return MM_ERROR_INVALID_ARGUMENT; + } + + MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN( &_volume_mutex, MM_ERROR_SOUND_INTERNAL ); + + g_volume_param[type].func = func; + g_volume_param[type].data = user_data; + g_volume_param[type].type = type; + + MMSOUND_LEAVE_CRITICAL_SECTION( &_volume_mutex ); + + return _mm_sound_volume_add_callback(type, volume_changed_cb, (void*)&g_volume_param[type]); +} + +EXPORT_API +int mm_sound_volume_remove_callback(volume_type_t type) +{ + debug_fenter(); + + if(type < 0 || type >=VOLUME_TYPE_MAX) { + return MM_ERROR_INVALID_ARGUMENT; + } + + MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN( &_volume_mutex, MM_ERROR_SOUND_INTERNAL ); + + g_volume_param[type].func = NULL; + g_volume_param[type].data = NULL; + g_volume_param[type].type = type; + + MMSOUND_LEAVE_CRITICAL_SECTION( &_volume_mutex ); + + return _mm_sound_volume_remove_callback(type, volume_changed_cb); +} + +EXPORT_API +int mm_sound_get_volume_step(volume_type_t type, int *step) +{ + printf("\n**********\n\nTHIS FUNCTION HAS DEFPRECATED [%s]\n\n \ + use mm_sound_volume_get_step() instead\n\n**********\n", __func__); + return mm_sound_volume_get_step(type, step); +} + +EXPORT_API +int mm_sound_volume_get_step(volume_type_t type, int *step) +{ + int err; + + debug_fenter(); + + /* Check input param */ + if (step == NULL) { + debug_error("second parameter is null\n"); + return MM_ERROR_INVALID_ARGUMENT; + } + if (type < 0 || type >= VOLUME_TYPE_MAX) { + debug_error("Invalid type value %d\n", (int)type); + return MM_ERROR_INVALID_ARGUMENT; + } + + err = avsys_audio_get_volume_max_ex((int)type, step); + if (AVSYS_FAIL(err)) { + err = MM_ERROR_INVALID_ARGUMENT; + } + + debug_fleave(); + return MM_ERROR_NONE; +} + +EXPORT_API +int mm_sound_volume_set_value(volume_type_t type, const unsigned int value) +{ + int ret = MM_ERROR_NONE; + + debug_fenter(); + + /* Check input param */ + if (0 > __validate_volume(type, (int)value)) { + debug_error("invalid volume type %d, value %u\n", type, value); + return MM_ERROR_INVALID_ARGUMENT; + } + + ret = _mm_sound_volume_set_value_by_type(type, value); + if (ret == MM_ERROR_NONE) { + /* update shared memory value */ + if (AVSYS_FAIL(avsys_audio_set_volume_by_type(type, (int)value))) { + debug_error("Can not set volume to shared memory 0x%x\n", ret); + } + } + + debug_fleave(); + return ret; +} + +EXPORT_API +int mm_sound_volume_get_value(volume_type_t type, unsigned int *value) +{ + int ret = MM_ERROR_NONE; + + debug_fenter(); + + /* Check input param */ + if (value == NULL) + return MM_ERROR_INVALID_ARGUMENT; + if (type < 0 || type >= VOLUME_TYPE_MAX) { + debug_error("invalid volume type value %d\n", type); + return MM_ERROR_INVALID_ARGUMENT; + } + + ret = _mm_sound_volume_get_value_by_type(type, value); + + debug_fleave(); + return ret; +} + +EXPORT_API +int mm_sound_volume_primary_type_set(volume_type_t type) +{ + pid_t mypid; + int ret = MM_ERROR_NONE; + + /* Check input param */ + if(type < 0 || type >= VOLUME_TYPE_MAX) + return MM_ERROR_INVALID_ARGUMENT; + + debug_fenter(); + + mypid = getpid(); + if(AVSYS_FAIL(avsys_audio_set_primary_volume((int)mypid, type))) { + debug_error("Can not set primary volume [%d, %d]\n", mypid, type); + ret = MM_ERROR_SOUND_INTERNAL; + } + + debug_fleave(); + return ret; +} + +EXPORT_API +int mm_sound_volume_primary_type_clear() +{ + pid_t mypid; + int ret = MM_ERROR_NONE; + + debug_fenter(); + + mypid = getpid(); + if(AVSYS_FAIL(avsys_audio_clear_primary_volume((int)mypid))) { + debug_error("Can not clear primary volume [%d]\n", mypid); + ret = MM_ERROR_SOUND_INTERNAL; + } + + debug_fleave(); + return ret; +} + +EXPORT_API +int mm_sound_volume_get_current_playing_type(volume_type_t *type) +{ + int result = AVSYS_STATE_SUCCESS; + int voltype = AVSYS_AUDIO_VOLUME_TYPE_RINGTONE; + int ret = MM_ERROR_NONE; + + debug_fenter(); + + /* Check input param */ + if(type == NULL) { + return MM_ERROR_INVALID_ARGUMENT; + } + + result = avsys_audio_get_current_playing_volume_type(&voltype); + switch (result) + { + case AVSYS_STATE_SUCCESS: + *type = voltype; + break; + case AVSYS_STATE_ERR_ALLOCATION: + ret = MM_ERROR_SOUND_VOLUME_NO_INSTANCE; + break; + case AVSYS_STATE_ERR_INVALID_MODE: + ret = MM_ERROR_SOUND_VOLUME_CAPTURE_ONLY; + break; + default: + ret = MM_ERROR_SOUND_INTERNAL; + break; + } + debug_log("avsys_audio_get_current_playing_volume_type() = %x, ret = %x, type = %d\n", result, ret, *type); + + debug_fleave(); + return ret; +} + +/////////////////////////////////// +//// MMSOUND PCM APIs +/////////////////////////////////// + + +int _get_asm_event_type(ASM_sound_events_t *type) +{ + int sessionType = MM_SESSION_TYPE_SHARE; + ASM_sound_events_t asm_event; + + if(type == NULL) + return MM_ERROR_SOUND_INVALID_POINTER; + + /* read session type */ + if(_mm_session_util_read_type(-1, &sessionType) < 0) { + debug_log("Read Session Type failed. Set default \"Share\" type\n"); + sessionType = MM_SESSION_TYPE_SHARE; + if(mm_session_init(sessionType) < 0) { + debug_error("mm_session_init() failed\n"); + return MM_ERROR_SOUND_INTERNAL; + } + } + + /* convert MM_SESSION_TYPE to ASM_EVENT_TYPE */ + switch (sessionType) + { + case MM_SESSION_TYPE_SHARE: + asm_event = ASM_EVENT_SHARE_MMSOUND; + break; + case MM_SESSION_TYPE_EXCLUSIVE: + asm_event = ASM_EVENT_EXCLUSIVE_MMSOUND; + break; + case MM_SESSION_TYPE_NOTIFY: + asm_event = ASM_EVENT_NOTIFY; + break; + case MM_SESSION_TYPE_ALARM: + asm_event = ASM_EVENT_ALARM; + break; + case MM_SESSION_TYPE_CALL: + asm_event = ASM_EVENT_CALL; + break; + case MM_SESSION_TYPE_VIDEOCALL: + asm_event = ASM_EVENT_VIDEOCALL; + break; + case MM_SESSION_TYPE_RICH_CALL: + asm_event = ASM_EVENT_RICH_CALL; + break; + case MM_SESSION_TYPE_EMERGENCY: + asm_event = ASM_EVENT_EMERGENCY; + break; + default: + debug_error("Unexpected %d\n", sessionType); + return MM_ERROR_SOUND_INTERNAL; + } + + *type = asm_event; + return MM_ERROR_NONE; +} + +static void __sound_pcm_send_message (mm_sound_pcm_t *pcmHandle, int message, int code) +{ + int ret = 0; + if (pcmHandle->msg_cb) { + MMMessageParamType msg; + msg.union_type = MM_MSG_UNION_CODE; + msg.code = code; + + debug_log ("calling msg callback(%p) with message(%d), code(%d), msg callback param(%p)\n", + pcmHandle->msg_cb, message, msg.code, pcmHandle->msg_cb_param); + ret = pcmHandle->msg_cb(message, &msg, pcmHandle->msg_cb_param); + debug_log ("msg callback returned (%d)\n", ret); + } else { + debug_log ("No pcm msg callback\n"); + } +} + +ASM_cb_result_t sound_pcm_asm_callback(int handle, ASM_event_sources_t event_src, ASM_sound_commands_t command, unsigned int sound_status, void *cb_data) +{ + mm_sound_pcm_t *pcmHandle = (mm_sound_pcm_t *)cb_data; + ASM_cb_result_t cb_res = ASM_CB_RES_IGNORE; + + /* Check input param */ + if(pcmHandle == NULL) { + debug_error("sound_pcm_asm_callback cb_data is null\n"); + return cb_res; + } + + debug_log ("command = %d, handle = %p, is_started = %d\n",command, pcmHandle, pcmHandle->is_started); + switch(command) + { + case ASM_COMMAND_STOP: + /* Do stop */ + PCM_LOCK_INTERNAL(&pcmHandle->pcm_mutex_internal); + _pcm_sound_stop_internal (pcmHandle); + PCM_UNLOCK_INTERNAL(&pcmHandle->pcm_mutex_internal); + cb_res = ASM_CB_RES_PAUSE; + break; + + case ASM_COMMAND_RESUME: + cb_res = ASM_CB_RES_IGNORE; + break; + + case ASM_COMMAND_PAUSE: + case ASM_COMMAND_PLAY: + case ASM_COMMAND_NONE: + debug_error ("Not an expected case!!!!\n"); + break; + } + + /* execute user callback if callback available */ + __sound_pcm_send_message (pcmHandle, MM_MESSAGE_SOUND_PCM_INTERRUPTED, event_src); + + return cb_res; +} + +EXPORT_API +int mm_sound_pcm_capture_open(MMSoundPcmHandle_t *handle, const unsigned int rate, MMSoundPcmChannel_t channel, MMSoundPcmFormat_t format) +{ + avsys_audio_param_t param; + mm_sound_pcm_t *pcmHandle = NULL; + int size = 0; + int result = AVSYS_STATE_SUCCESS; + int errorcode = 0; + int ret_mutex = 0; + debug_fenter(); + memset(¶m, 0, sizeof(avsys_audio_param_t)); + + + if (rate < _MIN_SYSTEM_SAMPLERATE || rate > _MAX_SYSTEM_SAMPLERATE) { + debug_error("unsupported sample rate %u", rate); + return MM_ERROR_SOUND_DEVICE_INVALID_SAMPLERATE; + } else { + param.samplerate = rate; + } + + switch(channel) + { + case MMSOUND_PCM_MONO: + param.channels = 1; + break; + case MMSOUND_PCM_STEREO: + param.channels = 2; + break; + + default: + debug_error("Unsupported channel type\n"); + return MM_ERROR_SOUND_DEVICE_INVALID_CHANNEL; + } + + switch(format) + { + case MMSOUND_PCM_U8: + param.format = AVSYS_AUDIO_FORMAT_8BIT; + break; + case MMSOUND_PCM_S16_LE: + param.format = AVSYS_AUDIO_FORMAT_16BIT; + break; + default: + debug_error("Unsupported format type\n"); + return MM_ERROR_SOUND_DEVICE_INVALID_FORMAT; + } + + pcmHandle = calloc(sizeof(mm_sound_pcm_t), 1); + if(pcmHandle == NULL) + return MM_ERROR_OUT_OF_MEMORY; + + ret_mutex = pthread_mutex_init(&pcmHandle->pcm_mutex_internal, NULL); + if(ret_mutex != 0) + { + free(pcmHandle); + return MM_ERROR_OUT_OF_MEMORY; + } + + /* Register ASM */ + /* get session type */ + if(MM_ERROR_NONE != _get_asm_event_type(&pcmHandle->asm_event)) { + PCM_LOCK_DESTROY_INTERNAL(&pcmHandle->pcm_mutex_internal); + free(pcmHandle); + return MM_ERROR_POLICY_INTERNAL; + } + /* register asm */ + if(pcmHandle->asm_event != ASM_EVENT_CALL && pcmHandle->asm_event != ASM_EVENT_VIDEOCALL) { + if(!ASM_register_sound(-1, &pcmHandle->asm_handle, pcmHandle->asm_event, + /* ASM_STATE_PLAYING */ ASM_STATE_NONE, sound_pcm_asm_callback, (void*)pcmHandle, ASM_RESOURCE_NONE, &errorcode)) + { + debug_error("ASM_register_sound() failed 0x%x\n", errorcode); + PCM_LOCK_DESTROY_INTERNAL(&pcmHandle->pcm_mutex_internal); + free(pcmHandle); + return MM_ERROR_POLICY_BLOCKED; + } + } + + /* Open */ + param.mode = AVSYS_AUDIO_MODE_INPUT; + param.vol_type = AVSYS_AUDIO_VOLUME_TYPE_SYSTEM; //dose not effect at capture mode + param.priority = AVSYS_AUDIO_PRIORITY_0; //This does not affect anymore. + result = avsys_audio_open(¶m, &pcmHandle->audio_handle, &size); + if(AVSYS_FAIL(result)) { + debug_error("Device Open Error 0x%x\n", result); + PCM_LOCK_DESTROY_INTERNAL(&pcmHandle->pcm_mutex_internal); + free(pcmHandle); + return MM_ERROR_SOUND_DEVICE_NOT_OPENED; + } + + pcmHandle->is_playback = false; + + /* Set handle to return */ + *handle = (MMSoundPcmHandle_t)pcmHandle; + debug_fleave(); + return size; +} + +static int _pcm_sound_start (MMSoundPcmHandle_t handle) +{ + mm_sound_pcm_t *pcmHandle = (mm_sound_pcm_t*)handle; + int errorcode = 0; + int ret = 0; + + debug_fenter(); + + /* Check input param */ + if(pcmHandle == NULL) { + debug_error ("Handle is null, return Invalid Argument\n"); + ret = MM_ERROR_INVALID_ARGUMENT; + goto NULL_HANDLE; + } + + PCM_LOCK_INTERNAL(&pcmHandle->pcm_mutex_internal); + + if (pcmHandle->skip_session == false) { + /* ASM set state to PLAYING */ + if (!ASM_set_sound_state(pcmHandle->asm_handle, pcmHandle->asm_event, ASM_STATE_PLAYING, ASM_RESOURCE_NONE, &errorcode)) { + debug_error("ASM_set_sound_state(PLAYING) failed 0x%x\n", errorcode); + ret = MM_ERROR_POLICY_BLOCKED; + goto EXIT; + } + } + + /* Update State */ + pcmHandle->is_started = true; + + /* Un-Cork */ + ret = avsys_audio_cork(pcmHandle->audio_handle, 0); + +EXIT: + PCM_UNLOCK_INTERNAL(&pcmHandle->pcm_mutex_internal); + +NULL_HANDLE: + debug_fleave(); + return ret; +} + + +EXPORT_API +int mm_sound_pcm_capture_start(MMSoundPcmHandle_t handle) +{ + int ret = MM_ERROR_NONE; + debug_fenter(); + + + ret = _pcm_sound_start (handle); + if (ret != MM_ERROR_NONE) { + debug_error ("_pcm_sound_start() failed (%x)\n", ret); + goto EXIT; + } + +EXIT: + debug_fleave(); + return ret; +} + +static int _pcm_sound_stop_internal (MMSoundPcmHandle_t handle) +{ + mm_sound_pcm_t *pcmHandle = (mm_sound_pcm_t*)handle; + + /* Check input param */ + if(pcmHandle == NULL) + return MM_ERROR_INVALID_ARGUMENT; + + /* Check State */ + if (pcmHandle->is_started == false) { + debug_warning ("Can't stop because not started\n"); + return MM_ERROR_SOUND_INVALID_STATE; + } + + /* Drain if playback mode */ + if (pcmHandle->is_playback) { + if(AVSYS_FAIL(avsys_audio_drain(pcmHandle->audio_handle))) { + debug_error("drain failed\n"); + } + } + + /* Update State */ + pcmHandle->is_started = false; + + /* Cork */ + return avsys_audio_cork(pcmHandle->audio_handle, 1); +} + +static int _pcm_sound_stop(MMSoundPcmHandle_t handle) +{ + mm_sound_pcm_t *pcmHandle = (mm_sound_pcm_t*)handle; + int errorcode = 0; + int ret = MM_ERROR_NONE; + + debug_fenter(); + + /* Check input param */ + if(pcmHandle == NULL) { + debug_error ("Handle is null, return Invalid Argument\n"); + ret = MM_ERROR_INVALID_ARGUMENT; + goto NULL_HANDLE; + } + + PCM_LOCK_INTERNAL(&pcmHandle->pcm_mutex_internal); + + /* Do stop procedure */ + ret = _pcm_sound_stop_internal(handle); + if (ret == MM_ERROR_NONE) { + /* Set ASM State to STOP */ + if (pcmHandle->skip_session == false) { + if (!ASM_set_sound_state(pcmHandle->asm_handle, pcmHandle->asm_event, ASM_STATE_STOP, ASM_RESOURCE_NONE, &errorcode)) { + debug_error("ASM_set_sound_state(STOP) failed 0x%x\n", errorcode); + ret = MM_ERROR_POLICY_BLOCKED; + goto EXIT; + } + } + } + + debug_log ("pcm sound [%p] stopped success!!!\n", handle); + +EXIT: + PCM_UNLOCK_INTERNAL(&pcmHandle->pcm_mutex_internal); +NULL_HANDLE: + debug_fleave(); + return ret; +} + + +EXPORT_API +int mm_sound_pcm_capture_stop(MMSoundPcmHandle_t handle) +{ + int ret = 0; + debug_fenter(); + + ret = _pcm_sound_stop(handle); + + debug_fleave(); + return ret; +} + + +EXPORT_API +int mm_sound_pcm_capture_read(MMSoundPcmHandle_t handle, void *buffer, const unsigned int length ) +{ + int ret = 0; + mm_sound_pcm_t *pcmHandle = (mm_sound_pcm_t*)handle; + + /* Check input param */ + if(pcmHandle == NULL) { + debug_error ("Handle is null, return Invalid Argument\n"); + ret = MM_ERROR_INVALID_ARGUMENT; + goto NULL_HANDLE; + } + PCM_LOCK_INTERNAL(&pcmHandle->pcm_mutex_internal); + + if(buffer == NULL) { + debug_error("Invalid buffer pointer\n"); + ret = MM_ERROR_SOUND_INVALID_POINTER; + goto EXIT; + } + if(length == 0 ) { + debug_error ("length is 0, return 0\n"); + ret = 0; + goto EXIT; + } + + /* Check State : return fail if not started */ + if (!pcmHandle->is_started) { + /* not started, return fail */ + debug_error ("Not started yet, return Invalid State \n"); + ret = MM_ERROR_SOUND_INVALID_STATE; + goto EXIT; + } + + /* Read */ + ret = avsys_audio_read(pcmHandle->audio_handle, buffer, length); + +EXIT: + PCM_UNLOCK_INTERNAL(&pcmHandle->pcm_mutex_internal); +NULL_HANDLE: + return ret; +} + +EXPORT_API +int mm_sound_pcm_capture_close(MMSoundPcmHandle_t handle) +{ + int result = MM_ERROR_NONE; + mm_sound_pcm_t *pcmHandle = (mm_sound_pcm_t*)handle; + int errorcode = 0; + + debug_fenter(); + /* Check input param */ + if(pcmHandle == NULL) { + debug_error ("Handle is null, return Invalid Argument\n"); + result = MM_ERROR_INVALID_ARGUMENT; + goto NULL_HDL; + } + PCM_LOCK_INTERNAL(&pcmHandle->pcm_mutex_internal); + /* Close */ + result = avsys_audio_close(pcmHandle->audio_handle); + if(AVSYS_FAIL(result)) { + debug_error("handle close failed 0x%X", result); + result = MM_ERROR_SOUND_INTERNAL; + goto EXIT; + } + + /* Unregister ASM */ + if(pcmHandle->asm_event != ASM_EVENT_CALL && pcmHandle->asm_event != ASM_EVENT_VIDEOCALL) { + if(!ASM_unregister_sound(pcmHandle->asm_handle, pcmHandle->asm_event, &errorcode)) { + debug_error("ASM_unregister failed in %s with 0x%x\n", __func__, errorcode); + result = MM_ERROR_SOUND_INTERNAL; + goto EXIT; + } + } + + debug_log ("pcm capture sound [%p] closed success!!!\n", handle); + +EXIT: + PCM_UNLOCK_INTERNAL(&pcmHandle->pcm_mutex_internal); +NULL_HDL: + /* Free handle */ + if (pcmHandle) { + PCM_LOCK_DESTROY_INTERNAL(&pcmHandle->pcm_mutex_internal); + free(pcmHandle); + pcmHandle = NULL; + } + debug_fleave(); + return result; +} + +EXPORT_API +int mm_sound_pcm_set_message_callback (MMSoundPcmHandle_t handle, MMMessageCallback callback, void *user_param) +{ + mm_sound_pcm_t *pcmHandle = (mm_sound_pcm_t*)handle; + + if(pcmHandle == NULL || callback == NULL) + return MM_ERROR_INVALID_ARGUMENT; + + pcmHandle->msg_cb = callback; + pcmHandle->msg_cb_param = user_param; + + debug_log ("set pcm message callback (%p,%p)\n", callback, user_param); + + return MM_ERROR_NONE; +} + + +EXPORT_API +int mm_sound_pcm_play_open_ex (MMSoundPcmHandle_t *handle, const unsigned int rate, MMSoundPcmChannel_t channel, MMSoundPcmFormat_t format, int volume_config, ASM_sound_events_t asm_event) +{ + avsys_audio_param_t param; + mm_sound_pcm_t *pcmHandle = NULL; + int size = 0; + int result = AVSYS_STATE_SUCCESS; + int errorcode = 0; + int volume_type = MM_SOUND_VOLUME_CONFIG_TYPE(volume_config); + int ret_mutex = 0; + + debug_fenter(); + memset(¶m, 0, sizeof(avsys_audio_param_t)); + + /* Check input param */ + if (volume_type < 0 || volume_type >= VOLUME_TYPE_MAX) { + debug_error("Volume type is invalid %d\n", volume_type); + return MM_ERROR_INVALID_ARGUMENT; + } + if (rate < _MIN_SYSTEM_SAMPLERATE || rate > _MAX_SYSTEM_SAMPLERATE) { + debug_error("unsupported sample rate %u", rate); + return MM_ERROR_SOUND_DEVICE_INVALID_SAMPLERATE; + } else { + param.samplerate = rate; + } + + switch(channel) + { + case MMSOUND_PCM_MONO: + param.channels = 1; + break; + case MMSOUND_PCM_STEREO: + param.channels = 2; + break; + default: + debug_error("Unsupported channel type\n"); + return MM_ERROR_SOUND_DEVICE_INVALID_CHANNEL; + } + + switch(format) + { + case MMSOUND_PCM_U8: + param.format = AVSYS_AUDIO_FORMAT_8BIT; + break; + case MMSOUND_PCM_S16_LE: + param.format = AVSYS_AUDIO_FORMAT_16BIT; + break; + default: + debug_error("Unsupported format type\n"); + return MM_ERROR_SOUND_DEVICE_INVALID_FORMAT; + } + + pcmHandle = calloc(sizeof(mm_sound_pcm_t),1); + if(pcmHandle == NULL) + return MM_ERROR_OUT_OF_MEMORY; + + ret_mutex = pthread_mutex_init(&pcmHandle->pcm_mutex_internal, NULL); + if(ret_mutex != 0) + { + free(pcmHandle); + return MM_ERROR_OUT_OF_MEMORY; + } + + /* Register ASM */ + debug_log ("session start : input asm_event = %d-------------\n", asm_event); + if (asm_event == ASM_EVENT_MONITOR) { + debug_log ("Skip SESSION for event (%d)\n", asm_event); + pcmHandle->skip_session = true; + } else if (asm_event == ASM_EVENT_NONE) { + /* get session type */ + if(MM_ERROR_NONE != _get_asm_event_type(&pcmHandle->asm_event)) { + debug_error ("_get_asm_event_type failed....\n"); + PCM_LOCK_DESTROY_INTERNAL(&pcmHandle->pcm_mutex_internal); + free(pcmHandle); + return MM_ERROR_POLICY_INTERNAL; + } + + if(pcmHandle->asm_event != ASM_EVENT_CALL && pcmHandle->asm_event != ASM_EVENT_VIDEOCALL) { + /* register asm */ + if(!ASM_register_sound(-1, &pcmHandle->asm_handle, pcmHandle->asm_event, + ASM_STATE_NONE, sound_pcm_asm_callback, (void*)pcmHandle, ASM_RESOURCE_NONE, &errorcode)) { + debug_error("ASM_register_sound() failed 0x%x\n", errorcode); + PCM_LOCK_DESTROY_INTERNAL(&pcmHandle->pcm_mutex_internal); + free(pcmHandle); + return MM_ERROR_POLICY_BLOCKED; + } + } + } else { + /* register asm using asm_event input */ + if(!ASM_register_sound(-1, &pcmHandle->asm_handle, asm_event, + ASM_STATE_NONE, NULL, (void*)pcmHandle, ASM_RESOURCE_NONE, &errorcode)) { + debug_error("ASM_register_sound() failed 0x%x\n", errorcode); + PCM_LOCK_DESTROY_INTERNAL(&pcmHandle->pcm_mutex_internal); + free(pcmHandle); + return MM_ERROR_POLICY_BLOCKED; + } + } + + param.mode = AVSYS_AUDIO_MODE_OUTPUT; + param.vol_type = volume_config; + param.priority = AVSYS_AUDIO_PRIORITY_0; + +// avsys_audio_ampon(); + + /* Open */ + debug_log ("avsys open -------------\n"); + result = avsys_audio_open(¶m, &pcmHandle->audio_handle, &size); + if(AVSYS_FAIL(result)) { + debug_error("Device Open Error 0x%x\n", result); + PCM_LOCK_DESTROY_INTERNAL(&pcmHandle->pcm_mutex_internal); + free(pcmHandle); + return MM_ERROR_SOUND_DEVICE_NOT_OPENED; + } + + pcmHandle->is_playback = true; + + /* Set handle to return */ + *handle = (MMSoundPcmHandle_t)pcmHandle; + debug_fleave(); + return size; +} + +EXPORT_API +int mm_sound_pcm_play_open_no_session(MMSoundPcmHandle_t *handle, const unsigned int rate, MMSoundPcmChannel_t channel, MMSoundPcmFormat_t format) +{ + return mm_sound_pcm_play_open_ex (handle, rate, channel, format, VOLUME_TYPE_SYSTEM, ASM_EVENT_MONITOR); +} + +EXPORT_API +int mm_sound_pcm_play_open(MMSoundPcmHandle_t *handle, const unsigned int rate, MMSoundPcmChannel_t channel, MMSoundPcmFormat_t format, const volume_type_t vol_type) +{ + return mm_sound_pcm_play_open_ex (handle, rate, channel, format, vol_type, ASM_EVENT_NONE); +} + +EXPORT_API +int mm_sound_pcm_play_start(MMSoundPcmHandle_t handle) +{ + int ret = 0; + debug_fenter(); + + ret = _pcm_sound_start (handle); + + debug_fleave(); + return ret; + +} + + +EXPORT_API +int mm_sound_pcm_play_stop(MMSoundPcmHandle_t handle) +{ + int ret = 0; + debug_fenter(); + + ret = _pcm_sound_stop(handle); + + debug_fleave(); + return ret; +} + + +EXPORT_API +int mm_sound_pcm_play_write(MMSoundPcmHandle_t handle, void* ptr, unsigned int length_byte) +{ + int ret = 0; + mm_sound_pcm_t *pcmHandle = (mm_sound_pcm_t*)handle; + + /* Check input param */ + if(pcmHandle == NULL) { + debug_error ("Handle is null, return Invalid Argument\n"); + ret = MM_ERROR_INVALID_ARGUMENT; + goto NULL_HANDLE; + } + + PCM_LOCK_INTERNAL(&pcmHandle->pcm_mutex_internal); + + if(ptr == NULL) { + debug_error("Invalid buffer pointer\n"); + ret = MM_ERROR_SOUND_INVALID_POINTER; + goto EXIT; + } + if(length_byte == 0 ) { + debug_error ("length is 0, return 0\n"); + ret = 0; + goto EXIT; + } + + /* Check State : return fail if not started */ + if (!pcmHandle->is_started) { + /* not started, return fail */ + debug_error ("Not started yet, return Invalid State \n"); + ret = MM_ERROR_SOUND_INVALID_STATE; + goto EXIT; + } + + /* Write */ + ret = avsys_audio_write(pcmHandle->audio_handle, ptr, length_byte); + +EXIT: + PCM_UNLOCK_INTERNAL(&pcmHandle->pcm_mutex_internal); +NULL_HANDLE: + return ret; +} + +EXPORT_API +int mm_sound_pcm_play_close(MMSoundPcmHandle_t handle) +{ + int result = MM_ERROR_NONE; + mm_sound_pcm_t *pcmHandle = (mm_sound_pcm_t*)handle; + int errorcode = 0; + + debug_fenter(); + /* Check input param */ + if(pcmHandle == NULL) { + debug_error ("Handle is null, return Invalid Argument\n"); + result = MM_ERROR_INVALID_ARGUMENT; + goto NULL_HANDLE; + } + PCM_LOCK_INTERNAL(&pcmHandle->pcm_mutex_internal); + /* Drain if needed */ + if (pcmHandle->is_started) { + /* stop() is not called before close(), drain is needed */ + if(AVSYS_FAIL(avsys_audio_drain(pcmHandle->audio_handle))) { + debug_error("drain failed\n"); + result = MM_ERROR_SOUND_INTERNAL; + goto EXIT; + } + } + pcmHandle->is_started = false; + /* Close */ + result = avsys_audio_close(pcmHandle->audio_handle); + if(AVSYS_FAIL(result)) { + debug_error("handle close failed 0x%X", result); + result = MM_ERROR_SOUND_INTERNAL; + goto EXIT; + } + + if (pcmHandle->skip_session == false) { + /* Unregister ASM */ + if(pcmHandle->asm_event != ASM_EVENT_CALL && pcmHandle->asm_event != ASM_EVENT_VIDEOCALL) { + if(!ASM_unregister_sound(pcmHandle->asm_handle, pcmHandle->asm_event, &errorcode)) { + debug_error("ASM_unregister failed in %s with 0x%x\n",__func__, errorcode); + result = MM_ERROR_SOUND_INTERNAL; + goto EXIT; + } + } + } + + debug_log ("pcm play sound [%p] closed success!!!\n", handle); + + +EXIT: + PCM_UNLOCK_INTERNAL(&pcmHandle->pcm_mutex_internal); +NULL_HANDLE: + if (pcmHandle) { + /* Free handle */ + PCM_LOCK_DESTROY_INTERNAL(&pcmHandle->pcm_mutex_internal); + free(pcmHandle); + pcmHandle= NULL; + } + debug_fleave(); + return result; +} + +/////////////////////////////////// +//// MMSOUND PLAY APIs +/////////////////////////////////// +static inline void _mm_sound_fill_play_param(MMSoundPlayParam *param, const char *filename, int volume_config, mm_sound_stop_callback_func callback, void *data, int priority, int handle_route) +{ + param->filename = filename; + param->volume = 0; //volume value dose not effect anymore + param->callback = callback; + param->data = data; + param->loop = 1; + param->volume_config = volume_config; + param->priority = priority; + param->handle_route = handle_route; +} + +EXPORT_API +int mm_sound_play_loud_solo_sound_no_restore(const char *filename, int volume_config, mm_sound_stop_callback_func callback, void *data, int *handle) +{ + MMSoundPlayParam param = { 0, }; + + _mm_sound_fill_play_param(¶m, filename, volume_config, callback, data, AVSYS_AUDIO_PRIORITY_SOLO, MM_SOUND_HANDLE_ROUTE_SPEAKER_NO_RESTORE); + return mm_sound_play_sound_ex(¶m, handle); +} + +EXPORT_API +int mm_sound_play_loud_solo_sound(const char *filename, int volume_config, mm_sound_stop_callback_func callback, void *data, int *handle) +{ + MMSoundPlayParam param = { 0, }; + + _mm_sound_fill_play_param(¶m, filename, volume_config, callback, data, AVSYS_AUDIO_PRIORITY_SOLO, MM_SOUND_HANDLE_ROUTE_SPEAKER); + return mm_sound_play_sound_ex(¶m, handle); +} + +EXPORT_API +int mm_sound_play_solo_sound(const char *filename, int volume_config, mm_sound_stop_callback_func callback, void *data, int *handle) +{ + MMSoundPlayParam param = { 0, }; + + _mm_sound_fill_play_param(¶m, filename, volume_config, callback, data, AVSYS_AUDIO_PRIORITY_SOLO, MM_SOUND_HANDLE_ROUTE_USING_CURRENT); + return mm_sound_play_sound_ex(¶m, handle); +} + +EXPORT_API +int mm_sound_play_sound(const char *filename, int volume_config, mm_sound_stop_callback_func callback, void *data, int *handle) +{ + MMSoundPlayParam param = { 0, }; + + _mm_sound_fill_play_param(¶m, filename, volume_config, callback, data, AVSYS_AUDIO_PRIORITY_NORMAL, MM_SOUND_HANDLE_ROUTE_USING_CURRENT); + return mm_sound_play_sound_ex(¶m, handle); +} + +EXPORT_API +int mm_sound_play_sound_ex(MMSoundPlayParam *param, int *handle) +{ + int err; + int lhandle = -1; + int volume_type = MM_SOUND_VOLUME_CONFIG_TYPE(param->volume_config); + + debug_fenter(); + + /* Check input param */ + if (param == NULL) { + debug_error("param is null\n"); + return MM_ERROR_INVALID_ARGUMENT; + } + if (param->filename == NULL) { + debug_error("filename is NULL\n"); + return MM_ERROR_SOUND_FILE_NOT_FOUND; + } + if (volume_type < 0 || volume_type >= VOLUME_TYPE_MAX) { + debug_error("Volume type is invalid %d\n", volume_type); + return MM_ERROR_INVALID_ARGUMENT; + } + + /* Play sound */ + err = MMSoundClientPlaySound(param, 0, 0, &lhandle); + if (err < 0) { + debug_error("Failed to play sound\n"); + return err; + } + + /* Set handle to return */ + if (handle) { + *handle = lhandle; + } else { + debug_critical("The sound hadle cannot be get [%d]\n", lhandle); + } + + debug_fleave(); + return MM_ERROR_NONE; +} + + +EXPORT_API +int mm_sound_stop_sound(int handle) +{ + int err; + + debug_fenter(); + + /* Stop sound */ + err = MMSoundClientStopSound(handle); + if (err < 0) { + debug_error("Fail to stop sound\n"); + return err; + } + + debug_fleave(); + return MM_ERROR_NONE; +} + +/////////////////////////////////// +//// MMSOUND TONE APIs +/////////////////////////////////// +EXPORT_API +int mm_sound_play_tone (MMSoundTone_t num, int volume_config, const double volume, const int duration, int *handle) +{ + int lhandle = -1; + int err = MM_ERROR_NONE; + int volume_type = MM_SOUND_VOLUME_CONFIG_TYPE(volume_config); + + debug_fenter(); + + /* Check input param */ + if (duration < -1) { + debug_error("number is invalid %d\n", duration); + return MM_ERROR_INVALID_ARGUMENT; + } + if (num < MM_SOUND_TONE_DTMF_0 || num >= MM_SOUND_TONE_NUM) { + debug_error("TONE Value is invalid %d\n", num); + return MM_ERROR_INVALID_ARGUMENT; + } + if (volume_type < 0 || volume_type >= VOLUME_TYPE_MAX) { + debug_error("Volume type is invalid %d\n", volume_type); + return MM_ERROR_INVALID_ARGUMENT; + } + if (volume < 0.0 || volume > 1.0) { + debug_error("Volume Value is invalid %d\n", volume); + return MM_ERROR_INVALID_ARGUMENT; + } + + /* Play tone */ + debug_msg("Call MMSoundClientPlayTone\n"); + err = MMSoundClientPlayTone(num, volume_config, volume, duration, &lhandle); + if (err < 0) { + debug_error("Failed to play sound\n"); + return err; + } + + /* Set handle to return */ + if (handle) + *handle = lhandle; + else + debug_critical("The sound handle cannot be get [%d]\n", lhandle); + + debug_fleave(); + return MM_ERROR_NONE; +} + +/////////////////////////////////// +//// MMSOUND ROUTING APIs +/////////////////////////////////// +EXPORT_API +int mm_sound_set_path(int gain, int output, int input, int option) +{ + int err; + + debug_fenter(); + + debug_msg("gain: 0x%02X, output: %d, input: %d, option: 0x%x\n", gain, output, input, option); + + err = avsys_audio_set_path_ex( gain, output, input, option); + if (err < 0) { + debug_error("avsys_audio_set_path() failed\n"); + return MM_ERROR_SOUND_INTERNAL; + } + + debug_fleave(); + return MM_ERROR_NONE; +} + +EXPORT_API +int mm_sound_get_path(int *gain, int *output, int *input, int *option) +{ + int err; + + debug_fenter(); + + err = avsys_audio_get_path_ex( gain, output, input, option); + if (err < 0) { + debug_error("SoundCtlPathGet() failed\n"); + return MM_ERROR_SOUND_INTERNAL; + } + + debug_msg("gain: 0x%02X, output: %d, input: %d, option: 0x%x\n", *gain, *output, *input, *option); + + debug_fleave(); + return MM_ERROR_NONE; +} + +#ifdef PULSE_CLIENT +enum { + USE_PA_SINK_ALSA = 0, + USE_PA_SINK_A2DP, +}; +EXPORT_API +int mm_sound_route_set_system_policy (system_audio_route_t route) +{ + return MM_ERROR_NONE; +} + + +EXPORT_API +int mm_sound_route_get_system_policy (system_audio_route_t *route) +{ + return MM_ERROR_NONE; +} + + +EXPORT_API +int mm_sound_route_get_a2dp_status (bool *connected, char **bt_name) +{ + int ret = MM_ERROR_NONE; + + debug_fenter(); + + if (connected == NULL || bt_name == NULL) { + debug_error ("argument is not valid\n"); + return MM_ERROR_INVALID_ARGUMENT; + } + + ret = MMSoundClientIsBtA2dpOn (connected, bt_name); + debug_msg ("connected=[%d] bt_name[%s]\n", *connected, *bt_name); + if (ret < 0) { + debug_error("MMSoundClientIsBtA2dpOn() Failed\n"); + return ret; + } + + debug_fleave(); + + return ret; +} + +EXPORT_API +int mm_sound_route_get_playing_device(system_audio_route_device_t *dev) +{ + mm_sound_device_in device_in = MM_SOUND_DEVICE_IN_NONE; + mm_sound_device_out device_out = MM_SOUND_DEVICE_OUT_NONE; + + if(!dev) + return MM_ERROR_INVALID_ARGUMENT; + + if(MM_ERROR_NONE != mm_sound_get_active_device(&device_in, &device_out)) { + debug_error("Can not get active device info\n"); + return MM_ERROR_SOUND_INTERNAL; + } + + switch(device_out) + { + case MM_SOUND_DEVICE_OUT_SPEAKER: + *dev = SYSTEM_AUDIO_ROUTE_PLAYBACK_DEVICE_HANDSET; + break; + case MM_SOUND_DEVICE_OUT_BT_A2DP: + *dev = SYSTEM_AUDIO_ROUTE_PLAYBACK_DEVICE_BLUETOOTH; + break; + case MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY: + *dev = SYSTEM_AUDIO_ROUTE_PLAYBACK_DEVICE_EARPHONE; + break; + default: + *dev = SYSTEM_AUDIO_ROUTE_PLAYBACK_DEVICE_NONE; + break; + } + + return MM_ERROR_NONE; +} + +EXPORT_API +int mm_sound_route_add_change_callback(audio_route_policy_changed_callback_fn func, void *user_data) +{ + /* Deprecated */ + return MM_ERROR_NONE; +} + +EXPORT_API +int mm_sound_route_remove_change_callback() +{ + /* Deprecated */ + return MM_ERROR_NONE; +} + +#endif /* PULSE_CLIENT */ + +EXPORT_API +int mm_sound_system_get_capture_status(system_audio_capture_status_t *status) +{ + int err = AVSYS_STATE_SUCCESS; + int on_capture = 0; + + if(!status) + return MM_ERROR_INVALID_ARGUMENT; + + err = avsys_audio_get_capture_status(&on_capture); + if(err < 0) { + debug_error("Can not get capture status with 0x%x\n", err); + return MM_ERROR_SOUND_INTERNAL; + } + + if(on_capture) + *status = SYSTEM_AUDIO_CAPTURE_ACTIVE; + else + *status = SYSTEM_AUDIO_CAPTURE_NONE; + + return MM_ERROR_NONE; +} + +EXPORT_API +int mm_sound_is_route_available(mm_sound_route route, bool *is_available) +{ + int ret = MM_ERROR_NONE; + + debug_fenter(); + + if (!_mm_sound_is_route_valid(route)) { + debug_error("route is invalid %d\n", route); + return MM_ERROR_INVALID_ARGUMENT; + } + if (!is_available) + { + debug_error("is_available is invalid\n"); + return MM_ERROR_INVALID_ARGUMENT; + } + + ret = _mm_sound_client_is_route_available(route, is_available); + if (ret < 0) { + debug_error("Can not check given route is available\n"); + } + + debug_fleave(); + return ret; +} + +EXPORT_API +int mm_sound_foreach_available_route_cb(mm_sound_available_route_cb available_route_cb, void *user_data) +{ + int ret = MM_ERROR_NONE; + + debug_fenter(); + + if (!available_route_cb) + { + debug_error("available_route_cb is invalid\n"); + return MM_ERROR_INVALID_ARGUMENT; + } + + ret = _mm_sound_client_foreach_available_route_cb(available_route_cb, user_data); + if (ret < 0) { + debug_error("Can not set foreach available route callback\n"); + } + + debug_fleave(); + return ret; +} + +EXPORT_API +int mm_sound_set_active_route(mm_sound_route route) +{ + int ret = MM_ERROR_NONE; + + debug_fenter(); + + if (!_mm_sound_is_route_valid(route)) { + debug_error("route is invalid %d\n", route); + return MM_ERROR_INVALID_ARGUMENT; + } + + ret = _mm_sound_client_set_active_route(route); + if (ret < 0) { + debug_error("Can not set active route\n"); + } + + debug_fleave(); + return ret; +} + + +EXPORT_API +int mm_sound_get_active_device(mm_sound_device_in *device_in, mm_sound_device_out *device_out) +{ + int ret = MM_ERROR_NONE; + + debug_fenter(); + + if (device_in == NULL || device_out == NULL) { + debug_error("argument is not valid\n"); + return MM_ERROR_INVALID_ARGUMENT; + } + + ret = _mm_sound_client_get_active_device(device_in, device_out); + if (ret < 0) { + debug_error("Can not add active device callback\n"); + } + + debug_fleave(); + return ret; +} + +EXPORT_API +int mm_sound_add_active_device_changed_callback(mm_sound_active_device_changed_cb func, void *user_data) +{ + int ret = MM_ERROR_NONE; + + debug_fenter(); + + if (func == NULL) { + debug_error("argument is not valid\n"); + return MM_ERROR_INVALID_ARGUMENT; + } + + ret = _mm_sound_client_add_active_device_changed_callback(func, user_data); + if (ret < 0) { + debug_error("Can not add active device changed callback\n"); + } + + debug_fleave(); + return ret; +} + +EXPORT_API +int mm_sound_remove_active_device_changed_callback(void) +{ + int ret = MM_ERROR_NONE; + + debug_fenter(); + + ret = _mm_sound_client_remove_active_device_changed_callback(); + if (ret < 0) { + debug_error("Can not remove active device changed callback\n"); + } + + debug_fleave(); + return ret; +} + +EXPORT_API +int mm_sound_add_available_route_changed_callback(mm_sound_available_route_changed_cb func, void *user_data) +{ + int ret = MM_ERROR_NONE; + + debug_fenter(); + + if (func == NULL) { + debug_error("argument is not valid\n"); + return MM_ERROR_INVALID_ARGUMENT; + } + + ret = _mm_sound_client_add_available_route_changed_callback(func, user_data); + if (ret < 0) { + debug_error("Can not add available route changed callback\n"); + } + + debug_fleave(); + return ret; +} + +EXPORT_API +int mm_sound_remove_available_route_changed_callback(void) +{ + int ret = MM_ERROR_NONE; + + debug_fenter(); + + ret = _mm_sound_client_remove_available_route_changed_callback(); + if (ret < 0) { + debug_error("Can not remove available route changed callback\n"); + } + + debug_fleave(); + return ret; +} + +__attribute__ ((destructor)) +void __mmfsnd_finalize(void) +{ + debug_fenter(); + + MMSoundClientCallbackFini(); + + debug_fleave(); +} + +__attribute__ ((constructor)) +void __mmfsnd_initialize(void) +{ + /* Will be Fixed */ +} diff --git a/mm_sound_client.c b/mm_sound_client.c new file mode 100644 index 0000000..c4aacc9 --- /dev/null +++ b/mm_sound_client.c @@ -0,0 +1,1436 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include "include/mm_sound.h" +#include "include/mm_sound_msg.h" +#include "include/mm_sound_client.h" + +#include +#include + +#define __DIRECT_CALLBACK__ +//#define __GIDLE_CALLBACK__ + +#include +#if defined(__GSOURCE_CALLBACK__) +#include +#endif + +#define MEMTYPE_SUPPORT_MAX (1024 * 1024) /* 1MB */ +#define MEMTYPE_TRANS_PER_MAX (128 * 1024) /* 128K */ + + +int g_msg_scsnd; /* global msg queue id sound client snd */ +int g_msg_scrcv; /* global msg queue id sound client rcv */ +int g_msg_sccb; /* global msg queue id sound client callback */ + +/* callback */ +struct __callback_param +{ + mm_sound_stop_callback_func callback; + void *data; +}; + +pthread_t g_thread; +static int g_exit_thread = 0; +int g_thread_id = -1; +int g_mutex_initted = -1; +pthread_mutex_t g_thread_mutex; + +static void* callbackfunc(void *param); + +/* manage IPC (msg contorl) */ +static int __MMIpcCBSndMsg(mm_ipc_msg_t *msg); +static int __MMIpcRecvMsg(int msgtype, mm_ipc_msg_t *msg); +static int __MMIpcSndMsg(mm_ipc_msg_t *msg); +static int __MMIpcCBRecvMsg(int msgtype, mm_ipc_msg_t *msg); +static int __MMSoundGetMsg(void); + +int MMSoundClientInit(void) +{ + int ret = MM_ERROR_NONE; + debug_fenter(); + + debug_fleave(); + return ret; +} + +int MMSoundClientCallbackFini(void) +{ + mm_ipc_msg_t msgsnd={0,}; + int ret = MM_ERROR_NONE; + + debug_fenter(); + + /* When the the callback thread is not created, do not wait destory thread */ + /* g_thread_id is initialized : -1 */ + /* g_thread_id is set to 0, when the callback thread is created */ + if (g_thread_id != -1) + { + msgsnd.sound_msg.msgtype = MM_SOUND_MSG_INF_DESTROY_CB; + msgsnd.sound_msg.msgid = getpid(); + ret = __MMIpcCBSndMsg(&msgsnd); + if (ret != MM_ERROR_NONE) + { + debug_critical("[Client] Fail to send message\n"); + } + /* wait for leave callback thread */ + while (g_exit_thread == 0) + usleep(30000); + g_exit_thread = 0; + } + + if (g_mutex_initted != -1) + { + pthread_mutex_destroy(&g_thread_mutex); + g_mutex_initted = -1; + } + debug_fleave(); + return MM_ERROR_NONE; +} + +#if defined(__GSOURCE_CALLBACK__) +gboolean sndcb_fd_check(GSource * source) +{ + GSList *fd_list; + fd_list = source->poll_fds; + GPollFD* temp; + + do + { + temp = (GPollFD*)fd_list->data; + if (temp->revents & (POLLIN|POLLPRI)) + return TRUE; + fd_list = fd_list->next; + }while(fd_list); + + return FALSE; /* there is no change in any fd state */ +} + +gboolean sndcb_fd_prepare(GSource *source, gint *timeout) +{ + return FALSE; +} + +gboolean sndcb_fd_dispatch(GSource *source, GSourceFunc callback, gpointer user_data) +{ + callback(user_data); + return TRUE; +} +#endif +gboolean RunCallback(gpointer *data) +{ + mm_ipc_msg_t* msg = NULL; + + debug_msg("[Client] execute mm_sound stop callback function\n"); + + msg = (mm_ipc_msg_t*)data; + ((mm_sound_stop_callback_func)msg->sound_msg.callback)(msg->sound_msg.cbdata); + + return FALSE; +} + +static void* callbackfunc(void *param) +{ + int ret = MM_ERROR_SOUND_INTERNAL; + mm_ipc_msg_t *msgrcv = NULL; + int run = 1; + int instance; + + debug_fenter(); + + instance = getpid(); + debug_msg("[Client] callback thread for [%d] is created\n", instance); + + msgrcv = (mm_ipc_msg_t*)malloc(sizeof(mm_ipc_msg_t)); + if(NULL == msgrcv) + { + debug_critical("[Client] Failed to memory allocation\n"); + return NULL; + } + + while(run) + { +#if defined(__GSOURCE_CALLBACK__) + int eventFd = 0; + gchar* eventFile = NULL; + GSource* cmd_fd_gsrc = NULL; + GSourceFuncs *src_funcs = NULL; // handler function + guint gsource_handle; + GPollFD *g_fd_cmd = NULL; // file descriptor +#endif + + debug_warning("[Client] Waiting message\n"); + ret = __MMIpcCBRecvMsg(instance, msgrcv); + if (ret != MM_ERROR_NONE) + { + debug_error("[Client] Fail to receive msg in callback\n"); + continue; + } + + debug_msg("[Client] Receive msgtype : [%d]\n", msgrcv->sound_msg.msgtype); + + switch (msgrcv->sound_msg.msgtype) + { + case MM_SOUND_MSG_INF_STOP_CB: + debug_msg("[Client] callback : %p\n", msgrcv->sound_msg.callback); + debug_msg("[Client] data : %p\n", msgrcv->sound_msg.cbdata); + + if (msgrcv->sound_msg.callback) + { +#if defined(__DIRECT_CALLBACK__) + ((mm_sound_stop_callback_func)msgrcv->sound_msg.callback)(msgrcv->sound_msg.cbdata); +#elif defined(__GIDLE_CALLBACK__) + guint eventid = 0; + eventid = g_idle_add((GSourceFunc)RunCallback, (gpointer)msgrcv); + debug_msg("[Client] Event Source ID : %d\n", eventid); + +#elif defined(__GSOURCE_CALLBACK__) + char eventBuf[3]="OK"; + //////////////////////// + // 0. Make event source + eventFile = g_strdup_printf("/tmp/%d_0x%08x_0x%08x", instance, (unsigned int)msgrcv->sound_msg.callback, (unsigned int)msgrcv->sound_msg.cbdata); + eventFd = open(eventFile, O_RDWR|O_CREAT); + if(eventFd == -1) + { + debug_critical("Event File creation failed\n"); + break; + } + + // 1. make GSource Object + src_funcs = (GSourceFuncs *)g_malloc(sizeof(GSourceFuncs)); + if(!src_funcs){ + debug_error("MMSoundCallback : g_malloc failed on g_src_funcs"); + break; + } + src_funcs->prepare = sndcb_fd_prepare; + src_funcs->check = sndcb_fd_check; + src_funcs->dispatch = sndcb_fd_dispatch; + src_funcs->finalize = NULL; + cmd_fd_gsrc = g_source_new(src_funcs,sizeof(GSource)); + if(!cmd_fd_gsrc){ + debug_error("MMSoundCallback : g_malloc failed on m_readfd"); + break; + } + + // 2. add file description which used in g_loop() + g_fd_cmd = (GPollFD*)g_malloc(sizeof(GPollFD)); + g_fd_cmd->fd = eventFd; + g_fd_cmd->events = POLLIN|POLLPRI; + + // 3. combine g_source object and file descriptor + g_source_add_poll(cmd_fd_gsrc,g_fd_cmd); + gsource_handle = g_source_attach(cmd_fd_gsrc, NULL); + if(!gsource_handle){ + debug_error("MMSoundCallback : Error: Failed to attach the source to context"); + break; + } + + // 4. set callback + g_source_set_callback(cmd_fd_gsrc,RunCallback,(gpointer)g_fd_cmd,NULL); + debug_msg("MMSoundCallback : g_source_set_callback() done\n") + + // 5. Set Event + write(eventFd, eventBuf, sizeof(eventBuf)); + sleep(1); + // 6. Cleanup + close(eventFd); + unlink(eventFile); + g_source_remove_poll(cmd_fd_gsrc, g_fd_cmd); + g_source_remove(gsource_handle); + if(g_fd_cmd) + free(g_fd_cmd); + if(src_funcs) + free(src_funcs); + if(eventFile) + g_free(eventFile); + //////////////////////// +#endif + } + break; + case MM_SOUND_MSG_INF_DESTROY_CB: + run = 0; + break; + + case MM_SOUND_MSG_INF_ACTIVE_DEVICE_CB: + debug_msg("[Client] device_in : %p\n", msgrcv->sound_msg.device_in); + debug_msg("[Client] device_out : %p\n", msgrcv->sound_msg.device_out); + debug_msg("[Client] callback : %p\n", msgrcv->sound_msg.callback); + debug_msg("[Client] data : %p\n", msgrcv->sound_msg.cbdata); + + if (msgrcv->sound_msg.callback) + { + ((mm_sound_active_device_changed_cb)msgrcv->sound_msg.callback)(msgrcv->sound_msg.device_in, msgrcv->sound_msg.device_out, msgrcv->sound_msg.cbdata); + } + break; + case MM_SOUND_MSG_INF_AVAILABLE_ROUTE_CB: + debug_msg("[Client] callback : %p\n", msgrcv->sound_msg.callback); + debug_msg("[Client] data : %p\n", msgrcv->sound_msg.cbdata); + + if (msgrcv->sound_msg.callback) + { + int route_index; + mm_sound_route route; + + for (route_index = 0; route_index < sizeof(msgrcv->sound_msg.route_list) / sizeof(int); route_index++) { + route = msgrcv->sound_msg.route_list[route_index]; + if (route == 0) + break; + if (msgrcv->sound_msg.is_available) { + debug_msg("[Client] available route : %d\n", route); + } else { + debug_msg("[Client] unavailable route : %d\n", route); + } + ((mm_sound_available_route_changed_cb)msgrcv->sound_msg.callback)(route, msgrcv->sound_msg.is_available, msgrcv->sound_msg.cbdata); + } + } + break; + default: + /* Unexpected msg */ + debug_msg("Receive wrong msg in callback func\n"); + break; + } + } + if(msgrcv) + free(msgrcv); + + g_exit_thread = 1; + debug_msg("[Client] callback [%d] is leaved\n", instance); + debug_fleave(); + return NULL; +} + +static int __mm_sound_client_get_msg_queue(void) +{ + int ret = MM_ERROR_NONE; + + if (g_mutex_initted == -1) + { + pthread_mutex_init(&g_thread_mutex, NULL); + debug_msg("[Client] mutex initialized. \n"); + g_mutex_initted = 1; + + /* Get msg queue id */ + ret = __MMSoundGetMsg(); + if(ret != MM_ERROR_NONE) + { + debug_critical("[Client] Fail to get message queue id\n"); + } + } + + return ret; +} + +int MMSoundClientPlayTone(int number, int volume_config, double volume, int time, int *handle) +{ + mm_ipc_msg_t msgrcv = {0,}; + mm_ipc_msg_t msgsnd = {0,}; + + int ret = MM_ERROR_NONE; + int instance = -1; /* instance is unique to communicate with server : client message queue filter type */ + + debug_fenter(); + + if (__mm_sound_client_get_msg_queue() != MM_ERROR_NONE) + return ret; + + /* read mm-session type */ + int sessionType = MM_SESSION_TYPE_SHARE; + if(MM_ERROR_NONE != _mm_session_util_read_type(-1, &sessionType)) + { + debug_warning("[Client] Read MMSession Type failed. use default \"share\" type\n"); + sessionType = MM_SESSION_TYPE_SHARE; + + if(MM_ERROR_NONE != mm_session_init(sessionType)) + { + debug_critical("[Client] MMSessionInit() failed\n"); + return MM_ERROR_POLICY_INTERNAL; + } + } + + instance = getpid(); + debug_msg("[Client] pid for client ::: [%d]\n", instance); + + pthread_mutex_lock(&g_thread_mutex); + + /* Send msg */ + debug_msg("[Client] Input number : %d\n", number); + /* Send req memory */ + msgsnd.sound_msg.msgtype = MM_SOUND_MSG_REQ_DTMF; + msgsnd.sound_msg.msgid = instance; + msgsnd.sound_msg.session_type = sessionType;//asm_session_type; + msgsnd.sound_msg.volume = volume;//This does not effect anymore + msgsnd.sound_msg.volume_config = volume_config; + msgsnd.sound_msg.tone = number; + msgsnd.sound_msg.handle = -1; + msgsnd.sound_msg.repeat = time; + + ret = __MMIpcSndMsg(&msgsnd); + if (ret != MM_ERROR_NONE) + { + debug_error("[Client] Fail to send msg\n"); + goto cleanup; + } + + /* Receive */ + ret = __MMIpcRecvMsg(instance, &msgrcv); + if (ret != MM_ERROR_NONE) + { + debug_error("[Client] Fail to recieve msg\n"); + goto cleanup; + } + + switch (msgrcv.sound_msg.msgtype) + { + case MM_SOUND_MSG_RES_DTMF: + *handle = msgrcv.sound_msg.handle; + if(*handle == -1) + debug_error("[Client] The handle is not get\n"); + + debug_msg("[Client] Success to play sound sound handle : [%d]\n", *handle); + break; + case MM_SOUND_MSG_RES_ERROR: + debug_error("[Client] Error occurred \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + default: + debug_critical("[Client] Unexpected state with communication \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + } +cleanup: + pthread_mutex_unlock(&g_thread_mutex); + + debug_fleave(); + return ret; +} + + +int MMSoundClientPlaySound(MMSoundPlayParam *param, int tone, int keytone, int *handle) +{ + mm_ipc_msg_t msgrcv = {0,}; + mm_ipc_msg_t msgsnd = {0,}; + unsigned char* sharedmem = NULL; + + int ret = MM_ERROR_NONE; + int instance = -1; /* instance is unique to communicate with server : client message queue filter type */ + + char shm_name[512]; + void *mmap_buf = NULL; + static int keybase = 0; + int shm_fd = -1; + + debug_fenter(); + memset(shm_name, 0, sizeof(shm_name)); + + ret = __mm_sound_client_get_msg_queue(); + if (ret != MM_ERROR_NONE) + return ret; + + /* read mm-session type */ + int sessionType = MM_SESSION_TYPE_SHARE; + if(MM_ERROR_NONE != _mm_session_util_read_type(-1, &sessionType)) + { + debug_warning("[Client] Read MMSession Type failed. use default \"share\" type\n"); + sessionType = MM_SESSION_TYPE_SHARE; + + if(MM_ERROR_NONE != mm_session_init(sessionType)) + { + debug_critical("[Client] MMSessionInit() failed\n"); + return MM_ERROR_POLICY_INTERNAL; + } + } + + + instance = getpid(); + debug_msg("[Client] pid for client ::: [%d]\n", instance); + + /* callback */ + /* callback thread is created just once & when the callback is exist */ + if (param->callback) + { + if (g_thread_id == -1) + { + g_thread_id = pthread_create(&g_thread, NULL, callbackfunc, NULL); + if (g_thread_id == -1) + { + debug_critical("[Client] Fail to create thread %s\n", strerror(errno)); + return MM_ERROR_SOUND_INTERNAL; + } + } + } + + pthread_mutex_lock(&g_thread_mutex); + + /* Send msg */ + if ((param->mem_ptr && param->mem_size)) + { + debug_msg("The memptr : [%p]\n", param->mem_ptr); + debug_msg("The memptr : [%d]\n", param->mem_size); + /* Limitted memory size */ + if (param->mem_ptr && param->mem_size > MEMTYPE_SUPPORT_MAX) + { + debug_msg("[Client] Memory size is too big. We support size of media to 1MB\n"); + goto cleanup; + } + + debug_msg("[Client] memory size : %d\n", param->mem_size); + snprintf(shm_name, sizeof(shm_name)-1, "%d_%d", instance, keybase); + debug_msg("[Client] The shm_path : [%s]\n", shm_name); + keybase++; + + shm_fd = shm_open(shm_name, O_RDWR |O_CREAT, 0666); + if(shm_fd < 0) + { + perror("[Client] Fail create shm_open\n"); + debug_error("[Client] Fail to create shm_open\n"); + goto cleanup; + } + + if(ftruncate(shm_fd, param->mem_size) == -1) + { + debug_error("[Client] Fail to ftruncate\n"); + goto cleanup; + } + + mmap_buf = mmap (0, MEMTYPE_SUPPORT_MAX, PROT_READ | PROT_WRITE, MAP_SHARED, shm_fd, 0); + if (mmap_buf == MAP_FAILED) + { + debug_error("[Client] MMAP failed \n"); + goto cleanup; + } + + sharedmem = mmap_buf; + + if(ret != MM_ERROR_NONE) + { + debug_error("[Client] Not allocated shared memory"); + goto cleanup; + } + debug_msg("[Client] Sheared mem ptr : %p\n", sharedmem); + debug_msg("[Client] Sheared key : [%d]\n", 1); + /* Send req memory */ + msgsnd.sound_msg.msgtype = MM_SOUND_MSG_REQ_MEMORY; + msgsnd.sound_msg.msgid = instance; + msgsnd.sound_msg.callback = (void*)(param->callback); + msgsnd.sound_msg.cbdata = (void*)(param->data); + msgsnd.sound_msg.memptr = (int)sharedmem; + msgsnd.sound_msg.sharedkey = 1; /* In case of shared memory file name */ + msgsnd.sound_msg.session_type = sessionType;//asm_session_type; + msgsnd.sound_msg.priority = param->priority; + + + strncpy(msgsnd.sound_msg.filename, shm_name, 512); + debug_msg("[Client] shm_name : %s\n", msgsnd.sound_msg.filename); + + msgsnd.sound_msg.memsize = param->mem_size; + msgsnd.sound_msg.volume = param->volume; + msgsnd.sound_msg.tone = tone; + msgsnd.sound_msg.handle = -1; + msgsnd.sound_msg.repeat = param->loop; + msgsnd.sound_msg.volume_config = param->volume_config; + msgsnd.sound_msg.keytone = keytone; + msgsnd.sound_msg.handle_route = param->handle_route; + + /* Send req memory */ + debug_msg("[Client] Shared mem ptr %p, %p, size %d\n", sharedmem, param->mem_ptr, param->mem_size); + memcpy(sharedmem, param->mem_ptr, param->mem_size); + + + if (close(shm_fd) == -1) + { + debug_error("[Client] Fail to close file\n"); + ret = MM_ERROR_SOUND_INTERNAL; + goto cleanup; + } + + ret = __MMIpcSndMsg(&msgsnd); + if (ret != MM_ERROR_NONE) + { + debug_error("[Client] Fail to send msg\n"); + goto cleanup; + } + } + else + { + /* File type set for send msg */ + msgsnd.sound_msg.msgtype = MM_SOUND_MSG_REQ_FILE; + msgsnd.sound_msg.msgid = instance; + msgsnd.sound_msg.callback = (void*)(param->callback); + msgsnd.sound_msg.cbdata = (void*)(param->data); + msgsnd.sound_msg.volume = param->volume; + msgsnd.sound_msg.tone = tone; + msgsnd.sound_msg.handle = -1; + msgsnd.sound_msg.repeat = param->loop; + msgsnd.sound_msg.volume_config = param->volume_config; + msgsnd.sound_msg.session_type = sessionType;//asm_session_type; + msgsnd.sound_msg.priority = param->priority; + msgsnd.sound_msg.handle_route = param->handle_route; + + if((strlen(param->filename)) < FILE_PATH) + { + strncpy(msgsnd.sound_msg.filename, param->filename, sizeof(msgsnd.sound_msg.filename)-1); + } + else + { + debug_error("File name is over count\n"); + ret = MM_ERROR_SOUND_INVALID_PATH; + } + + msgsnd.sound_msg.keytone = keytone; + + debug_msg("[Client] callback : %p\n", msgsnd.sound_msg.callback); + debug_msg("[Client] cbdata : %p\n", msgsnd.sound_msg.cbdata); + + ret = __MMIpcSndMsg(&msgsnd); + if (ret != MM_ERROR_NONE) + { + debug_error("[Client] Fail to send msg\n"); + goto cleanup; + } + } + + + /* Receive */ + ret = __MMIpcRecvMsg(instance, &msgrcv); + if (ret != MM_ERROR_NONE) + { + debug_error("[Client] Fail to recieve msg\n"); + goto cleanup; + } + + switch (msgrcv.sound_msg.msgtype) + { + case MM_SOUND_MSG_RES_FILE: + *handle = msgrcv.sound_msg.handle; + debug_msg("[Client] Success to play sound sound handle : [%d]\n", *handle); + break; + case MM_SOUND_MSG_RES_MEMORY: + *handle = msgrcv.sound_msg.handle; + if(*handle == -1) + debug_error("[Client] The handle is not get\n"); + + shm_unlink(shm_name); + if (ret != MM_ERROR_NONE) + { + debug_critical("[Client] Fail to remove shared memory, must be checked\n"); + goto cleanup; + } + debug_msg("[Client] Success to play sound sound handle : [%d]\n", *handle); + break; + case MM_SOUND_MSG_RES_ERROR: + debug_error("[Client] Error occurred \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + default: + debug_critical("[Client] Unexpected state with communication \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + } +cleanup: + pthread_mutex_unlock(&g_thread_mutex); + + debug_fleave(); + return ret; +} + +int MMSoundClientStopSound(int handle) +{ + mm_ipc_msg_t msgrcv = {0,}; + mm_ipc_msg_t msgsnd = {0,}; + int ret = MM_ERROR_NONE; + int instance; + + debug_fenter(); + debug_msg("[Client] The stop audio handle ::: [%d]\n", handle); + + instance = getpid(); + + if (handle < 0) + { + ret = MM_ERROR_INVALID_ARGUMENT; + return ret; + } + + if (__mm_sound_client_get_msg_queue() != MM_ERROR_NONE) + return ret; + + pthread_mutex_lock(&g_thread_mutex); + + /* Send req STOP */ + msgsnd.sound_msg.msgtype = MM_SOUND_MSG_REQ_STOP; + msgsnd.sound_msg.msgid = instance; + msgsnd.sound_msg.handle = handle; /* handle means audio handle slot id */ + + ret = __MMIpcSndMsg(&msgsnd); + if (ret != MM_ERROR_NONE) + { + debug_error("Fail to send msg\n"); + goto cleanup; + } + + /* Recieve */ + ret = __MMIpcRecvMsg(instance, &msgrcv); + if (ret != MM_ERROR_NONE) + { + debug_error("[Client] Fail to recieve msg\n"); + goto cleanup; + } + switch (msgrcv.sound_msg.msgtype) + { + case MM_SOUND_MSG_RES_STOP: + debug_msg("[Client] Success to stop sound\n"); + break; + case MM_SOUND_MSG_RES_ERROR: + debug_error("[Client] Error occurred \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + default: + debug_critical("[Client] Unexpected state with communication \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + } + +cleanup: + pthread_mutex_unlock(&g_thread_mutex); + + + debug_fleave(); + return ret; +} + +int _mm_sound_client_is_route_available(mm_sound_route route, bool *is_available) +{ + mm_ipc_msg_t msgrcv = {0,}; + mm_ipc_msg_t msgsnd = {0,}; + int ret = MM_ERROR_NONE; + int instance; + + debug_fenter(); + + *is_available = FALSE; + + if (__mm_sound_client_get_msg_queue() != MM_ERROR_NONE) + return ret; + + pthread_mutex_lock(&g_thread_mutex); + + instance = getpid(); + /* Send REQ_IS_ROUTE_AVAILABLE */ + msgsnd.sound_msg.msgtype = MM_SOUND_MSG_REQ_IS_ROUTE_AVAILABLE; + msgsnd.sound_msg.msgid = instance; + msgsnd.sound_msg.route = route; + + if (__MMIpcSndMsg(&msgsnd) != MM_ERROR_NONE) + goto cleanup; + + /* Recieve */ + if (__MMIpcRecvMsg(instance, &msgrcv) != MM_ERROR_NONE) + goto cleanup; + + switch (msgrcv.sound_msg.msgtype) + { + case MM_SOUND_MSG_RES_IS_ROUTE_AVAILABLE: + *is_available = msgrcv.sound_msg.is_available; + debug_msg("[Client] Success to check given route is available %d\n", *is_available); + break; + case MM_SOUND_MSG_RES_ERROR: + debug_error("[Client] Error occurred \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + default: + debug_critical("[Client] Unexpected state with communication \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + } + +cleanup: + pthread_mutex_unlock(&g_thread_mutex); + + debug_fleave(); + return ret; +} + +static int _handle_foreach_callback(mm_ipc_msg_t *msg) +{ + int route_index; + mm_sound_route route; + + debug_fenter(); + + if (msg->sound_msg.callback == NULL) { + debug_error ("[Client] Foreach callback is [%p], cbdata = %p => exit", + msg->sound_msg.callback, msg->sound_msg.cbdata); + return MM_ERROR_SOUND_INTERNAL; + } + + for (route_index = 0; route_index < MM_SOUND_ROUTE_NUM; route_index++) { + route = msg->sound_msg.route_list[route_index]; + if (route == 0) + break; + debug_msg("[Client] available route : %d\n", route); + if (((mm_sound_available_route_cb)msg->sound_msg.callback)(route, msg->sound_msg.cbdata) == false) { + debug_msg ("[Client] user doesn't want anymore. quit loop!!\n"); + break; + } + } + + debug_fleave(); + + return MM_ERROR_NONE; +} + +int _mm_sound_client_foreach_available_route_cb(mm_sound_available_route_cb available_route_cb, void *user_data) +{ + mm_ipc_msg_t msgrcv = {0,}; + mm_ipc_msg_t msgsnd = {0,}; + int ret = MM_ERROR_NONE; + int instance; + + debug_fenter(); + + if (__mm_sound_client_get_msg_queue() != MM_ERROR_NONE) + return ret; + + pthread_mutex_lock(&g_thread_mutex); + + instance = getpid(); + /* Send REQ_FOREACH_AVAILABLE_ROUTE_CB */ + msgsnd.sound_msg.msgtype = MM_SOUND_MSG_REQ_FOREACH_AVAILABLE_ROUTE_CB; + msgsnd.sound_msg.msgid = instance; + msgsnd.sound_msg.callback = (void *)available_route_cb; + msgsnd.sound_msg.cbdata = (void *)user_data; + + if (__MMIpcSndMsg(&msgsnd) != MM_ERROR_NONE) + goto cleanup; + + /* Recieve */ + if (__MMIpcRecvMsg(instance, &msgrcv) != MM_ERROR_NONE) + goto cleanup; + + switch (msgrcv.sound_msg.msgtype) + { + case MM_SOUND_MSG_RES_FOREACH_AVAILABLE_ROUTE_CB: + debug_msg("[Client] Success to set foreach available route callback\n"); + msgrcv.sound_msg.callback = (void *)available_route_cb; + msgrcv.sound_msg.cbdata = (void *)user_data; + ret = _handle_foreach_callback (&msgrcv); + break; + case MM_SOUND_MSG_RES_ERROR: + debug_error("[Client] Error occurred \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + default: + debug_critical("[Client] Unexpected state with communication \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + } + +cleanup: + pthread_mutex_unlock(&g_thread_mutex); + + debug_fleave(); + return ret; +} + +int _mm_sound_client_set_active_route(mm_sound_route route) +{ + mm_ipc_msg_t msgrcv = {0,}; + mm_ipc_msg_t msgsnd = {0,}; + int ret = MM_ERROR_NONE; + int instance; + + debug_fenter(); + + if (__mm_sound_client_get_msg_queue() != MM_ERROR_NONE) + return ret; + + pthread_mutex_lock(&g_thread_mutex); + + instance = getpid(); + /* Send REQ_SET_ACTIVE_ROUTE */ + msgsnd.sound_msg.msgtype = MM_SOUND_MSG_REQ_SET_ACTIVE_ROUTE; + msgsnd.sound_msg.msgid = instance; + msgsnd.sound_msg.route = route; + + if (__MMIpcSndMsg(&msgsnd) != MM_ERROR_NONE) + goto cleanup; + + /* Recieve */ + if (__MMIpcRecvMsg(instance, &msgrcv) != MM_ERROR_NONE) + goto cleanup; + + switch (msgrcv.sound_msg.msgtype) + { + case MM_SOUND_MSG_RES_SET_ACTIVE_ROUTE: + debug_msg("[Client] Success to add active device callback\n"); + break; + case MM_SOUND_MSG_RES_ERROR: + debug_error("[Client] Error occurred \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + default: + debug_critical("[Client] Unexpected state with communication \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + } + +cleanup: + pthread_mutex_unlock(&g_thread_mutex); + + debug_fleave(); + return ret; +} + +int _mm_sound_client_get_active_device(mm_sound_device_in *device_in, mm_sound_device_out *device_out) +{ + mm_ipc_msg_t msgrcv = {0,}; + mm_ipc_msg_t msgsnd = {0,}; + int ret = MM_ERROR_NONE; + int instance; + + debug_fenter(); + + if (__mm_sound_client_get_msg_queue() != MM_ERROR_NONE) + return ret; + + pthread_mutex_lock(&g_thread_mutex); + + instance = getpid(); + /* Send REQ_GET_ACTIVE_DEVICE */ + msgsnd.sound_msg.msgtype = MM_SOUND_MSG_REQ_GET_ACTIVE_DEVICE; + msgsnd.sound_msg.msgid = instance; + + if (__MMIpcSndMsg(&msgsnd) != MM_ERROR_NONE) + goto cleanup; + + /* Recieve */ + if (__MMIpcRecvMsg(instance, &msgrcv) != MM_ERROR_NONE) + goto cleanup; + + switch (msgrcv.sound_msg.msgtype) + { + case MM_SOUND_MSG_RES_GET_ACTIVE_DEVICE: + *device_in = msgrcv.sound_msg.device_in; + *device_out = msgrcv.sound_msg.device_out; + debug_msg("[Client] Success to get active device %d %d\n", *device_in, *device_out); + break; + case MM_SOUND_MSG_RES_ERROR: + debug_error("[Client] Error occurred \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + default: + debug_critical("[Client] Unexpected state with communication \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + } + +cleanup: + pthread_mutex_unlock(&g_thread_mutex); + + debug_fleave(); + return ret; +} + +int _mm_sound_client_add_active_device_changed_callback(mm_sound_active_device_changed_cb func, void* user_data) +{ + mm_ipc_msg_t msgrcv = {0,}; + mm_ipc_msg_t msgsnd = {0,}; + int ret = MM_ERROR_NONE; + int instance; + + debug_fenter(); + + if (__mm_sound_client_get_msg_queue() != MM_ERROR_NONE) + return ret; + + pthread_mutex_lock(&g_thread_mutex); + + instance = getpid(); + /* Send REQ_ADD_ACTIVE_DEVICE_CB */ + msgsnd.sound_msg.msgtype = MM_SOUND_MSG_REQ_ADD_ACTIVE_DEVICE_CB; + msgsnd.sound_msg.msgid = instance; + msgsnd.sound_msg.callback = func; + msgsnd.sound_msg.cbdata = user_data; + + if (__MMIpcSndMsg(&msgsnd) != MM_ERROR_NONE) + goto cleanup; + + /* Recieve */ + if (__MMIpcRecvMsg(instance, &msgrcv) != MM_ERROR_NONE) + goto cleanup; + + switch (msgrcv.sound_msg.msgtype) + { + case MM_SOUND_MSG_RES_ADD_ACTIVE_DEVICE_CB: + debug_msg("[Client] Success to add active device callback\n"); + if (g_thread_id == -1) + { + g_thread_id = pthread_create(&g_thread, NULL, callbackfunc, NULL); + if (g_thread_id == -1) + { + debug_critical("[Client] Fail to create thread %s\n", strerror(errno)); + ret = MM_ERROR_SOUND_INTERNAL; + goto cleanup; + } + } + break; + case MM_SOUND_MSG_RES_ERROR: + debug_error("[Client] Error occurred \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + default: + debug_critical("[Client] Unexpected state with communication \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + } + +cleanup: + pthread_mutex_unlock(&g_thread_mutex); + + debug_fleave(); + return ret; +} + +int _mm_sound_client_remove_active_device_changed_callback(void) +{ + mm_ipc_msg_t msgrcv = {0,}; + mm_ipc_msg_t msgsnd = {0,}; + int ret = MM_ERROR_NONE; + int instance; + + debug_fenter(); + + if (__mm_sound_client_get_msg_queue() != MM_ERROR_NONE) + return ret; + + pthread_mutex_lock(&g_thread_mutex); + + instance = getpid(); + /* Send REQ_REMOVE_ACTIVE_DEVICE_CB */ + msgsnd.sound_msg.msgtype = MM_SOUND_MSG_REQ_REMOVE_ACTIVE_DEVICE_CB; + msgsnd.sound_msg.msgid = instance; + + if (__MMIpcSndMsg(&msgsnd) != MM_ERROR_NONE) + goto cleanup; + + /* Recieve */ + if (__MMIpcRecvMsg(instance, &msgrcv) != MM_ERROR_NONE) + goto cleanup; + + switch (msgrcv.sound_msg.msgtype) + { + case MM_SOUND_MSG_RES_REMOVE_ACTIVE_DEVICE_CB: + debug_msg("[Client] Success to remove active device callback\n"); + break; + case MM_SOUND_MSG_RES_ERROR: + debug_error("[Client] Error occurred \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + default: + debug_critical("[Client] Unexpected state with communication \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + } + +cleanup: + pthread_mutex_unlock(&g_thread_mutex); + + debug_fleave(); + return ret; +} + +int _mm_sound_client_add_available_route_changed_callback(mm_sound_available_route_changed_cb func, void* user_data) +{ + mm_ipc_msg_t msgrcv = {0,}; + mm_ipc_msg_t msgsnd = {0,}; + int ret = MM_ERROR_NONE; + int instance; + + debug_fenter(); + + if (__mm_sound_client_get_msg_queue() != MM_ERROR_NONE) + return ret; + + pthread_mutex_lock(&g_thread_mutex); + + instance = getpid(); + /* Send REQ_ADD_AVAILABLE_ROUTE_CB */ + msgsnd.sound_msg.msgtype = MM_SOUND_MSG_REQ_ADD_AVAILABLE_ROUTE_CB; + msgsnd.sound_msg.msgid = instance; + msgsnd.sound_msg.callback = func; + msgsnd.sound_msg.cbdata = user_data; + + if (__MMIpcSndMsg(&msgsnd) != MM_ERROR_NONE) + goto cleanup; + + /* Recieve */ + if (__MMIpcRecvMsg(instance, &msgrcv) != MM_ERROR_NONE) + goto cleanup; + + switch (msgrcv.sound_msg.msgtype) + { + case MM_SOUND_MSG_RES_ADD_AVAILABLE_ROUTE_CB: + debug_msg("[Client] Success to add available route callback\n"); + if (g_thread_id == -1) + { + g_thread_id = pthread_create(&g_thread, NULL, callbackfunc, NULL); + if (g_thread_id == -1) + { + debug_critical("[Client] Fail to create thread %s\n", strerror(errno)); + ret = MM_ERROR_SOUND_INTERNAL; + goto cleanup; + } + } + break; + case MM_SOUND_MSG_RES_ERROR: + debug_error("[Client] Error occurred \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + default: + debug_critical("[Client] Unexpected state with communication \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + } + +cleanup: + pthread_mutex_unlock(&g_thread_mutex); + + debug_fleave(); + return ret; +} + +int _mm_sound_client_remove_available_route_changed_callback(void) +{ + mm_ipc_msg_t msgrcv = {0,}; + mm_ipc_msg_t msgsnd = {0,}; + int ret = MM_ERROR_NONE; + int instance; + + debug_fenter(); + + if (__mm_sound_client_get_msg_queue() != MM_ERROR_NONE) + return ret; + + pthread_mutex_lock(&g_thread_mutex); + + instance = getpid(); + /* Send REQ_REMOVE_AVAILABLE_ROUTE_CB */ + msgsnd.sound_msg.msgtype = MM_SOUND_MSG_REQ_REMOVE_AVAILABLE_ROUTE_CB; + msgsnd.sound_msg.msgid = instance; + + if (__MMIpcSndMsg(&msgsnd) != MM_ERROR_NONE) + goto cleanup; + + /* Recieve */ + if (__MMIpcRecvMsg(instance, &msgrcv) != MM_ERROR_NONE) + goto cleanup; + + switch (msgrcv.sound_msg.msgtype) + { + case MM_SOUND_MSG_RES_REMOVE_AVAILABLE_ROUTE_CB: + debug_msg("[Client] Success to remove available route callback\n"); + break; + case MM_SOUND_MSG_RES_ERROR: + debug_error("[Client] Error occurred \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + default: + debug_critical("[Client] Unexpected state with communication \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + } + +cleanup: + pthread_mutex_unlock(&g_thread_mutex); + + debug_fleave(); + return ret; +} + +static int __MMIpcCBSndMsg(mm_ipc_msg_t *msg) +{ + /* rcv message */ + msg->msg_type = msg->sound_msg.msgid; + if (msgsnd(g_msg_sccb, msg,DSIZE, 0)== -1) + { + if(errno == EACCES) + { + debug_warning("[Client] Not acces.\n"); + } + else if(errno == EAGAIN) + { + debug_warning("[Client] Blocked process [msgflag & IPC_NOWAIT != 0]\n"); + } + else if(errno == EIDRM) + { + debug_warning("[Client] Removed msgid from system\n"); + } + else if(errno == EINTR) + { + debug_warning("[Client] Iterrrupted by singnal\n"); + } + else if(errno == EINVAL) + { + debug_warning("[Client] Invalid msgid or msgtype < 1 or out of data size \n"); + } + debug_critical("[Client] Fail to callback send message msgid : [%d] \n", g_msg_sccb); + return MM_ERROR_COMMON_UNKNOWN; + } + return MM_ERROR_NONE; +} + +static int __MMIpcCBRecvMsg(int msgtype, mm_ipc_msg_t *msg) +{ + /* rcv message */ + if(msgrcv(g_msg_sccb, msg, DSIZE, msgtype, 0) == -1) + { + if(errno == E2BIG) + { + debug_warning("[Client] Not acces.\n"); + } + else if(errno == EACCES) + { + debug_warning("[Client] Access denied\n"); + } + else if(errno == ENOMSG) + { + debug_warning("[Client] Blocked process [msgflag & IPC_NOWAIT != 0]\n"); + } + else if(errno == EIDRM) + { + debug_warning("[Client] Removed msgid from system\n"); + } + else if(errno == EINTR) + { + debug_warning("[Client] Iterrrupted by singnal\n"); + } + else if(errno == EINVAL) + { + debug_warning("[Client] Invalid msgid \n"); + } + + debug_error("[Client] Fail to callback receive msgid : [%d] \n", g_msg_sccb); + return MM_ERROR_COMMON_UNKNOWN; + } + return MM_ERROR_NONE; +} + +static int __MMIpcRecvMsg(int msgtype, mm_ipc_msg_t *msg) +{ + int retry_count = 0; + + /* rcv message */ + while (msgrcv(g_msg_scrcv, msg, DSIZE, msgtype, IPC_NOWAIT) == -1) { + if (errno == ENOMSG) { + if (retry_count < 20000) { /* usec is 10^-6 sec so, 5ms * 20000 = 10sec. */ + usleep(5000); + retry_count++; + continue; + } else { + return MM_ERROR_SOUND_INTERNAL; + } + } else if (errno == E2BIG) { + debug_warning("[Client] Not acces.\n"); + } else if (errno == EACCES) { + debug_warning("[Client] Access denied\n"); + } else if (errno == ENOMSG) { + debug_warning("[Client] Blocked process [msgflag & IPC_NOWAIT != 0]\n"); + } else if (errno == EIDRM) { + debug_warning("[Client] Removed msgid from system\n"); + } else if (errno == EINTR) { + debug_warning("[Client] Iterrrupted by singnal\n"); + continue; + } else if (errno == EINVAL) { + debug_warning("[Client] Invalid msgid \n"); + } + + debug_error("[Client] Fail to recive msgid : [%d] \n", g_msg_scrcv); + return MM_ERROR_COMMON_UNKNOWN; + } + debug_log("[Client] Retry %d times when receive msg\n", retry_count); + return MM_ERROR_NONE; +} + +static int __MMIpcSndMsg(mm_ipc_msg_t *msg) +{ + /* rcv message */ + msg->msg_type = msg->sound_msg.msgid; + if (msgsnd(g_msg_scsnd, msg,DSIZE, 0) == -1) + { + if (errno == EACCES) { + debug_warning("[Client] Not access.\n"); + } else if (errno == EAGAIN) { + debug_warning("[Client] Blocked process msgflag & IPC_NOWAIT != 0]\n"); + } else if (errno == EIDRM) { + debug_warning("[Client] Removed msgid from system\n"); + } else if (errno == EINTR) { + debug_warning("[Client] Iterrrupted by singnal\n"); + } else if (errno == EINVAL) { + debug_warning("Invalid msgid or msgtype < 1 or out of data size \n"); + } else if (errno == EFAULT) { + debug_warning("[Client] The address pointed to by msgp isn't accessible \n"); + } else if (errno == ENOMEM) { + debug_warning("[Client] The system does not have enough memory to make a copy of the message pointed to by msgp\n"); + } + + debug_critical("[Client] Fail to send message msgid : [%d] \n", g_msg_scsnd); + return MM_ERROR_SOUND_INTERNAL; + } + return MM_ERROR_NONE; +} + +static int __MMSoundGetMsg(void) +{ + /* Init message queue, generate msgid for communication to server */ + /* The key value to get msgid is defined "mm_sound_msg.h". Shared with server */ + + debug_fenter(); + + /* get msg queue rcv, snd, cb */ + g_msg_scsnd = msgget(ftok(KEY_BASE_PATH, RCV_MSG), 0666); + g_msg_scrcv = msgget(ftok(KEY_BASE_PATH, SND_MSG), 0666); + g_msg_sccb = msgget(ftok(KEY_BASE_PATH, CB_MSG), 0666); + + if ((g_msg_scsnd == -1 || g_msg_scrcv == -1 || g_msg_sccb == -1) != MM_ERROR_NONE) { + if (errno == EACCES) { + debug_warning("Require ROOT permission.\n"); + } else if (errno == ENOMEM) { + debug_warning("System memory is empty.\n"); + } else if(errno == ENOSPC) { + debug_warning("Resource is empty.\n"); + } + debug_error("Fail to GET msgid\n"); + return MM_ERROR_SOUND_INTERNAL; + } + + debug_msg("Get msg queue id from server : [%d]\n", g_msg_scsnd); + debug_msg("Get msg queue id from server : [%d]\n", g_msg_scrcv); + debug_msg("Get msg queue id from server : [%d]\n", g_msg_sccb); + + debug_fleave(); + return MM_ERROR_NONE; +} + +#ifdef PULSE_CLIENT + +int MMSoundClientIsBtA2dpOn (bool *connected, char** bt_name) +{ + mm_ipc_msg_t msgrcv = {0,}; + mm_ipc_msg_t msgsnd = {0,}; + int ret = MM_ERROR_NONE; + int instance; + + debug_fenter(); + + instance = getpid(); + + if (__mm_sound_client_get_msg_queue() != MM_ERROR_NONE) + return ret; + + pthread_mutex_lock(&g_thread_mutex); + + /* Send req */ + msgsnd.sound_msg.msgtype = MM_SOUND_MSG_REQ_IS_BT_A2DP_ON; + msgsnd.sound_msg.msgid = instance; + + ret = __MMIpcSndMsg(&msgsnd); + if (ret != MM_ERROR_NONE) + { + debug_error("Fail to send msg\n"); + goto cleanup; + } + + /* Recieve */ + ret = __MMIpcRecvMsg(instance, &msgrcv); + if (ret != MM_ERROR_NONE) + { + debug_error("Fail to recieve msg\n"); + goto cleanup; + } + switch (msgrcv.sound_msg.msgtype) + { + case MM_SOUND_MSG_RES_IS_BT_A2DP_ON: + debug_msg("Success to get IS_BT_A2DP_ON [%d][%s]\n", msgrcv.sound_msg.code, msgrcv.sound_msg.filename); + *connected = (bool)msgrcv.sound_msg.code; + if (*connected) + *bt_name = strdup (msgrcv.sound_msg.filename); + else + *bt_name = NULL; + break; + case MM_SOUND_MSG_RES_ERROR: + debug_error("Error occurred \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + default: + debug_critical("Unexpected state with communication \n"); + ret = msgrcv.sound_msg.code; + goto cleanup; + break; + } + +cleanup: + pthread_mutex_unlock(&g_thread_mutex); + + debug_fleave(); + return ret; +} + +#endif // PULSE_CLIENT diff --git a/mm_sound_keysound.c b/mm_sound_keysound.c new file mode 100644 index 0000000..29314d9 --- /dev/null +++ b/mm_sound_keysound.c @@ -0,0 +1,100 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#define KEYTONE_PATH "/tmp/keytone" /* Keytone pipe path */ +#define FILE_FULL_PATH 1024 /* File path lenth */ + +typedef struct { + char filename[FILE_FULL_PATH]; + int volume_config; +} ipc_t; + +EXPORT_API +int mm_sound_play_keysound(const char *filename, int volume_config) +{ + int err = MM_ERROR_NONE; + int fd = -1; + int size = 0; + ipc_t data = {{0,},}; + + debug_fenter(); + + if (!filename) + return MM_ERROR_SOUND_INVALID_FILE; + + /* Check whether file exists */ + fd = open(filename, O_RDONLY); + if (fd == -1) { + debug_error("file open failed with [%s][%d]\n", strerror(errno), errno); + switch (errno) { + case ENOENT: + return MM_ERROR_SOUND_FILE_NOT_FOUND; + default: + return MM_ERROR_SOUND_INTERNAL; + } + } + close(fd); + fd = -1; + + /* Open PIPE */ + fd = open(KEYTONE_PATH, O_WRONLY | O_NONBLOCK); + if (fd == -1) { + debug_error("Fail to open pipe\n"); + return MM_ERROR_SOUND_FILE_NOT_FOUND; + } + data.volume_config = volume_config; + strncpy(data.filename, filename, FILE_FULL_PATH); + debug_msg("The file name [%s]\n", data.filename); + size = sizeof(ipc_t); + + /* Write to PIPE */ + err = write(fd, &data, size); + if (err < 0) { + debug_error("Fail to write data: %s\n", strerror(err)); + close(fd); + return MM_ERROR_SOUND_INTERNAL; + } + /* Close PIPE */ + close(fd); + + debug_fleave(); + return MM_ERROR_NONE; +} + + diff --git a/packaging/libmm-sound.changes b/packaging/libmm-sound.changes new file mode 100644 index 0000000..a3cec9b --- /dev/null +++ b/packaging/libmm-sound.changes @@ -0,0 +1,2 @@ +* Thu Dec 6 2012 Vivian Zhang - 0.6.0 +- Support the case that speaker and wired_accessory are 2 separate alsa sinks in pulseaudio for IA build diff --git a/packaging/libmm-sound.spec b/packaging/libmm-sound.spec new file mode 100644 index 0000000..ce01f3d --- /dev/null +++ b/packaging/libmm-sound.spec @@ -0,0 +1,141 @@ +Name: libmm-sound +Summary: MMSound Package contains client lib and sound_server binary +Version: 0.7.1 +Release: 1 +Group: System/Libraries +License: Apache-2.0 +Source0: %{name}-%{version}.tar.gz +Source1: sound-server.service +Requires(pre): /bin/pidof +Requires(post): /sbin/ldconfig +Requires(post): /usr/bin/vconftool +Requires(postun): /sbin/ldconfig +BuildRequires: pkgconfig(mm-common) +BuildRequires: pkgconfig(avsystem) +BuildRequires: pkgconfig(mm-log) +BuildRequires: pkgconfig(mm-session) +BuildRequires: pkgconfig(audio-session-mgr) +BuildRequires: pkgconfig(sysman) +BuildRequires: pkgconfig(glib-2.0) +BuildRequires: pkgconfig(vconf) +BuildRequires: pkgconfig(heynoti) +BuildRequires: pkgconfig(security-server) + +%description +MMSound Package contains client lib and sound_server binary for sound system + + +%package devel +Summary: MMSound development package +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +MMSound development package for sound system + +%package sdk-devel +Summary: MMSound development package +Group: Development/Libraries +Requires: %{name}-devel = %{version}-%{release} + +%description sdk-devel +MMSound development package for sound system + +%package tool +Summary: MMSound utility package - contians mm_sound_testsuite, sound_check +Group: TO_BE/FILLED_IN +Requires: %{name} = %{version}-%{release} + +%description tool +MMSound utility package - contians mm_sound_testsuite, sound_check for sound system + + + +%prep +%setup -q + + +%build +./autogen.sh +%ifarch %{arm} +CFLAGS="%{optflags} -fvisibility=hidden -DMM_DEBUG_FLAG -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\""; export CFLAGS +%else +%if 0%{?simulator} +CFLAGS="%{optflags} -fvisibility=hidden -DMM_DEBUG_FLAG -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\""; export CFLAGS +%else +CFLAGS="%{optflags} -fvisibility=hidden -DMM_DEBUG_FLAG -DSEPARATE_SPEAKER_AND_WIRED_ACCESSORY -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\""; export CFLAGS +%endif +%endif +%configure --prefix=/usr --enable-pulse --enable-security +make %{?_smp_mflags} + +%install +%make_install +install -d %{buildroot}%{_libdir}/systemd/user/tizen-middleware.target.wants +install -m0644 %{SOURCE1} %{buildroot}%{_libdir}/systemd/user/ +ln -sf ../sound-server.service %{buildroot}%{_libdir}/systemd/user/tizen-middleware.target.wants/sound-server.service + +# FIXME: remove after systemd is in +mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc3.d +mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc4.d +mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc5.d +ln -s %{_sysconfdir}/rc.d/init.d/soundserver %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S23soundserver +ln -s %{_sysconfdir}/rc.d/init.d/soundserver %{buildroot}%{_sysconfdir}/rc.d/rc4.d/S23soundserver + + + +%post +/sbin/ldconfig + +/usr/bin/vconftool set -t int memory/Sound/ASMReady 0 -g 29 -f -i + +/usr/bin/vconftool set -t int file/private/sound/volume/system 5 -g 29 -f +/usr/bin/vconftool set -t int file/private/sound/volume/notification 7 -g 29 -f +/usr/bin/vconftool set -t int file/private/sound/volume/alarm 7 -g 29 -f +/usr/bin/vconftool set -t int file/private/sound/volume/ringtone 13 -g 29 -f +/usr/bin/vconftool set -t int file/private/sound/volume/media 7 -g 29 -f +/usr/bin/vconftool set -t int file/private/sound/volume/call 7 -g 29 -f +/usr/bin/vconftool set -t int file/private/sound/volume/voip 7 -g 29 -f +/usr/bin/vconftool set -t int file/private/sound/volume/fixed 0 -g 29 -f +/usr/bin/vconftool set -t int file/private/sound/volume/java 11 -g 29 -f + +%postun -p /sbin/ldconfig + + +%files +%manifest libmm-sound.manifest +%defattr(-,root,root,-) +%{_bindir}/sound_server +%{_libdir}/libmmfsound.so.* +%{_libdir}/libmmfsoundcommon.so.* +%{_libdir}/libmmfkeysound.so.* +%{_libdir}/libsoundplugintone.so* +%{_libdir}/libsoundpluginwave.so* +%{_libdir}/libsoundpluginkeytone.so* +%{_libdir}/soundplugins/libsoundplugintone.so +%{_libdir}/soundplugins/libsoundpluginwave.so +%{_libdir}/soundplugins/libsoundpluginkeytone.so +%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/soundserver +%{_sysconfdir}/rc.d/rc3.d/S23soundserver +%{_sysconfdir}/rc.d/rc4.d/S23soundserver +%{_libdir}/systemd/user/tizen-middleware.target.wants/sound-server.service +%{_libdir}/systemd/user/sound-server.service +/usr/share/sounds/sound-server/* + +%files devel +%defattr(-,root,root,-) +%{_libdir}/libmmfkeysound.so +%{_libdir}/libmmfsound.so +%{_libdir}/libmmfsoundcommon.so +%{_includedir}/mmf/mm_sound_private.h + + +%files sdk-devel +%defattr(-,root,root,-) +%{_includedir}/mmf/mm_sound.h +%{_libdir}/pkgconfig/mm-keysound.pc +%{_libdir}/pkgconfig/mm-sound.pc + +%files tool +%defattr(-,root,root,-) +%{_bindir}/mm_sound_testsuite diff --git a/packaging/sound-server.service b/packaging/sound-server.service new file mode 100644 index 0000000..405896e --- /dev/null +++ b/packaging/sound-server.service @@ -0,0 +1,12 @@ +[Unit] +Description=Start the sound profile service + +[Service] +ExecStart=/usr/bin/sound_server -S +Nice=5 +OOMScoreAdjust=-100 +Restart=always +RestartSec=2 + +[Install] +WantedBy=tizen-middleware.target diff --git a/pkgconfig/Makefile.am b/pkgconfig/Makefile.am new file mode 100644 index 0000000..58e6f5e --- /dev/null +++ b/pkgconfig/Makefile.am @@ -0,0 +1,16 @@ +pcfiles = mm-sound.pc mm-keysound.pc + +all-local: $(pcfiles) + +%.pc: %.pc + cp $< $@ + +pkgconfigdir= $(libdir)/pkgconfig +pkgconfig_DATA= $(pcfiles) + +CLEANFILES= $(pcfiles) + +pcinfiles= mm-sound.pc.in mm-keysound.pc.in + +EXTRA_DIST= $(pcinfiles) + diff --git a/pkgconfig/mm-keysound.pc.in b/pkgconfig/mm-keysound.pc.in new file mode 100644 index 0000000..74d8be8 --- /dev/null +++ b/pkgconfig/mm-keysound.pc.in @@ -0,0 +1,11 @@ +prefix = @prefix@ +exec_prefix= @exec_prefix@ +libdir = @libdir@ +includedir = @includedir@ + +Name : mmfkeysound +Description : Multimedia Framework Key Sound Library +Requires : mm-common mm-log +Version : @VERSION@ +Libs : -L${libdir} -lmmfkeysound +Cflags : -I${includedir}/mmf diff --git a/pkgconfig/mm-sound.pc.in b/pkgconfig/mm-sound.pc.in new file mode 100644 index 0000000..100cfbd --- /dev/null +++ b/pkgconfig/mm-sound.pc.in @@ -0,0 +1,11 @@ +prefix = @prefix@ +exec_prefix= @exec_prefix@ +libdir = @libdir@ +includedir = @includedir@ + +Name : mmfsound +Description : Multimedia Framework Sound Library +Requires : mm-keysound avsysaudio mm-session glib-2.0 vconf +Version : @VERSION@ +Libs : -L${libdir} -lmmfsound +Cflags : -I${includedir}/mmf diff --git a/server/Makefile.am b/server/Makefile.am new file mode 100644 index 0000000..08cf4de --- /dev/null +++ b/server/Makefile.am @@ -0,0 +1,58 @@ +SUBDIRS = plugin + +bin_PROGRAMS = sound_server +sound_server_SOURCES = mm_sound_mgr_codec.c \ + mm_sound_mgr_ipc.c \ + mm_sound_mgr_pulse.c \ + mm_sound_mgr_asm.c \ + mm_sound_mgr_device.c \ + mm_sound_mgr_headset.c \ + mm_sound_mgr_dock.c \ + mm_sound_mgr_hdmi.c \ + mm_sound_mgr_wfd.c \ + mm_sound_mgr_session.c \ + mm_sound_mgr_run.c \ + mm_sound_plugin.c \ + mm_sound_server.c \ + mm_sound_thread_pool.c + +sound_server_CFLAGS = -I$(srcdir)/../include \ + -I$(srcdir)/include \ + $(MMCOMMON_CFLAGS) \ + $(MMLOGSVR_CFLAGS) \ + -DMMF_LOG_OWNER=0x020 \ + -DMMF_DEBUG_PREFIX=\"MMF-SOUND\" \ + -D__DEBUG_MODE__ -DUSE_VCONF -D__USE_LOGMANAGER__ \ + $(MMSESSION_CFLAGS) \ + $(AVSYSTEM_CFLAGS) \ + $(AUDIOSESSIONMGR_CFLAGS) \ + $(VCONF_CFLAGS) \ + $(GLIB2_CFLAGS) \ + $(HEYNOTI_CFLAGS) + +sound_server_LDADD = $(MMLOGSVR_LIBS) \ + -ldl \ + $(MMCOMMON_LIBS) \ + $(MMSESSION_LIBS) \ + $(AVSYSTEM_LIBS) \ + $(AUDIOSESSIONMGR_LIBS) \ + $(GLIB2_LIBS) \ + $(VCONF_LIBS) \ + $(HEYNOTI_LIBS) \ + $(srcdir)/../libmmfsound.la \ + $(srcdir)/../common/libmmfsoundcommon.la + +if USE_PULSE +sound_server_CFLAGS += -DPULSE_CLIENT $(PULSE_CFLAGS) +sound_server_LDADD += $(PULSE_LIBS) +endif + +if USE_SECURITY +sound_server_CFLAGS += $(SECURITY_CFLAGS) -DUSE_SECURITY +sound_server_LDADD += $(SECURITY_LIBS) +endif + +sound_server_DEPENDENCIES = $(srcdir)/../common/libmmfsoundcommon.la + +installdocksounddir = $(prefix)/share/sounds/sound-server +installdocksound_DATA = sounds/dock.wav sounds/undock.wav diff --git a/server/include/mm_sound_mgr_asm.h b/server/include/mm_sound_mgr_asm.h new file mode 100644 index 0000000..3bd9f94 --- /dev/null +++ b/server/include/mm_sound_mgr_asm.h @@ -0,0 +1,35 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __MM_SOUND_MGR_ASM_H__ +#define __MM_SOUND_MGR_ASM_H__ + +#include "mm_ipc.h" +#include + +int MMSoundMgrASMInit(void); +int MMSoundMgrASMFini(void); + +int __asm_process_message (void *asm_rcv_msg, void *asm_ret_msg); + + +#endif /* __MM_SOUND_MGR_ASM_H__ */ + diff --git a/server/include/mm_sound_mgr_codec.h b/server/include/mm_sound_mgr_codec.h new file mode 100644 index 0000000..ffadd49 --- /dev/null +++ b/server/include/mm_sound_mgr_codec.h @@ -0,0 +1,66 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + + +#ifndef __MM_SOUND_MGR_CODEC_H__ +#define __MM_SOUND_MGR_CODEC_H__ + +#include + +typedef struct { + int tone; + int repeat_count; + double volume; + int session_type; + int session_handle; + int keytone; + void *stopcb; + int (*callback)(int, void *, void *); + void *msgcallback; /* Client callback function */ + void *msgdata; /* Client callback data */ + void *param; + MMSourceType *source; /* Will free plugin */ + int samplerate; + int channels; + int volume_config; + int priority; + int handle_route; +} mmsound_mgr_codec_param_t; + +enum +{ + MM_SOUND_CODEC_OP_KEYTONE = 0, + MM_SOUND_CODEC_OP_SOUND, +}; + +int MMSoundMgrCodecInit(const char *targetdir); +int MMSoundMgrCodecFini(void); + +int MMSoundMgrCodecPlay(int *slotid, const mmsound_mgr_codec_param_t *param); +int MMSoundMgrCodecStop(const int slotid); +int MMSoundMgrCodecCreate(int *slotid, const mmsound_mgr_codec_param_t *param); +int MMSoundMgrCodecPlayWave(int slotid, const mmsound_mgr_codec_param_t *param); +int MMSoundMgrCodecPlayDtmf(int *slotid, const mmsound_mgr_codec_param_t *param); +int MMSoundMgrCodecDestroy(const int slotid); + + +#endif /* __MM_SOUND_MGR_CODEC_H__ */ + diff --git a/server/include/mm_sound_mgr_common.h b/server/include/mm_sound_mgr_common.h new file mode 100644 index 0000000..eb29029 --- /dev/null +++ b/server/include/mm_sound_mgr_common.h @@ -0,0 +1,33 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + + +#ifndef __MM_SOUND_MGR_COMMON_H__ +#define __MM_SOUND_MGR_COMMON_H__ + +#define MANAGER_HANDLE_MAX 256 //30 + +#include +#include +#include + +#endif /* __MM_SOUND_MGR_COMMON_H__ */ + diff --git a/server/include/mm_sound_mgr_device.h b/server/include/mm_sound_mgr_device.h new file mode 100644 index 0000000..36fa536 --- /dev/null +++ b/server/include/mm_sound_mgr_device.h @@ -0,0 +1,49 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + + +#ifndef __MM_SOUND_MGR_DEVICE_H__ +#define __MM_SOUND_MGR_DEVICE_H__ + +#include "../include/mm_sound.h" + +typedef struct { + int pid; + mm_sound_route route; + void *callback; + void *cbdata; +} _mm_sound_mgr_device_param_t; + +int _mm_sound_mgr_device_init(void); +int _mm_sound_mgr_device_fini(void); +int _mm_sound_mgr_device_is_route_available(const _mm_sound_mgr_device_param_t *param, bool *is_available); +int _mm_sound_mgr_device_foreach_available_route_cb(mm_ipc_msg_t *msg); +int _mm_sound_mgr_device_set_active_route(const _mm_sound_mgr_device_param_t *param); +int _mm_sound_mgr_device_get_active_device(const _mm_sound_mgr_device_param_t *param, mm_sound_device_in *device_in, mm_sound_device_out *device_out); +int _mm_sound_mgr_device_add_active_device_callback(const _mm_sound_mgr_device_param_t *param); +int _mm_sound_mgr_device_remove_active_device_callback(const _mm_sound_mgr_device_param_t *param); +int _mm_sound_mgr_device_active_device_callback(mm_sound_device_in device_in, mm_sound_device_out device_out); +int _mm_sound_mgr_device_add_available_route_callback(const _mm_sound_mgr_device_param_t *param); +int _mm_sound_mgr_device_remove_available_route_callback(const _mm_sound_mgr_device_param_t *param); +int _mm_sound_mgr_device_available_device_callback(mm_sound_device_in device_in, mm_sound_device_out device_out, bool available); + +#endif /* __MM_SOUND_MGR_DEVICE_H__ */ + diff --git a/server/include/mm_sound_mgr_dock.h b/server/include/mm_sound_mgr_dock.h new file mode 100644 index 0000000..387fdfd --- /dev/null +++ b/server/include/mm_sound_mgr_dock.h @@ -0,0 +1,32 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __MM_SOUND_MGR_DOCK_H__ +#define __MM_SOUND_MGR_DOCK_H__ + +#include "../../include/mm_ipc.h" + +int MMSoundMgrDockInit(void); +int MMSoundMgrDockFini(void); + + +#endif /* __MM_SOUND_MGR_DOCK_H__ */ + diff --git a/server/include/mm_sound_mgr_hdmi.h b/server/include/mm_sound_mgr_hdmi.h new file mode 100644 index 0000000..84d56dd --- /dev/null +++ b/server/include/mm_sound_mgr_hdmi.h @@ -0,0 +1,30 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __MM_SOUND_MGR_HDMI_H__ +#define __MM_SOUND_MGR_HDMI_H__ + +int MMSoundMgrHdmiInit(void); +int MMSoundMgrHdmiFini(void); + + +#endif /* __MM_SOUND_MGR_HDMI_H__ */ + diff --git a/server/include/mm_sound_mgr_headset.h b/server/include/mm_sound_mgr_headset.h new file mode 100644 index 0000000..26c519d --- /dev/null +++ b/server/include/mm_sound_mgr_headset.h @@ -0,0 +1,33 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __MM_SOUND_MGR_HEADSET_H__ +#define __MM_SOUND_MGR_HEADSET_H__ + +#include "../../include/mm_ipc.h" + +int MMSoundMgrHeadsetInit(void); +int MMSoundMgrHeadsetFini(void); +int MMSoundMgrHeadsetGetType (int *type); + + +#endif /* __MM_SOUND_MGR_HEADSET_H__ */ + diff --git a/server/include/mm_sound_mgr_ipc.h b/server/include/mm_sound_mgr_ipc.h new file mode 100644 index 0000000..9d86817 --- /dev/null +++ b/server/include/mm_sound_mgr_ipc.h @@ -0,0 +1,42 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __MM_SOUND_MGR_IPC_H__ +#define __MM_SOUND_MGR_IPC_H__ + +#include "../../include/mm_sound_msg.h" + +#define SOUND_MSG_SET(sound_msg, x_msgtype, x_handle, x_code, x_msgid) \ +do { \ + sound_msg.msgtype = x_msgtype; \ + sound_msg.handle = x_handle; \ + sound_msg.code = x_code; \ + sound_msg.msgid = x_msgid; \ +} while(0) + +int MMSoundMgrIpcInit(void); +int MMSoundMgrIpcFini(void); +int MMSoundMgrIpcReady(void); + +int _MMIpcCBSndMsg(mm_ipc_msg_t *msg); + +#endif /* __MM_SOUND_MGR_H__ */ + diff --git a/server/include/mm_sound_mgr_pulse.h b/server/include/mm_sound_mgr_pulse.h new file mode 100644 index 0000000..6ed3f8e --- /dev/null +++ b/server/include/mm_sound_mgr_pulse.h @@ -0,0 +1,40 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __MM_SOUND_MGR_PULSE_H__ +#define __MM_SOUND_MGR_PULSE_H__ + + +#include "../../include/mm_ipc.h" + +void* MMSoundMgrPulseInit(void); +int MMSoundMgrPulseFini(void* handle); + +void MMSoundMgrPulseSetDefaultSink (char* device_api_name, char* device_bus_name); + +int MMSoundMgrPulseHandleRegisterMonoAudio (void* pinfo); +int MMSoundMgrPulseHandleRegisterBluetoothStatus (void* pinfo); + +int MMSoundMgrPulseHandleIsBtA2DPOnReq (mm_ipc_msg_t *msg, int (*sendfunc)(mm_ipc_msg_t*)); +void MMSoundMgrPulseGetInitialBTStatus (bool *a2dp, bool *sco); + +#endif /* __MM_SOUND_MGR_PULSE_H__ */ + diff --git a/server/include/mm_sound_mgr_run.h b/server/include/mm_sound_mgr_run.h new file mode 100644 index 0000000..832666d --- /dev/null +++ b/server/include/mm_sound_mgr_run.h @@ -0,0 +1,30 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __MM_SOUND_MGR_RUN_H__ +#define __MM_SOUND_MGR_RUN_H__ + +int MMSoundMgrRunInit(const char *targetdir); +int MMSoundMgrRunFini(void); +int MMSoundMgrRunRunAll(void); +int MMSoundMgrRunStopAll(void); + +#endif /* __MM_SOUND_MGR_RUN_H__ */ diff --git a/server/include/mm_sound_mgr_session.h b/server/include/mm_sound_mgr_session.h new file mode 100644 index 0000000..5f105bb --- /dev/null +++ b/server/include/mm_sound_mgr_session.h @@ -0,0 +1,101 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __MM_SOUND_MGR_SESSION_H__ +#define __MM_SOUND_MGR_SESSION_H__ + +//#include +#include "../../include/mm_ipc.h" +#include "include/mm_sound.h" +//#include + +typedef enum +{ + SESSION_END = 0, + SESSION_START, +} session_state_t; + +typedef enum +{ + NOT_AVAILABLE = 0, + AVAILABLE, +} device_status_t; + +typedef enum +{ + SESSION_MEDIA = 0, + SESSION_VOICECALL, + SESSION_VOIP, + SESSION_FMRADIO, + SESSION_NOTIFICATION, + SESSION_EMERGENCY, + SESSION_NUM +} session_t; + +typedef enum +{ + SUBSESSION_VOICE = 0, + SUBSESSION_RINGTONE, + SUBSESSION_MEDIA, + SUBSESSION_NUM +} subsession_t; + +typedef enum +{ + DEVICE_BUILTIN = 0, + DEVICE_WIRED, + DEVICE_BT_A2DP, + DEVICE_BT_SCO, + DEVICE_DOCK, + DEVICE_HDMI, + DEVICE_WFD, + DEVICE_USB_AUDIO, +} device_type_t; + +int MMSoundMgrSessionInit(void); +int MMSoundMgrSessionFini(void); + +/* called by mgr headset, pulse */ +int MMSoundMgrSessionSetDeviceAvailable (device_type_t device, int available, int type, char* name); + + +int MMSoundMgrSessionIsDeviceAvailable (mm_sound_device_out playback, mm_sound_device_in capture, bool *available); +int MMSoundMgrSessionIsDeviceAvailableNoLock (mm_sound_device_out playback, mm_sound_device_in capture, bool *available); + +int MMSoundMgrSessionGetAvailableDevices (int *playback, int *capture); + +int MMSoundMgrSessionSetDeviceActive (mm_sound_device_out playback, mm_sound_device_in capture); +int MMSoundMgrSessionGetDeviceActive (mm_sound_device_out *playback, mm_sound_device_in *capture); + +int MMSoundMgrSessionSetSession(session_t session, session_state_t state); /* called by mgr_asm */ +int MMSoundMgrSessionGetSession(session_t *session); + +int MMSoundMgrSessionSetSubSession(subsession_t subsession); /* called by mgr_asm */ +int MMSoundMgrSessionGetSubSession(subsession_t *subsession); + +char* MMSoundMgrSessionGetBtA2DPName (); + +int MMSoundMgrSessionSetDefaultSink (char *default_sink_name); + +int MMSoundMgrSessionSCOChanged (bool connected); + +#endif /* __MM_SOUND_MGR_SESSION_H__ */ + diff --git a/server/include/mm_sound_mgr_wfd.h b/server/include/mm_sound_mgr_wfd.h new file mode 100644 index 0000000..e4d7365 --- /dev/null +++ b/server/include/mm_sound_mgr_wfd.h @@ -0,0 +1,30 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __MM_SOUND_MGR_WFD_H__ +#define __MM_SOUND_MGR_WFD_H__ + +int MMSoundMgrWfdInit(void); +int MMSoundMgrWfdFini(void); + + +#endif /* __MM_SOUND_MGR_WFD_H__ */ + diff --git a/server/include/mm_sound_plugin.h b/server/include/mm_sound_plugin.h new file mode 100644 index 0000000..e7bbdaf --- /dev/null +++ b/server/include/mm_sound_plugin.h @@ -0,0 +1,54 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + + +#ifndef __MM_SOUND_PLUGIN_H__ +#define __MM_SOUND_PLUGIN_H__ + +enum { + MM_SOUND_PLUGIN_TYPE_NONE = 0, + MM_SOUND_PLUGIN_TYPE_CODEC, + MM_SOUND_PLUGIN_TYPE_RUN, + MM_SOUND_PLUGIN_TYPE_LAST, +}; + +typedef struct { + int type; + void *module; +} MMSoundPluginType; + +#define MMSOUND_TRUE 1 +#define MMSOUND_FALSE 0 + +/* Plugin Interface */ +int MMSoundGetPluginType(void); + +/* Utility Interfaces */ +char* MMSoundPluginGetTypeName(int type); +int MMSoundPluginScan(const char *plugindir, const int type, MMSoundPluginType **pluginlist); +int MMSoundPluginRelease(MMSoundPluginType *pluginlist); + +int MMSoundPluginOpen(char *file, MMSoundPluginType *plugin); +int MMSoundPluginClose(MMSoundPluginType *plugin); +int MMSoundPluginGetSymbol(MMSoundPluginType *plugin, const char *symbol, void **func); + +#endif /* __MM_SOUND_PLUGIN_H__ */ + diff --git a/server/include/mm_sound_plugin_codec.h b/server/include/mm_sound_plugin_codec.h new file mode 100644 index 0000000..d40d552 --- /dev/null +++ b/server/include/mm_sound_plugin_codec.h @@ -0,0 +1,78 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __MM_SOUND_PLUGIN_CODEC_H__ +#define __MM_SOUND_PLUGIN_CODEC_H__ + +#include "mm_sound_plugin.h" +#include +#include + +enum MMSoundSupportedCodec { + MM_SOUND_SUPPORTED_CODEC_INVALID = -1, /**< Invalid codec type */ + MM_SOUND_SUPPORTED_CODEC_WAVE, /**< WAVE codec */ + MM_SOUND_SUPPORTED_CODEC_DTMF, /**< DTMF codec */ + MM_SOUND_SUPPORTED_CODEC_MP3, /**< MP3 codec */ + MM_SOUND_SUPPORTED_CODEC_NUM, /**< Number of audio codec type */ +}; + +typedef struct { + int codec; + int channels; + int samplerate; + int format; + int doffset; + int size; +} mmsound_codec_info_t; + +typedef struct { + int (*stop_cb)(int); + int pid; + int param; + int tone; + int repeat_count; + double volume; + int priority; + int volume_config; + int keytone; + MMSourceType *source; + int handle_route; +} mmsound_codec_param_t; + +typedef struct { + int* (*GetSupportTypes)(void); + int (*SetThreadPool) (int (*)(void*, void (*)(void*))); + int (*Parse)(MMSourceType*, mmsound_codec_info_t*); + int (*Create)(mmsound_codec_param_t*, mmsound_codec_info_t*, MMHandleType*); + int (*Play_wav)(mmsound_codec_param_t *, mmsound_codec_info_t *, MMHandleType ); + int (*Play)(MMHandleType); + int (*Stop)(MMHandleType); + int (*Destroy)(MMHandleType); +} mmsound_codec_interface_t; + +/* Utility Functions */ +#define CODEC_GET_INTERFACE_FUNC_NAME "MMSoundPlugCodecGetInterface" +#define MMSoundPlugCodecCastGetInterface(func) ((int (*)(mmsound_codec_interface_t*))(func)) + +int MMSoundPlugCodecGetInterface(mmsound_codec_interface_t *intf); + +#endif /* __MM_SOUND_PLUGIN_CODEC_H__ */ + diff --git a/server/include/mm_sound_plugin_run.h b/server/include/mm_sound_plugin_run.h new file mode 100644 index 0000000..90cad66 --- /dev/null +++ b/server/include/mm_sound_plugin_run.h @@ -0,0 +1,50 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __MM_SOUND_PLUGIN_RUN_H__ +#define __MM_SOUND_PLUGIN_RUN_H__ + +#include "mm_sound_plugin.h" +#include + +enum { + MM_SOUND_PLUG_RUN_OP_RUN, + MM_SOUND_PLUG_RUN_OP_STOP, + MM_SOUND_PLUG_RUN_OP_LAST +}; + +/* Plugin Interface */ +typedef struct { + int (*run)(void); + int (*stop)(void); + int (*SetThreadPool) (int (*)(void*, void (*)(void*))); +} mmsound_run_interface_t; + +int MMSoundRunRun(void); +int MMSoundRunStop(void); + +/* Utility Functions */ +#define RUN_GET_INTERFACE_FUNC_NAME "MMSoundPlugRunGetInterface" +#define MMSoundPlugRunCastGetInterface(func) ((int (*)(mmsound_run_interface_t*))(func)) +int MMSoundPlugRunGetInterface(mmsound_run_interface_t *intf); + +#endif /* __MM_SOUND_PLUGIN_RUN_H__ */ + diff --git a/server/include/mm_sound_thread_pool.h b/server/include/mm_sound_thread_pool.h new file mode 100644 index 0000000..74271e5 --- /dev/null +++ b/server/include/mm_sound_thread_pool.h @@ -0,0 +1,30 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __MM_SOUND_THREAd_POOL_H__ +#define __MM_SOUND_THREAd_POOL_H__ + +int MMSoundThreadPoolDump(int fulldump); +int MMSoundThreadPoolInit(void); +int MMSoundThreadPoolRun(void *param, void (*func)(void*)); +int MMSoundThreadPoolFini(void); + +#endif /* __MM_SOUND_THREAd_POOL_H__ */ diff --git a/server/mm_sound_mgr_asm.c b/server/mm_sound_mgr_asm.c new file mode 100644 index 0000000..9a902f5 --- /dev/null +++ b/server/mm_sound_mgr_asm.c @@ -0,0 +1,1982 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "include/mm_sound_mgr_common.h" +#include "include/mm_sound_thread_pool.h" +#include "../include/mm_sound_common.h" + +#include +#include + + +#include + +#include "include/mm_sound_mgr_asm.h" +#include "include/mm_sound_mgr_session.h" + +pthread_mutex_t g_mutex_asm = PTHREAD_MUTEX_INITIALIZER; + + + + + +/******************************* ASM Code **********************************/ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#ifdef USE_SECURITY +#include +#endif + +#include + +#define USE_SYSTEM_SERVER_PROCESS_MONITORING + +#define SUPPORT_GCF /* currently in use */ + +static const ASM_sound_cases_t ASM_sound_case[ASM_PRIORITY_MATRIX_MIN+1][ASM_PRIORITY_MATRIX_MIN+1] = +{ + /* + 0 == ASM_CASE_NONE + 1 == ASM_CASE_1PLAY_2STOP + 5 == ASM_CASE_1STOP_2PLAY + 6 == ASM_CASE_1PAUSE_2PLAY + 8 == ASM_CASE_1PLAY_2PLAY_MIX + 9 == ASM_CASE_RESOURCE_CHECK + */ + /* SP SC SS SO SA, EP EC ES EO EA, NT CL SF EF EU, AL VC MT RC EM ER */ + { 8, 8, 8, 8, 8, 6, 6, 6, 6, 6, 8, 6, 8, 6, 6, 6, 6, 8, 6, 6, 9}, /* 00 Shared MMPlayer */ + { 8, 8, 8, 8, 8, 5, 5, 5, 5, 5, 8, 5, 8, 5, 8, 5, 5, 8, 5, 5, 9}, /* 01 Shared MMCamcorder */ + { 8, 8, 8, 8, 8, 5, 5, 5, 5, 5, 8, 5, 8, 5, 5, 5, 5, 8, 5, 5, 9}, /* 02 Shared MMSound */ + { 8, 8, 8, 8, 8, 5, 5, 5, 5, 5, 8, 5, 8, 5, 6, 5, 5, 8, 5, 5, 9}, /* 03 Shared OpenAL */ + { 8, 8, 8, 8, 8, 5, 5, 5, 5, 5, 8, 5, 8, 5, 8, 5, 5, 8, 5, 5, 9}, /* 04 Shared AVsystem */ + { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 6, 6, 6, 6, 6, 6, 8, 6, 6, 9}, /* 05 Exclusive MMPlayer */ + { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 5, 5, 5, 8, 5, 5 ,8, 5, 5, 9}, /* 06 Exclusive MMCamcorder */ + { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 5, 5, 5, 5, 5, 5, 8, 5, 5, 9}, /* 07 Exclusive MMSound */ + { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 5, 5, 5, 6, 5, 5, 8, 5, 5, 9}, /* 08 Exclusive OpenAL */ + { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 5, 5, 5, 8, 5, 5, 8, 5, 5, 9}, /* 09 Exclusive AVsystem */ + { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 5, 8, 8, 8, 5, 5, 8, 5, 5, 9}, /* 10 Notify */ + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 0, 1, 1, 8, 8, 1, 8, 0, 1, 9}, /* 11 Call */ + { 8, 8, 8, 8, 8, 5, 5, 5, 5, 5, 8, 5, 5, 5, 5, 5, 5, 8, 5, 5, 9}, /* 12 Shared FMradio */ + { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 5, 5, 5, 5, 5, 5, 8, 5, 5, 9}, /* 13 Exclusive FMradio */ + { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9}, /* 14 Earjack Unplug */ + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 6, 1, 1, 8, 8, 6, 8, 6, 5, 9}, /* 15 Alarm */ + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 8, 8, 0, 8, 1, 1, 9}, /* 16 Video Call */ + { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9}, /* 17 Monitor */ + { 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 8, 0, 1, 1, 8, 8, 1, 8, 0, 1, 9}, /* 18 Rich Call */ + { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 5, 5, 8, 5, 5, 9}, /* 19 Emergency */ + { 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9}, /* 20 Exclusive Resource */ +}; + +typedef struct _list +{ + long int instance_id; + int sound_handle; + ASM_sound_events_t sound_event; + ASM_sound_states_t sound_state; + ASM_resume_states_t need_resume; + ASM_resource_t mm_resource; + unsigned short monitor_active; + unsigned short monitor_dirty; + struct _list *next; +} asm_instance_list_t; + +asm_instance_list_t *head_list, *tail_list; + +int asm_snd_msgid; +int asm_rcv_msgid; +int asm_cb_msgid; +//ASM_msg_lib_to_asm_t asm_rcv_msg; +//ASM_msg_asm_to_lib_t asm_snd_msg; +//ASM_msg_asm_to_cb_t asm_cb_msg; + +bool asm_is_send_msg_to_cb = false; + +#ifdef SUPPORT_GCF +#define GCF_DEFAULT 0 +int is_gcf = GCF_DEFAULT; +#endif + +unsigned int g_sound_status_pause = 0; +unsigned int g_sound_status_playing = 0; + +#define SERVER_HANDLE_MAX_COUNT 256 + +static const char* ASM_sound_events_str[] = +{ + "SHARE_MMPLAYER", + "SHARE_MMCAMCORDER", + "SHARE_MMSOUND", + "SHARE_OPENAL", + "SHARE_AVSYSTEM", + "EXCLUSIVE_MMPLAYER", + "EXCLUSIVE_MMCAMCORDER", + "EXCLUSIVE_MMSOUND", + "EXCLUSIVE_OPENAL", + "EXCLUSIVE_AVSYSTEM", + "NOTIFY", + "CALL", + "SHARE_FMRADIO", + "EXCLUSIVE_FMRADIO", + "EARJACK_UNPLUG", + "ALARM", + "VIDEOCALL", + "MONITOR", + "RICH_CALL", + "EMERGENCY", + "EXCLUSIVE_RESOURCE" +}; + +static const char* ASM_sound_state_str[] = +{ + "STATE_NONE", + "STATE_PLAYING", + "STATE_WAITING", + "STATE_STOP", + "STATE_PAUSE", + "STATE_PAUSE_BY_APP", + "STATE_ALTER_PLAYING" +}; + + +static const char* ASM_sound_request_str[] = +{ + "REQUEST_REGISTER", + "REQUEST_UNREGISTER", + "REQUEST_GETSTATE", + "REQUEST_GETMYSTATE", + "REQUEST_SETSTATE", + "REQUEST_EMEGENT_EXIT", + "REQUEST_DUMP", + "REQUEST_SET_SUBSESSION", + "REQUEST_GET_SUBSESSION" +}; + + +static const char* ASM_sound_cases_str[] = +{ + "CASE_NONE", + "CASE_1PLAY_2STOP", + "CASE_1PLAY_2ALTER_PLAY", + "CASE_1PLAY_2WAIT", + "CASE_1ALTER_PLAY_2PLAY", + "CASE_1STOP_2PLAY", + "CASE_1PAUSE_2PLAY", + "CASE_1VIRTUAL_2PLAY", + "CASE_1PLAY_2PLAY_MIX", + "CASE_RESOURCE_CHECK" +}; + +static const char* ASM_sound_resume_str[] = +{ + "NO-RESUME", + "RESUME" +}; + + +static const char* ASM_sound_command_str[] = +{ + "CMD_NONE", + "CMD_WAIT", + "CMD_PLAY", + "CMD_STOP", + "CMD_PAUSE", + "CMD_RESUME", +}; + +static char *subsession_str[] = +{ + "VOICE", + "RINGTONE", + "MEDIA" +}; + +#define ASM_SND_MSG_SET(asm_snd_msg, x_alloc_handle, x_cmd_handle, x_result_sound_command, x_result_sound_state, x_former_sound_event) \ +do { \ + asm_snd_msg->data.alloc_handle = x_alloc_handle; \ + asm_snd_msg->data.cmd_handle = x_cmd_handle; \ + asm_snd_msg->data.result_sound_command = x_result_sound_command; \ + asm_snd_msg->data.result_sound_state = x_result_sound_state; \ + asm_snd_msg->data.former_sound_event = x_former_sound_event; \ +} while (0) + +void selectSleep(int secs) +{ + struct timeval timeout; + timeout.tv_sec = (secs < 1 || secs > 10) ? 3 : secs; + timeout.tv_usec = 0; + select(0, NULL, NULL, NULL, &timeout); + return; +} + +gboolean __is_need_resume (ASM_sound_events_t sound_event) +{ + gboolean result = FALSE; + switch (sound_event) { + case ASM_EVENT_ALARM: + case ASM_EVENT_EMERGENCY: + result = TRUE; + break; + default: + result = FALSE; + break; + } + return result; +} + +gboolean __find_clean_monitor_handle(int instance_id, int *handle) +{ + asm_instance_list_t *temp_list = head_list; + int lhandle = -1; + + while (temp_list->next != tail_list) { + if (temp_list->instance_id == instance_id && temp_list->sound_event == ASM_EVENT_MONITOR) { + if (temp_list->monitor_dirty == 0) { + lhandle = temp_list->sound_handle; + } + break; + } + temp_list = temp_list->next; + } + if (lhandle == -1) { + debug_warning("[ASM_Server] %s : could not find a clean monitor handle",__func__); + return FALSE; + } else { + *handle = lhandle; + debug_log("[ASM_Server] %s : found a clean monitor handle(%d)",__func__, *handle); + return TRUE; + } +} + +void __update_monitor_active(long int instance_id) +{ + asm_instance_list_t *temp_list = head_list; + asm_instance_list_t *monitor_list = NULL; + unsigned short active = 0; + debug_log("[ASM_Server] %s\n",__func__); + + while (temp_list->next != tail_list) { + if (temp_list->instance_id == instance_id && temp_list->sound_event == ASM_EVENT_MONITOR) { + /* backup monitor pointer */ + monitor_list = temp_list; + break; + } + temp_list = temp_list->next; + } + if (NULL == monitor_list) { + debug_warning("[ASM_Server] %s : No monitor instance for %d\n",__func__, instance_id); + return; + } + + temp_list = head_list; + while (temp_list->next != tail_list) { + if (temp_list->instance_id == instance_id && temp_list->sound_event != ASM_EVENT_MONITOR) { + if (ASM_STATE_PLAYING == temp_list->sound_state) { + active = 1; + break; + } + } + temp_list = temp_list->next; + } + + monitor_list->monitor_active = active; +} + +void __set_all_monitor_clean() +{ + asm_instance_list_t *temp_list = head_list; + + while (temp_list->next != tail_list) { + if (temp_list->sound_event == ASM_EVENT_MONITOR) { + temp_list->monitor_dirty = 0; + } + temp_list = temp_list->next; + } +} + +void __set_monitor_dirty(long int instance_id) +{ + asm_instance_list_t *temp_list = head_list; + + while (temp_list->next != tail_list) { + if (temp_list->instance_id == instance_id && temp_list->sound_event == ASM_EVENT_MONITOR) { + temp_list->monitor_dirty = 1; + break; + } + temp_list = temp_list->next; + } +} + +/* callback without retcb */ +void __do_callback_wo_retcb(int instance_id,int handle,int command) +{ + int fd_ASM = 0, cur_handle = 0; + char *filename = g_strdup_printf("/tmp/ASM.%d.%d", instance_id, handle); + + if ((fd_ASM = open(filename,O_WRONLY|O_NONBLOCK)) < 0) { + debug_log("[ASM_Server][CallCB] %s open error",filename); + g_free(filename); + return; + } + cur_handle = (unsigned int)(handle |(command << 4)); + if (write(fd_ASM, (void *)&cur_handle, sizeof(cur_handle)) < 0) { + debug_log("[ASM_Server][CallCB] %s write error",filename); + g_free(filename); + if (fd_ASM != -1) { + close(fd_ASM); + } + return; + } + close(fd_ASM); + g_free(filename); + selectSleep(2); /* if return immediately bad sound occur */ +} + + +int __do_callback(int instance_id,int handle,int command, ASM_event_sources_t event_src) +{ + char *filename = NULL; + char *filename2 = NULL; + struct timeval time; + int starttime = 0; + int endtime = 0; + int fd=0,nread = 0; + int fd_ASM = 0, cur_handle = 0; + int buf = 0; + struct pollfd pfd; + int pret = 0; + int pollingTimeout = 1500; /* NOTE : This is temporary code, because of Deadlock issues. If you fix that issue, remove this comment */ + + debug_log("[ASM_Server] __do_callback for pid(%d) handle(%d)\n", instance_id, handle); + + /* Set start time */ + gettimeofday(&time, NULL); + starttime = time.tv_sec * 1000000 + time.tv_usec; + + /************************************** + * + * Open callback cmd pipe + * + **************************************/ + filename = g_strdup_printf("/tmp/ASM.%d.%d", instance_id, handle); + if ((fd_ASM = open(filename, O_WRONLY|O_NONBLOCK)) < 0) { + debug_error("[ASM_Server][CallCB] %s open error\n", filename); + goto fail; + } + + /****************************************** + * + * Open callback result pipe + * before writing callback cmd to pipe + * + ******************************************/ + filename2 = g_strdup_printf("/tmp/ASM.%d.%dr", instance_id, handle); + if ((fd=open(filename2,O_RDONLY|O_NONBLOCK))== -1) { + char str_error[256]; + strerror_r (errno, str_error, sizeof(str_error)); + debug_error("[ASM_Server][RETCB] Fail to open fifo (%s)\n", str_error); + goto fail; + } + debug_log("[ASM_Server] open return cb %s\n", filename2); + + + /******************************************* + * Write Callback msg + *******************************************/ + cur_handle = (unsigned int)((0x0000ffff & handle) |(command << 16) | (event_src << 24)); + if (write(fd_ASM, (void *)&cur_handle, sizeof(cur_handle)) < 0) { + debug_error("[ASM_Server][CallCB] %s write error\n", filename); + goto fail; + } + /************************************** + * + * Close callback cmd pipe + * + **************************************/ + close(fd_ASM); + fd_ASM = -1; + g_free(filename); + filename = NULL; + + /* If command is RESUME, then do not wait for client return */ + if (command == ASM_COMMAND_RESUME) { + debug_log("[ASM_Server][RETCB] No need to wait return from client. \n"); + if (fd != -1) { + close (fd); + } + return ASM_CB_RES_NONE; + } + + pfd.fd = fd; + pfd.events = POLLIN; + + /********************************************* + * + * Wait callback result msg + * + ********************************************/ + debug_log("[ASM_Server][RETCB]wait callback(tid=%d, handle=%d, cmd=%d, timeout=%d)\n", instance_id, handle, command, pollingTimeout); + pret = poll(&pfd, 1, pollingTimeout); //timeout 7sec + if (pret < 0) { + debug_error("[ASM_Server][RETCB]poll failed (%d)\n", pret); + goto fail; + } + if (pfd.revents & POLLIN) { + nread=read(fd, (void *)&buf, sizeof(buf)); + } + g_free(filename2); + filename2 = NULL; + + /* Calculate endtime and display*/ + gettimeofday(&time, NULL); + endtime = time.tv_sec * 1000000 + time.tv_usec; + debug_log("[ASM_Server][RETCB] ASM_CB_END cbtimelab=%3.3f(second), timeout=%d(milli second) (reciever=%d)\n", ((endtime-starttime)/1000000.), pollingTimeout, instance_id); + + /************************************** + * + * Close callback result pipe + * + **************************************/ + close(fd); + fd = -1; + debug_log("[ASM_Server][RETCB] Return value 0x%x\n", buf); + return buf; + +fail: + if (filename) { + g_free (filename); + filename = NULL; + } + if (filename2) { + g_free (filename2); + filename2 = NULL; + } + if (fd_ASM != -1) { + close(fd_ASM); + fd_ASM = -1; + } + if (fd != -1) { + close (fd); + fd = -1; + } + + return -1; +} + +gboolean __isPlayingNow() +{ + asm_instance_list_t *temp_list = head_list; + while (temp_list->next != tail_list) { + if (temp_list->sound_state == ASM_STATE_PLAYING ) { + return TRUE; + } + + temp_list = temp_list->next; + } + return FALSE; +} + +gboolean __isItPlayingNow(int instance_id, int handle) +{ + asm_instance_list_t *temp_list = head_list; + while (temp_list->next != tail_list) { + if (temp_list->instance_id == instance_id && temp_list->sound_handle == handle) { + if (temp_list->sound_state == ASM_STATE_PLAYING) { + return TRUE; + } + } + + temp_list = temp_list->next; + } + return FALSE; +} + +void __temp_print_list(char * msg) +{ + asm_instance_list_t *temp_list = head_list; + int i = 0; + + if (NULL != msg) { + debug_warning("[ASM_Server] %s\n", msg); + } + while (temp_list->next != tail_list) { + debug_log("[ASM_Server] List[%02d] ( %5ld, %2d, %-20s, %-20s, %9s, 0x%04x)\n", i, temp_list->instance_id, temp_list->sound_handle, + ASM_sound_events_str[temp_list->sound_event], + ASM_sound_state_str[temp_list->sound_state], + ASM_sound_resume_str[temp_list->need_resume], + temp_list->mm_resource); + temp_list = temp_list->next; + i++; + } +} + +void updatePhoneStatus() +{ + asm_instance_list_t *temp_list = head_list; + int error = 0; + + g_sound_status_pause = 0; + g_sound_status_playing = 0; + + while (temp_list->next != tail_list) { + if (temp_list->sound_state == ASM_STATE_PLAYING) { + if (temp_list->sound_event >= ASM_EVENT_SHARE_MMPLAYER && temp_list->sound_event < ASM_EVENT_MAX) { + g_sound_status_playing |= ASM_sound_type[(temp_list->sound_event) + 1].sound_status; + } + } else if (temp_list->sound_state == ASM_STATE_PAUSE ) { + if (temp_list->sound_event >= ASM_EVENT_SHARE_MMPLAYER && temp_list->sound_event < ASM_EVENT_MAX) { + g_sound_status_pause |= ASM_sound_type[(temp_list->sound_event) + 1].sound_status; + } + } + temp_list = temp_list->next; + } + + if (vconf_set_int(SOUND_STATUS_KEY, g_sound_status_playing)) { + debug_error("[ASM_Server[Error = %d][1st try] phonestatus_set \n", error); + if (vconf_set_int(SOUND_STATUS_KEY, g_sound_status_playing)) { + debug_error("[ASM_Server][Error = %d][2nd try] phonestatus_set \n", error); + } + } + + debug_log("[ASM_Server] soundstatus set to (0x%08x)\n", g_sound_status_playing); +} + + +void __asm_register_list(long int instance_id, int handle, ASM_sound_events_t sound_event, ASM_sound_states_t sound_state, ASM_resource_t mm_resource) +{ + asm_instance_list_t *temp_list; + temp_list = (asm_instance_list_t *)malloc(sizeof(asm_instance_list_t)); + temp_list->instance_id = instance_id; + temp_list->sound_handle = handle; + temp_list->sound_event = sound_event; + temp_list->sound_state = sound_state; + temp_list->need_resume = 0; + temp_list->mm_resource = mm_resource; + temp_list->monitor_active = 0; + temp_list->monitor_dirty = 0; + temp_list->next = head_list; + head_list = temp_list; + + __temp_print_list("Register List"); + updatePhoneStatus(); +} + +int __asm_unregister_list(int handle) +{ + asm_instance_list_t *temp_list = head_list; + asm_instance_list_t *temp_list2 = head_list; + int instance_id = -1; + + debug_log("[ASM_Server] __asm_unregister_list \n"); + + while (temp_list->next != tail_list) { + if (temp_list->sound_handle == handle) { + instance_id = temp_list->instance_id; + if (temp_list == head_list) + head_list = temp_list->next; + else + temp_list2->next = temp_list->next; + free(temp_list); + break; + } + temp_list2 = temp_list; + temp_list = temp_list->next; + } + + __temp_print_list("Unregister List for handle"); + updatePhoneStatus(); + return instance_id; +} + + +/* ------------------------- + * if PID exist return true, else return false + */ +gboolean isPIDExist(int pid) +{ + if (pid > 999999 || pid < 2) + return FALSE; + gchar *tmp = g_malloc0(25); + g_sprintf(tmp, "/proc/%d", pid); + if (access(tmp, R_OK)==0) { + g_free(tmp); + return TRUE; + } + g_free(tmp); + return FALSE; +} + + +/* ------------------------- + * + */ +void __check_dead_process() +{ + asm_instance_list_t *temp_list = head_list; + asm_instance_list_t *temp_list2 = head_list; + while (temp_list->next != tail_list) { + if (!isPIDExist(temp_list->instance_id)) { + debug_warning("[ASM_Server] PID(%ld) not exist! -> ASM_Server resource of pid(%ld) will be cleared \n", temp_list->instance_id, temp_list->instance_id); + + if (temp_list == head_list) { + head_list = temp_list->next; + } + temp_list2->next = temp_list->next; + free(temp_list); + } else { + temp_list2 = temp_list; + } + temp_list = temp_list2->next; + } + updatePhoneStatus(); +} + + + + +void emergent_exit(int exit_pid) +{ + asm_instance_list_t *temp_list = head_list; + int handle = -1; + int instance_id = -1; + + while (temp_list->next != tail_list) { + if (temp_list->instance_id == exit_pid) { + handle = temp_list->sound_handle; + + instance_id = __asm_unregister_list(handle); + + if (instance_id != -1) { + char str_error[256]; + char* filename = g_strdup_printf("/tmp/ASM.%d.%d", instance_id, handle); + char* filename2 = g_strdup_printf("/tmp/ASM.%d.%dr", instance_id, handle); + if (!remove(filename)) { + debug_log("[ASM_Server] remove %s success\n", filename); + } else { + strerror_r (errno, str_error, sizeof (str_error)); + debug_error("[ASM_Server] remove %s failed with %s\n", filename, str_error); + } + + if (!remove(filename2)) { + debug_log("[ASM_Server] remove %s success\n", filename2); + } else { + strerror_r (errno, str_error, sizeof (str_error)); + debug_error("[ASM_Server] remove %s failed with %s\n", filename2, str_error); + } + + g_free(filename); + g_free(filename2); + } + temp_list = head_list; + } else { + temp_list = temp_list->next; + } + } + + debug_log("[ASM_Server][EMERGENT_EXIT] complete\n"); + return; +} + + +int ___reorder_state(ASM_sound_states_t input) +{ + int res = 0; + + switch (input) { + case ASM_STATE_IGNORE: + case ASM_STATE_NONE: + res = 0; + break; + case ASM_STATE_WAITING: + case ASM_STATE_STOP: + res = 1; + break; + case ASM_STATE_PAUSE: + case ASM_STATE_PAUSE_BY_APP: + res = 2; + break; + case ASM_STATE_PLAYING: + res = 3; + break; + } + return res; +} + +ASM_sound_states_t __asm_find_process_status(int pid) +{ + asm_instance_list_t *temp_list = head_list; + ASM_sound_states_t result_state = ASM_STATE_NONE; + + debug_log("[ASM_Server] __asm_find_process_status for pid %d\n", pid); + + while (temp_list->next != tail_list) { + if (temp_list->instance_id == pid) { + if ( ___reorder_state(temp_list->sound_state) >= ___reorder_state(result_state)) { + result_state = temp_list->sound_state; + } + } + temp_list = temp_list->next; + } + + return result_state; +} + +ASM_sound_states_t __asm_find_list(ASM_requests_t request_id, int handle) +{ + asm_instance_list_t *temp_list = head_list; + + debug_log("[ASM_Server] __asm_find_list\n"); + + while (temp_list->next != tail_list) { + if ((request_id == ASM_REQUEST_GETSTATE && temp_list->sound_handle == handle)) { + return temp_list->sound_state; + } else { + temp_list = temp_list->next; + } + } + + return ASM_STATE_NONE; +} + +void __asm_change_state_list(long int instance_id, int handle, ASM_sound_states_t sound_state, ASM_resource_t mm_resource) +{ + asm_instance_list_t *temp_list = head_list; + debug_log("[ASM_Server] __asm_change_state_list\n"); + if (sound_state == ASM_STATE_IGNORE) { + debug_log("[ASM_Server] skip update state list %ld-%d\n", instance_id, handle); + return; + } + + while (temp_list->next != tail_list) { + if (temp_list->instance_id == instance_id && temp_list->sound_handle == handle) { + temp_list->sound_state = sound_state; + temp_list->mm_resource = mm_resource; + break; + } + temp_list = temp_list->next; + } + __update_monitor_active(instance_id); + updatePhoneStatus(); +} + +void __asm_change_need_resume_list(long int instance_id, int handle, ASM_resume_states_t need_resume) +{ + asm_instance_list_t *temp_list = head_list; + debug_log("[ASM_Server] __asm_change_need_resume_list\n"); + while (temp_list->next != tail_list) { + if (temp_list->instance_id == instance_id && temp_list->sound_handle == handle) { + temp_list->need_resume = need_resume; + break; + } + temp_list = temp_list->next; + } +} + + +void __asm_create_message_queue() +{ + asm_rcv_msgid = msgget((key_t)2014, 0666 | IPC_CREAT); + asm_snd_msgid = msgget((key_t)4102, 0666 | IPC_CREAT); + asm_cb_msgid = msgget((key_t)4103, 0666 | IPC_CREAT); + + if (asm_snd_msgid == -1 || asm_rcv_msgid == -1 || asm_cb_msgid == -1) { + debug_error("[ASM_Server] msgget failed with error(%d,%s) \n", errno, strerror(errno)); + exit(EXIT_FAILURE); + } +} + +void __asm_snd_message(ASM_msg_asm_to_lib_t *asm_snd_msg) +{ + if (msgsnd(asm_snd_msgid, (void *)asm_snd_msg, sizeof(asm_snd_msg->data), 0) == -1) { + debug_error("[ASM_Server] msgsnd failed with error %d\n", errno); + exit(EXIT_FAILURE); + } else { + debug_log("[ASM_Server] __asm_snd_message() success"); + } +} + +void __asm_rcv_message(ASM_msg_lib_to_asm_t *asm_rcv_msg) +{ + if (msgrcv(asm_rcv_msgid, (void *)asm_rcv_msg, sizeof(asm_rcv_msg->data), 0, 0) == -1) { + debug_error("[ASM_Server] msgrcv failed with error %d\n", errno); + exit(EXIT_FAILURE); + } else { + debug_log("[ASM_Server] __asm_rcv_message() success"); + } +} + +void __asm_get_empty_handle(long int instance_id, int *handle) +{ + asm_instance_list_t *temp_list = head_list; + unsigned int i = 0, find_empty = 0; + char handle_info[SERVER_HANDLE_MAX_COUNT]; + + debug_log("[ASM_Server] __asm_make_handle for %ld\n", instance_id); + __temp_print_list("current list before get new handle"); + + memset(handle_info, 0, sizeof(char) * SERVER_HANDLE_MAX_COUNT); + + while (temp_list->next != tail_list) { + handle_info[temp_list->sound_handle] = 1; + temp_list = temp_list->next; + } + + for (i = 0; i < ASM_SERVER_HANDLE_MAX; i++) { + if (handle_info[i] == 0) { + find_empty = 1; + break; + } + } + if (find_empty && (i != ASM_SERVER_HANDLE_MAX)) { + debug_error("[ASM_Server] New handle for %ld is %d\n", instance_id, i); + *handle = i; + } else { + debug_error("[ASM_Server] Handle is full for pid %ld\n", instance_id); + *handle = -1; + } + +} + +void __print_resource(unsigned short resource_status) +{ + if (resource_status == ASM_RESOURCE_NONE) + debug_log("[ASM_Server] resource NONE\n"); + if (resource_status & ASM_RESOURCE_CAMERA) + debug_log("[ASM_Server] resource CAMERA\n"); + if (resource_status & ASM_RESOURCE_VIDEO_OVERLAY) + debug_log("[ASM_Server] resource VIDEO OVERLAY\n"); + if (resource_status & ASM_RESOURCE_HW_ENCORDER) + debug_log("[ASM_Server] resource HW ENCORDER\n"); + if (resource_status & ASM_RESOURCE_HW_DECORDER) + debug_log("[ASM_Server] resource HW DECORDER\n"); + if (resource_status & ASM_RESOURCE_RADIO_TUNNER) + debug_log("[ASM_Server] resource RADIO TUNNER\n"); + if (resource_status & ASM_RESOURCE_TV_TUNNER) + debug_log("[ASM_Server] resource TV TUNNER\n"); +} + +void __asm_compare_priority_matrix(ASM_msg_asm_to_lib_t *asm_snd_msg, ASM_msg_asm_to_lib_t *asm_ret_msg, + long int instance_id, int handle, ASM_requests_t request_id, + ASM_sound_events_t sound_event,ASM_sound_states_t sound_state, ASM_resource_t mm_resource) +{ + int no_conflict_flag = 0; + + debug_log("[ASM_Server][%s] ENTER >>>>>> \n", __func__); + + /* If nobody is playing now, this means no conflict */ + if (ASM_STATUS_NONE == g_sound_status_playing) { + debug_log("[ASM_Server][%s] No conflict ( No existing Sound )\n", __func__); + + ASM_SND_MSG_SET(asm_snd_msg, handle, -1, ASM_COMMAND_NONE, sound_state, ASM_EVENT_NONE); + + no_conflict_flag = 1; + } else { /* Somebody is playing */ + asm_instance_list_t *temp_list = head_list; + int updatedflag = 0; + int cb_res = 0; + int update_state = ASM_STATE_NONE; + + while (temp_list->next != tail_list) { + + debug_log("[ASM_Server][%s]( %5ld, %2d, %-20s, %-20s, %9s, 0x%04x) ..... [%s]\n", __func__, + temp_list->instance_id, temp_list->sound_handle, + ASM_sound_events_str[temp_list->sound_event], + ASM_sound_state_str[temp_list->sound_state], + ASM_sound_resume_str[temp_list->need_resume], + temp_list->mm_resource, + (temp_list->sound_state != ASM_STATE_PLAYING)? "PASS" : "CHECK"); + + /* Find who's playing now */ + if (temp_list->sound_state != ASM_STATE_PLAYING) { + temp_list = temp_list->next; + continue; + } + + /* Found it */ + ASM_sound_states_t current_play_state = temp_list->sound_state; + ASM_sound_events_t current_play_sound_event = temp_list->sound_event; + long int current_play_instance_id = temp_list->instance_id; + int current_play_handle = temp_list->sound_handle; + ASM_resource_t current_using_resource = temp_list->mm_resource; + + if ((current_play_instance_id == instance_id) && (current_play_handle == handle)) { + debug_warning("[ASM_Server][%s] This is my handle. skip %d %d\n", __func__, instance_id, handle); + temp_list = temp_list->next; + continue; + } + + /* Request is PLAYING */ + if (sound_state == ASM_STATE_PLAYING) { + /* Determine sound policy */ + ASM_sound_cases_t sound_case = ASM_sound_case[current_play_sound_event][sound_event]; + +#ifdef SUPPORT_GCF + /* GCF case is exception case */ + /* NOTE : GCF exception case only */ + if ((is_gcf) && (sound_case != ASM_CASE_1PLAY_2PLAY_MIX)) { + sound_case = ASM_CASE_1PLAY_2PLAY_MIX;; + } +#endif + + debug_log("[ASM_Server][%s] Conflict policy[0x%x][0x%x]: %s\n", __func__, current_play_sound_event,sound_event,ASM_sound_cases_str[sound_case]); + switch (sound_case) { + case ASM_CASE_1PLAY_2STOP: + { + if (current_play_instance_id == instance_id) { + /* PID is policy group.*/ + debug_log("[ASM_Server][%s] Do not send Stop callback in same pid %ld\n", __func__, instance_id); + } else { + ASM_SND_MSG_SET(asm_snd_msg, handle, handle, ASM_COMMAND_STOP, sound_state, current_play_sound_event); + temp_list = tail_list; /* skip all remain list */ + break; + } + + /* Prepare msg to send */ + ASM_SND_MSG_SET(asm_snd_msg, handle, handle, ASM_COMMAND_PLAY, sound_state, current_play_sound_event); + + if (!updatedflag) { + if (request_id == ASM_REQUEST_REGISTER){ + __asm_register_list(instance_id, handle, sound_event, sound_state, mm_resource); + } else { + __asm_change_state_list(instance_id, handle, sound_state, mm_resource); + } + updatedflag = 1; + } + break; + } + + case ASM_CASE_1STOP_2PLAY: + { + if (current_play_instance_id == instance_id) { + /* PID is policy group. */ + debug_log("[ASM_Server][%s] Do not send Stop callback in same pid %ld\n", __func__, instance_id); + } else { + ASM_event_sources_t event_src; + unsigned short resource_status = current_using_resource & mm_resource; + + /* Determine root cause of conflict */ + if (resource_status != ASM_RESOURCE_NONE) { + event_src = ASM_EVENT_SOURCE_RESOURCE_CONFLICT; + } else { + switch (sound_event) { + case ASM_EVENT_CALL: + case ASM_EVENT_RICH_CALL: + case ASM_EVENT_VIDEOCALL: + event_src = ASM_EVENT_SOURCE_CALL_START; + break; + + case ASM_EVENT_EARJACK_UNPLUG: + event_src = ASM_EVENT_SOURCE_EARJACK_UNPLUG; + break; + + case ASM_EVENT_ALARM: + event_src = ASM_EVENT_SOURCE_ALARM_START; + break; + + case ASM_EVENT_EMERGENCY: + event_src = ASM_EVENT_SOURCE_EMERGENCY_START; + break; + + case ASM_EVENT_EXCLUSIVE_MMCAMCORDER: + event_src = ASM_EVENT_SOURCE_RESUMABLE_MEDIA; + break; + + default: + event_src = ASM_EVENT_SOURCE_MEDIA; + break; + } + } + + /* Execute callback function for monitor handle */ + int monitor_handle = -1; + if (__find_clean_monitor_handle(current_play_instance_id, &monitor_handle)) { + cb_res = __do_callback(current_play_instance_id, monitor_handle, ASM_COMMAND_STOP, event_src); + debug_warning("[ASM_Server][%s] send stop callback for monitor handle of pid %d\n", __func__, current_play_instance_id); + if (cb_res != ASM_CB_RES_NONE && cb_res != ASM_CB_RES_STOP) { + debug_error("[ASM_Server][%s] oops! not suspected callback result %d\n", __func__, cb_res); + } + __set_monitor_dirty(current_play_instance_id); + + /* If current is playing and input event is CALL/VIDEOCALL/ALARM/EXCLUSIVE_MMCAMCORDER, set to need resume */ + if ( __is_need_resume(sound_event) && (current_play_state == ASM_STATE_PLAYING) ) { + __asm_change_need_resume_list(current_play_instance_id, monitor_handle, ASM_NEED_RESUME); + } + } + + /* Execute callback function for worker handle */ + cb_res = __do_callback(current_play_instance_id,current_play_handle,ASM_COMMAND_STOP, event_src); + if (cb_res != ASM_CB_RES_NONE && cb_res != ASM_CB_RES_STOP) + debug_error("[ASM_Server][%s] oops! not suspected result %d\n", __func__, cb_res); + debug_warning("[ASM_Server][%s] __asm_compare_priority_matrix(1STOP_2PLAY) : __do_callback Complete : TID=%ld, handle=%d", + __func__, current_play_instance_id,current_play_handle ); + + /* If current is playing and input event is CALL/VIDEOCALL/ALARM/EXCLUSIVE_MMCAMCORDER, set to need resume */ + if( __is_need_resume(sound_event) && (current_play_state == ASM_STATE_PLAYING) ) { + __asm_change_need_resume_list(current_play_instance_id, current_play_handle, ASM_NEED_RESUME); + } + + /* Set state to NONE */ + /* FIXME: is it okay to set none instead on STOP? */ + //__asm_change_state_list(current_play_instance_id, current_play_handle, ASM_STATE_NONE, ASM_RESOURCE_NONE); + __asm_change_state_list(current_play_instance_id, current_play_handle, + (cb_res == ASM_CB_RES_STOP)? ASM_STATE_STOP : ASM_STATE_NONE, + ASM_RESOURCE_NONE); + + + /* TODO: what if stopped is fmradio???? */ + if (current_play_sound_event == ASM_EVENT_SHARE_FMRADIO || + current_play_sound_event == ASM_EVENT_EXCLUSIVE_FMRADIO) + { + session_t cur_session; + MMSoundMgrSessionGetSession(&cur_session); + if (cur_session == SESSION_FMRADIO) { + debug_log ("[ASM_Server][%s] ****** SESSION_FMRADIO end ******\n", __func__); + MMSoundMgrSessionSetSession(SESSION_FMRADIO, SESSION_END); + } + } + } + + /* Prepare msg to send */ + ASM_SND_MSG_SET(asm_snd_msg, handle, handle, ASM_COMMAND_PLAY, sound_state, current_play_sound_event); + + if (!updatedflag) { + if (request_id == ASM_REQUEST_REGISTER) { + __asm_register_list(instance_id, handle, sound_event, sound_state, mm_resource); + } else { + __asm_change_state_list(instance_id, handle, sound_state, mm_resource); + } + updatedflag = 1; + } + break; + } + + case ASM_CASE_1PAUSE_2PLAY: + { + ASM_resource_t update_resource = current_using_resource; + if (current_play_instance_id == instance_id) { + debug_log("[ASM_Server][%s] Do not send Pause callback in same pid %ld\n", __func__, instance_id); + } else { + ASM_event_sources_t event_src; + ASM_sound_commands_t command; + + unsigned short resource_status = current_using_resource & mm_resource; + if (resource_status != ASM_RESOURCE_NONE) { + debug_log("[ASM_Server][%s] resource conflict found 0x%x\n", __func__, resource_status); + event_src = ASM_EVENT_SOURCE_RESOURCE_CONFLICT; + command = ASM_COMMAND_STOP; + } else { + switch (sound_event) { + case ASM_EVENT_CALL: + case ASM_EVENT_RICH_CALL: + case ASM_EVENT_VIDEOCALL: + event_src = ASM_EVENT_SOURCE_CALL_START; + break; + + case ASM_EVENT_EARJACK_UNPLUG: + event_src = ASM_EVENT_SOURCE_EARJACK_UNPLUG; + break; + + case ASM_EVENT_ALARM: + event_src = ASM_EVENT_SOURCE_ALARM_START; + break; + + case ASM_EVENT_EMERGENCY: + event_src = ASM_EVENT_SOURCE_EMERGENCY_START; + break; + + case ASM_EVENT_EXCLUSIVE_MMCAMCORDER: + event_src = ASM_EVENT_SOURCE_RESUMABLE_MEDIA; + break; + + case ASM_EVENT_SHARE_MMPLAYER: + case ASM_EVENT_EXCLUSIVE_MMPLAYER: + if ( current_play_sound_event == ASM_EVENT_SHARE_MMPLAYER || + current_play_sound_event == ASM_EVENT_EXCLUSIVE_MMPLAYER ) { + event_src = ASM_EVENT_SOURCE_OTHER_PLAYER_APP; + break; + } + + default: + event_src = ASM_EVENT_SOURCE_MEDIA; + break; + } + command = ASM_COMMAND_PAUSE; + } + + /* Execute callback function for monitor handle */ + int monitor_handle = -1; + if (__find_clean_monitor_handle(current_play_instance_id, &monitor_handle)) { + cb_res = __do_callback(current_play_instance_id, monitor_handle, ASM_COMMAND_STOP, event_src); + debug_warning("[ASM_Server][%s] send stop callback for monitor handle of pid %d\n", __func__, current_play_instance_id); + if (cb_res != ASM_CB_RES_NONE && cb_res != ASM_CB_RES_STOP) { + debug_error("[ASM_Server][%s] oops! not suspected callback result %d\n", __func__, cb_res); + } + __set_monitor_dirty(current_play_instance_id); + + /* If current is playing and input event is CALL/VIDEOCALL/ALARM/EXCLUSIVE_MMCAMCORDER, set to need resume */ + if( __is_need_resume(sound_event) && (current_play_state == ASM_STATE_PLAYING)) { + __asm_change_need_resume_list(current_play_instance_id, monitor_handle, ASM_NEED_RESUME); + } + } + + /* Execute callback function for worker handle */ + cb_res = __do_callback(current_play_instance_id,current_play_handle,command, event_src); + debug_warning("[ASM_Server][%s] (1PAUSE_2PLAY) : Callback of %s: TID(%ld), result(%d)", + __func__,ASM_sound_command_str[command], current_play_instance_id, cb_res); + /*Change current sound' state when it is in 1Pause_2Play case */ + switch (cb_res) { + case ASM_CB_RES_PAUSE: + update_state = ASM_STATE_PAUSE; + break; + + case ASM_CB_RES_NONE: + case ASM_CB_RES_STOP: + update_state = ASM_STATE_NONE; + update_resource = ASM_RESOURCE_NONE; + break; + + case ASM_CB_RES_IGNORE: + update_state = ASM_STATE_IGNORE; + break; + + default: + debug_error("[ASM_Server][%s] oops! not suspected result %d\n", __func__, cb_res); + update_state = ASM_STATE_NONE; + break; + } + + /* If current is playing and input event is CALL/VIDEOCALL/ALARM, set to need resume */ + if( __is_need_resume(sound_event) + &&(current_play_state == ASM_STATE_PLAYING)) { + __asm_change_need_resume_list(current_play_instance_id, current_play_handle, ASM_NEED_RESUME); + } + + __asm_change_state_list(current_play_instance_id, current_play_handle, update_state, update_resource); + } + + /* Prepare msg to send */ + ASM_SND_MSG_SET(asm_snd_msg, handle, handle, ASM_COMMAND_PLAY, sound_state, current_play_sound_event); + + if (!updatedflag) { + if (request_id == ASM_REQUEST_REGISTER) { + __asm_register_list(instance_id, handle, sound_event, sound_state, mm_resource); + } else { + __asm_change_state_list(instance_id, handle, sound_state, mm_resource); + } + updatedflag = 1; + } + break; + } + + case ASM_CASE_1PLAY_2PLAY_MIX: + { + if (current_play_instance_id == instance_id) { + debug_log("[ASM_Server] Do not send check resource conflict in same pid %ld\n", instance_id); + } else { + /* MIX but need to check resource conflict */ + debug_warning("[ASM_Server][%s] 1PLAY_2PLAY_MIX : !!!\n", __func__); + ASM_resource_t update_resource = current_using_resource; + unsigned short resource_status = current_using_resource & mm_resource; + if (resource_status) { /* Resouce conflict */ + debug_warning("[ASM_Server][%s] there is system resource conflict 0x%x\n", __func__, resource_status); + __print_resource(resource_status); + + /* Execute callback function for monitor handle */ + int monitor_handle = -1; + if (__find_clean_monitor_handle(current_play_instance_id, &monitor_handle)) { + cb_res = __do_callback(current_play_instance_id, monitor_handle, ASM_COMMAND_STOP, ASM_EVENT_SOURCE_RESOURCE_CONFLICT); + if (cb_res != ASM_CB_RES_NONE && cb_res != ASM_CB_RES_STOP) { + debug_error("[ASM_Server][%s] oops! not suspected callback result %d\n", __func__, cb_res); + } + debug_warning("[ASM_Server][%s] send stop callback for monitor handle of pid %d\n", __func__, current_play_instance_id); + __set_monitor_dirty(current_play_instance_id); + + /* If current is playing and input event is CALL/VIDEOCALL/ALARM, set to need resume */ + if( __is_need_resume(sound_event) + && (current_play_state == ASM_STATE_PLAYING) ) { + __asm_change_need_resume_list(current_play_instance_id, monitor_handle, ASM_NEED_RESUME); + } + } + + /* Execute callback function for worker handle */ + /* Stop current resource holding instance */ + cb_res = __do_callback(current_play_instance_id, current_play_handle, ASM_COMMAND_STOP, ASM_EVENT_SOURCE_RESOURCE_CONFLICT); + debug_warning("[ASM_Server][%s] 1PLAY_2PLAY_MIX : Resource Conflict : TID(%ld)\n", + __func__, current_play_instance_id); + + /* Change current sound */ + switch (cb_res) { + case ASM_CB_RES_NONE: + case ASM_CB_RES_STOP: + update_state = ASM_STATE_NONE; + update_resource = ASM_RESOURCE_NONE; + break; + + case ASM_CB_RES_IGNORE: + update_state = ASM_STATE_IGNORE; + break; + + default: + debug_error("[ASM_Server][%s] oops! not suspected result %d\n", __func__, cb_res); + update_state = ASM_STATE_NONE; + break; + } + + __asm_change_state_list(current_play_instance_id, current_play_handle, update_state, update_resource); + } + } + + /* Prepare msg to send */ + ASM_SND_MSG_SET(asm_snd_msg, handle, handle, ASM_COMMAND_PLAY, sound_state, current_play_sound_event); + + if (!updatedflag) { + if (request_id == ASM_REQUEST_REGISTER) { + __asm_register_list(instance_id, handle, sound_event, sound_state, mm_resource); + } else { + __asm_change_state_list(instance_id, handle, sound_state, mm_resource); + } + updatedflag = 1; + } + break; + } + + case ASM_CASE_RESOURCE_CHECK: + { + unsigned short resource_status = current_using_resource & mm_resource; + if (resource_status!= ASM_RESOURCE_NONE) { + debug_log("[ASM_Server][%s] ASM_CASE_RESOURCE_CHECK : resource conflict found 0x%x\n", __func__, resource_status); + + switch (resource_status){ + case ASM_RESOURCE_CAMERA: + if (current_play_sound_event == ASM_EVENT_SHARE_MMCAMCORDER || + current_play_sound_event == ASM_EVENT_EXCLUSIVE_MMCAMCORDER || + current_play_sound_event == ASM_EVENT_VIDEOCALL || + current_play_sound_event == ASM_EVENT_RICH_CALL ) { + /* 1PLAY,2STOP */ + debug_log("[ASM_Server][%s] ASM_CASE_RESOURCE_CHECK : 1PLAY_2STOP"); + + ASM_SND_MSG_SET(asm_snd_msg, handle, handle, ASM_COMMAND_STOP, sound_state, current_play_sound_event); + temp_list = tail_list; /* skip all remain list */ + + } else if (current_play_sound_event == ASM_EVENT_EXCLUSIVE_RESOURCE){ + /* 1STOP,2PLAY */ + debug_log("[ASM_Server][%s] ASM_CASE_RESOURCE_CHECK : 1STOP_2PLAY"); + + ASM_event_sources_t event_src; + event_src = ASM_EVENT_SOURCE_RESOURCE_CONFLICT; + + /* Execute callback function for worker handle */ + cb_res = __do_callback(current_play_instance_id,current_play_handle,ASM_COMMAND_STOP, event_src); + if (cb_res != ASM_CB_RES_NONE && cb_res != ASM_CB_RES_STOP) { + debug_error("[ASM_Server][%s] oops! not suspected result %d\n", __func__, cb_res); + } + debug_warning("[ASM_Server][%s] __asm_compare_priority_matrix(1STOP_2PLAY) : __do_callback Complete : TID=%ld, handle=%d", + __func__, current_play_instance_id,current_play_handle ); + + /* Set state to STOP */ + __asm_change_state_list(current_play_instance_id, current_play_handle, + (cb_res == ASM_CB_RES_STOP)? ASM_STATE_STOP : ASM_STATE_NONE, + ASM_RESOURCE_NONE); + + /* Prepare msg to send */ + ASM_SND_MSG_SET(asm_snd_msg, handle, handle, ASM_COMMAND_PLAY, sound_state, current_play_sound_event); + + if (!updatedflag) { + if (request_id == ASM_REQUEST_REGISTER) { + __asm_register_list(instance_id, handle, sound_event, sound_state, mm_resource); + } else { + __asm_change_state_list(instance_id, handle, sound_state, mm_resource); + } + updatedflag = 1; + } + } + break; + default: + debug_warning("[ASM_Server][%s] ASM_CASE_RESOURCE_CHECK : Not support it(0x%x)", __func__, resource_status); + break; + } + } else { + debug_log("[ASM_Server][%s] ASM_CASE_RESOURCE_CHECK : do MIX"); + /* DO MIX */ + /* Prepare msg to send */ + ASM_SND_MSG_SET(asm_snd_msg, handle, handle, ASM_COMMAND_PLAY, sound_state, current_play_sound_event); + + if (!updatedflag) { + if (request_id == ASM_REQUEST_REGISTER) { + __asm_register_list(instance_id, handle, sound_event, sound_state, mm_resource); + } else { + __asm_change_state_list(instance_id, handle, sound_state, mm_resource); + } + updatedflag = 1; + } + } + break; + } + + default: + { + ASM_SND_MSG_SET(asm_snd_msg, handle, handle, ASM_COMMAND_NONE, sound_state, current_play_sound_event); + debug_warning("[ASM_Server][%s] ASM_CASE_NONE [It should not be seen] !!!\n", __func__); + break; + } + } /* switch (sound_case) */ + } else { + /* Request was not PLAYING, this means no conflict, just do set */ + debug_log("[ASM_Server][%s] No Conflict (Just Register or Set State) !!!\n",__func__); + ASM_SND_MSG_SET(asm_snd_msg, handle, handle, ASM_COMMAND_NONE, sound_state, current_play_sound_event); + + if (sound_state == ASM_STATE_NONE) { + debug_log("[ASM_Server][%s] 1PLAY_2NONE : No Conflict !!!\n", __func__); + } else if (sound_state == ASM_STATE_WAITING) { + debug_log("[ASM_Server][%s] 1PLAY_2WAIT : No Conflict !!!\n", __func__); + } + + if (!updatedflag) { + if (request_id == ASM_REQUEST_REGISTER) { + __asm_register_list(instance_id, handle, sound_event, sound_state, mm_resource); + } else { + __asm_change_state_list(instance_id, handle, sound_state, mm_resource); + } + updatedflag = 1; + } + } + + temp_list = temp_list->next; + + } /* while (temp_list->next != tail_list) */ + + /* Make all monitor handle dirty flag clean. */ + __set_all_monitor_clean(); + } + + /* Find if resource confilct exists in case of 1Pause 2Play or 1Stop 2Play */ + if (ASM_STATUS_NONE != g_sound_status_pause && mm_resource != ASM_RESOURCE_NONE && + (asm_snd_msg->data.result_sound_command == ASM_COMMAND_PLAY || no_conflict_flag)) { + asm_instance_list_t *temp_list = head_list; + int cb_res = 0; + + while (temp_list->next != tail_list) { + /* Who is in PAUSE state? */ + if (temp_list->sound_state == ASM_STATE_PAUSE) { + /* Found PAUSE state */ + debug_warning("[ASM_Server][%s] Now list's state is pause. %d %d\n", __func__, instance_id, handle); + ASM_sound_events_t current_play_sound_event = temp_list->sound_event; + long int current_play_instance_id = temp_list->instance_id; + int current_play_handle = temp_list->sound_handle; + ASM_resource_t current_using_resource = temp_list->mm_resource; + + if ((current_play_instance_id == instance_id) && (current_play_handle == handle)) { + if (request_id == ASM_REQUEST_SETSTATE) { + debug_warning("[ASM_Server][%s] Own handle. Pause state change to play. %d %d\n", __func__, instance_id, handle); + __asm_change_state_list(instance_id, handle, sound_state, mm_resource); + } else { + debug_warning("[ASM_Server][%s] This is my handle. skip %d %d\n", __func__, instance_id, handle); + } + temp_list = temp_list->next; + continue; + } + + if (sound_state == ASM_STATE_PLAYING) { + ASM_sound_cases_t sound_case = ASM_sound_case[current_play_sound_event][sound_event]; + + debug_log("[ASM_Server][%s] Conflict policy[0x%x][0x%x]: %s\n", __func__, current_play_sound_event, sound_event, ASM_sound_cases_str[sound_case]); + switch (sound_case) { + case ASM_CASE_1PAUSE_2PLAY: + case ASM_CASE_1STOP_2PLAY: + { + if (current_play_instance_id == instance_id) { + //PID is policy group. + debug_log("[ASM_Server][%s] Do not send Stop callback in same pid %ld\n", __func__, instance_id); + } else { + unsigned short resource_status = current_using_resource & mm_resource; + + /* Check conflict with paused instance */ + if (resource_status != ASM_RESOURCE_NONE) { + debug_warning("[ASM_Server][%s] there is system resource conflict with paused instance 0x%x\n", __func__, resource_status); + __print_resource(resource_status); + } else { + debug_log("[ASM_Server][%s] no resource conflict with paused instance\n", __func__); + break; + } + + /* Execute callback function for monitor handle */ + int monitor_handle = -1; + if (__find_clean_monitor_handle(current_play_instance_id, &monitor_handle)) { + cb_res = __do_callback(current_play_instance_id, monitor_handle, ASM_COMMAND_STOP, ASM_EVENT_SOURCE_RESOURCE_CONFLICT); + if (cb_res != ASM_CB_RES_NONE && cb_res != ASM_CB_RES_STOP) { + debug_error("[ASM_Server][%s] oops! not suspected callback result %d\n", __func__, cb_res); + } + debug_warning("[ASM_Server][%s] send stop callback for monitor handle of pid %d\n", __func__, current_play_instance_id); + + __set_monitor_dirty(current_play_instance_id); + } + + /* Execute callback function for worker handle */ + cb_res = __do_callback(current_play_instance_id,current_play_handle, ASM_COMMAND_STOP, ASM_EVENT_SOURCE_RESOURCE_CONFLICT); + if (cb_res != ASM_CB_RES_NONE && cb_res != ASM_CB_RES_STOP) { + debug_error("[ASM_Server][%s] oops! not suspected result %d\n", __func__, cb_res); + } + debug_warning("[ASM_Server][%s] 1STOP_2PLAY cause RESOURCE : __do_callback Complete : TID=%ld, handle=%d", + __func__, current_play_instance_id,current_play_handle ); + + __asm_change_state_list(current_play_instance_id, current_play_handle, ASM_STATE_NONE, ASM_RESOURCE_NONE); + } + + debug_log("[ASM_Server][%s] 1STOP_2PLAY cause RESOURCE : msg sent and then received msg !!!\n",__func__); + break; + } + + default: + /* debug_warning("[ASM_Server] >>>> __asm_compare_priority_matrix : ASM_CASE_NONE [do not anything] !!!\n"); */ + break; + + } /* switch (sound_case) */ + } else { + /* debug_warning("[ASM_Server] >>>> __asm_compare_priority_matrix : ASM_CASE_NONE [do not anything] !!!\n"); */ + } + } /* if (temp_list->sound_state == ASM_STATE_PAUSE) */ + + temp_list = temp_list->next; + } /* while (temp_list->next != tail_list) */ + } + + /* Finally, no conflict */ + if (no_conflict_flag) { + if (request_id == ASM_REQUEST_REGISTER) { + __asm_register_list(instance_id, handle, sound_event, sound_state, mm_resource); + } else { + __asm_change_state_list(instance_id, handle, sound_state, mm_resource); + } + } + + /* Send response to client */ + asm_snd_msg->instance_id = instance_id; + +#if 1 + if (asm_ret_msg) { + *asm_ret_msg = *asm_snd_msg; + } else { + __asm_snd_message(asm_snd_msg); + } +#else + __asm_snd_message(asm_snd_msg); +#endif + + debug_log("[ASM_Server][%s] LEAVE <<<<<< \n", __func__); +} + +void __asm_do_all_resume_callback(ASM_event_sources_t eventsrc) +{ + asm_instance_list_t *temp_list = head_list; + int cb_res = 0; + + debug_log("[ASM_Server][%s] >>>>>>>>>> ENTER with EventSrc [%d]\n", __func__, eventsrc); + + while (temp_list->next != tail_list) { + if (temp_list->need_resume == ASM_NEED_RESUME) { + { + cb_res = __do_callback(temp_list->instance_id, temp_list->sound_handle, ASM_COMMAND_RESUME, eventsrc); + switch (cb_res) { + case ASM_CB_RES_PLAYING: + temp_list->sound_state = ASM_STATE_PLAYING; + break; + case ASM_CB_RES_IGNORE: + case ASM_CB_RES_NONE: + case ASM_CB_RES_STOP: + case ASM_CB_RES_PAUSE: + default: + /* do nothing */ + break; + } + } + temp_list->need_resume = ASM_NEED_NOT_RESUME; + } + temp_list = temp_list->next; + } + + debug_log("[ASM_Server][%s] <<<<<<<<<< LEAVE\n", __func__); +} + +#ifdef USE_SECURITY +gboolean __asm_check_check_privilege (unsigned char* cookie) +{ + int asm_gid = -1; + int retval = 0; + + /* Get ASM server group id */ + asm_gid = security_server_get_gid("asm"); + debug_log ("[ASM_Server][Security] asm server gid = [%d]\n", asm_gid); + if (asm_gid < 0) { + debug_error ("[ASM_Server][Security] security_server_get_gid() failed. error=[%d]\n", asm_gid); + return false; + } + + /* Check privilege with valid group id */ + retval = security_server_check_privilege((char *)cookie, asm_gid); + if (retval == SECURITY_SERVER_API_SUCCESS) { + debug_log("[ASM_Server][Security] security_server_check_privilege() returns [%d]\n", retval); + return true; + } else { + debug_error("[ASM_Server][Security] security_server_check_privilege() returns [%d]\n", retval); + return false; + } +} +#endif /* USE_SECURITY */ + +int __asm_process_message (void *rcv_msg, void *ret_msg) +{ + long int rcv_instance_id; + ASM_requests_t rcv_request_id; + ASM_sound_events_t rcv_sound_event; + ASM_sound_states_t rcv_sound_state; + ASM_resource_t rcv_resource; + int rcv_sound_handle; + ASM_msg_asm_to_lib_t asm_snd_msg; + ASM_msg_lib_to_asm_t *asm_rcv_msg = (ASM_msg_lib_to_asm_t *)rcv_msg; + ASM_msg_asm_to_lib_t *asm_ret_msg = (ASM_msg_asm_to_lib_t *)ret_msg; + + debug_log ("[ASM_Server] ===================================================================== [%s] Starting.... ", __func__); + pthread_mutex_lock(&g_mutex_asm); + debug_log ("[ASM_Server] ===================================================================== [%s] Started!!! (LOCKED) ", __func__); + + rcv_instance_id = asm_rcv_msg->instance_id; + rcv_sound_handle = asm_rcv_msg->data.handle; + rcv_request_id = asm_rcv_msg->data.request_id; + rcv_sound_event = asm_rcv_msg->data.sound_event; + rcv_sound_state = asm_rcv_msg->data.sound_state; + rcv_resource = asm_rcv_msg->data.system_resource; + + /*******************************************************************/ + debug_log("[ASM_Server] received msg (tid=%ld,handle=%d,req=%d,event=0x%x,state=0x%x,resource=0x%x)\n", + rcv_instance_id, rcv_sound_handle, rcv_request_id, rcv_sound_event, rcv_sound_state, rcv_resource); + if (rcv_request_id != ASM_REQUEST_EMERGENT_EXIT) { + debug_warning("[ASM_Server] request_id : %s\n", ASM_sound_request_str[rcv_request_id]); + if (rcv_request_id == ASM_REQUEST_SET_SUBSESSION) { + debug_warning("[ASM_Server] subsession : %s\n", subsession_str[rcv_sound_event]); + } else { + debug_warning("[ASM_Server] sound_event : %s\n", ASM_sound_events_str[rcv_sound_event]); + debug_warning("[ASM_Server] sound_state : %s\n", ASM_sound_state_str[rcv_sound_state]); + debug_warning("[ASM_Server] resource : 0x%x\n", rcv_resource); + } + } + /*******************************************************************/ + debug_log ("[ASM_Server] +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ [%s]", __func__); + + switch (rcv_request_id) { + case ASM_REQUEST_REGISTER: +#ifdef USE_SECURITY + /* do security check */ + if (__asm_check_check_privilege(asm_rcv_msg->data.cookie) == 0) { + debug_error ("[ASM_Server][Security] __asm_check_check_privilege() failed....\n"); + asm_snd_msg.instance_id = rcv_instance_id; + asm_snd_msg.data.alloc_handle = -1; + asm_snd_msg.data.cmd_handle = -1; + asm_snd_msg.data.check_privilege = 0; + if (asm_ret_msg == NULL) + __asm_snd_message(&asm_snd_msg); + break; + } + debug_log ("[ASM_Server][Security] __asm_check_check_privilege() success\n"); + asm_snd_msg.data.check_privilege = 1; +#endif /* USE_SECURITY */ + __check_dead_process(); + + __asm_get_empty_handle(rcv_instance_id, &rcv_sound_handle); + if (rcv_sound_handle == -1) { + asm_snd_msg.instance_id = rcv_instance_id; + asm_snd_msg.data.alloc_handle = -1; + asm_snd_msg.data.cmd_handle = -1; + if (asm_ret_msg == NULL) + __asm_snd_message(&asm_snd_msg); + } else { + __asm_compare_priority_matrix(&asm_snd_msg, asm_ret_msg, + rcv_instance_id, rcv_sound_handle, rcv_request_id, rcv_sound_event, rcv_sound_state, rcv_resource); + + /* FIXME: Is this right place? */ + if (rcv_sound_event == ASM_EVENT_CALL || rcv_sound_event == ASM_EVENT_RICH_CALL) { + debug_log ("[ASM_Server] ****** SESSION_VOICECALL start ******\n"); + MMSoundMgrSessionSetSession(SESSION_VOICECALL, SESSION_START); + } else if (rcv_sound_event == ASM_EVENT_VIDEOCALL) { + debug_log ("[ASM_Server] ****** SESSION_VOIP start ******\n"); + MMSoundMgrSessionSetSession(SESSION_VOIP, SESSION_START); + } + } + + break; + + case ASM_REQUEST_UNREGISTER: + __asm_unregister_list(rcv_sound_handle); + /* only support resuming at end of call & alarm interrupt */ + switch (rcv_sound_event) { + case ASM_EVENT_CALL: + case ASM_EVENT_RICH_CALL: + case ASM_EVENT_VIDEOCALL: + if (rcv_sound_event == ASM_EVENT_CALL || rcv_sound_event == ASM_EVENT_RICH_CALL) { + debug_log ("[ASM_Server] ****** SESSION_VOICECALL end ******\n"); + MMSoundMgrSessionSetSession(SESSION_VOICECALL, SESSION_END); + } else if (rcv_sound_event == ASM_EVENT_VIDEOCALL) { + debug_log ("[ASM_Server] ****** SESSION_VOIP end ******\n"); + MMSoundMgrSessionSetSession(SESSION_VOIP, SESSION_END); + } + break; + + case ASM_EVENT_ALARM: + { + session_t cur_session; + MMSoundMgrSessionGetSession(&cur_session); + if (cur_session == SESSION_NOTIFICATION) { + debug_log ("[ASM_Server] ****** SESSION_NOTIFICATON end ******\n"); + MMSoundMgrSessionSetSession(SESSION_NOTIFICATION, SESSION_END); + __asm_do_all_resume_callback(ASM_EVENT_SOURCE_ALARM_END); + } else if (cur_session == SESSION_VOICECALL || cur_session == SESSION_VOIP) { + debug_log ("[ASM_Server] ****** Alarm ends on Call/Voip session ******\n"); + } else { + debug_warning ("[ASM_Server] ****** Not expected case : current session was [%d] ******\n", cur_session); + } + break; + } + + case ASM_EVENT_EMERGENCY: + debug_log ("[ASM_Server] ****** SESSION_EMERGENCY end ******\n"); + MMSoundMgrSessionSetSession(SESSION_EMERGENCY, SESSION_END); + __asm_do_all_resume_callback(ASM_EVENT_SOURCE_EMERGENCY_END); + break; + + + default: + break; + } + + break; + + case ASM_REQUEST_SETSTATE: + __check_dead_process(); + if ( rcv_sound_state == ASM_STATE_PLAYING ) { + if ( __isItPlayingNow(rcv_instance_id, rcv_sound_handle)) { + __asm_change_state_list(rcv_instance_id, rcv_sound_handle, rcv_sound_state, rcv_resource); + + asm_snd_msg.data.cmd_handle = rcv_sound_handle; + asm_snd_msg.data.result_sound_command = ASM_COMMAND_NONE; + asm_snd_msg.data.result_sound_state = rcv_sound_state; + asm_snd_msg.instance_id = rcv_instance_id; + if (asm_ret_msg == NULL) + __asm_snd_message(&asm_snd_msg); + } else { + __asm_compare_priority_matrix(&asm_snd_msg, asm_ret_msg, + rcv_instance_id, rcv_sound_handle, rcv_request_id, rcv_sound_event, rcv_sound_state, rcv_resource); + + /* FIXME: Is this right place? */ + /* If compare result is play and event was alarm, set session to notification */ + if (asm_snd_msg.data.result_sound_command == ASM_COMMAND_PLAY || + asm_snd_msg.data.result_sound_command == ASM_COMMAND_NONE) { + switch (rcv_sound_event) + { + case ASM_EVENT_ALARM: + { + session_t cur_session; + MMSoundMgrSessionGetSession(&cur_session); + if (cur_session == SESSION_NOTIFICATION) { + debug_log ("[ASM_Server] ****** SESSION_NOTIFICATION ongoing ******\n"); + } else if (cur_session == SESSION_VOICECALL || cur_session == SESSION_VOIP) { + debug_log ("[ASM_Server] ****** Alarm starts on Call/Voip session ******\n"); + } else { + debug_log ("[ASM_Server] ****** SESSION_NOTIFICATION start ******\n"); + MMSoundMgrSessionSetSession(SESSION_NOTIFICATION, SESSION_START); + } + } + break; + + case ASM_EVENT_EMERGENCY: + { + session_t cur_session; + MMSoundMgrSessionGetSession(&cur_session); + if (cur_session == SESSION_EMERGENCY) { + debug_log ("[ASM_Server] ****** SESSION_EMERGENCY ongoing ******\n"); + } else { + debug_log ("[ASM_Server] ****** SESSION_EMERGENCY start ******\n"); + MMSoundMgrSessionSetSession(SESSION_EMERGENCY, SESSION_START); + } + } + break; + + case ASM_EVENT_SHARE_FMRADIO: + case ASM_EVENT_EXCLUSIVE_FMRADIO: + { + session_t cur_session; + MMSoundMgrSessionGetSession(&cur_session); + if (cur_session == SESSION_FMRADIO) { + debug_log ("[ASM_Server] ****** SESSION_FMRADIO ongoing ******\n"); + } else { + debug_log ("[ASM_Server] ****** SESSION_FMRADIO start ******\n"); + MMSoundMgrSessionSetSession(SESSION_FMRADIO, SESSION_START); + } + } + break; + default: + break; + } + } + } + __temp_print_list("Set State (Play)"); + } else { + __asm_change_state_list(rcv_instance_id, rcv_sound_handle, rcv_sound_state, rcv_resource); + + if (rcv_sound_state == ASM_STATE_STOP) { + switch (rcv_sound_event) + { + case ASM_EVENT_SHARE_FMRADIO: + case ASM_EVENT_EXCLUSIVE_FMRADIO: + { + session_t cur_session; + MMSoundMgrSessionGetSession(&cur_session); + if (cur_session == SESSION_FMRADIO) { + debug_log ("[ASM_Server] ****** SESSION_FMRADIO end ******"); + MMSoundMgrSessionSetSession(SESSION_FMRADIO, SESSION_END); + } else { + debug_log ("[ASM_Server] Session is not SESSION_FMRADIO"); + } + } + break; + case ASM_EVENT_EXCLUSIVE_MMCAMCORDER: + debug_log ("[ASM_Server] ****** EXCLUSIVE_MMCAMCORDER end ******"); + break; + + default: + break; + } + } + + __temp_print_list("Set State (Not Play)"); + } + break; + + case ASM_REQUEST_GETSTATE: + asm_snd_msg.instance_id = rcv_instance_id; + asm_snd_msg.data.result_sound_state = __asm_find_list(rcv_request_id, rcv_sound_handle); + if (asm_ret_msg == NULL) + __asm_snd_message(&asm_snd_msg); + break; + + case ASM_REQUEST_GETMYSTATE: + __check_dead_process(); + asm_snd_msg.instance_id = rcv_instance_id; + asm_snd_msg.data.result_sound_state = __asm_find_process_status(rcv_instance_id); + if (asm_ret_msg == NULL) + __asm_snd_message(&asm_snd_msg); + break; + + case ASM_REQUEST_DUMP: + __temp_print_list("DUMP"); + break; + + case ASM_REQUEST_SET_SUBSESSION: + { + int rcv_subsession = rcv_sound_event; + int ret = 0; + + /* FIXME: have to check only call instance with playing stsate can request this */ + if (rcv_subsession < SUBSESSION_VOICE || rcv_subsession >= SUBSESSION_NUM) { + /* TODO : Error Handling */ + debug_error ("[ASM_Server] Invalid subsession [%d] to set\n", rcv_subsession); + } + + debug_log ("[ASM_Server] ****** SUB-SESSION [%s] ******\n", subsession_str[rcv_subsession]); + ret = MMSoundMgrSessionSetSubSession(rcv_subsession); + if (ret != MM_ERROR_NONE) { + /* TODO : Error Handling */ + debug_error ("[ASM_Server] MMSoundMgrSessionSetSubSession failed....ret = [%x]\n", ret); + } + + /* Return result msg */ + asm_snd_msg.instance_id = rcv_instance_id; + if (asm_ret_msg == NULL) + __asm_snd_message(&asm_snd_msg); + } + break; + + case ASM_REQUEST_GET_SUBSESSION: + { + subsession_t subsession = 0; + int ret = 0; + + /* FIXME: have to check only call instance with playing stsate can request this */ + debug_log ("[ASM_Server] ****** GET SUB-SESSION ******\n"); + ret = MMSoundMgrSessionGetSubSession(&subsession); + if (ret != MM_ERROR_NONE) { + /* TODO : Error Handling */ + debug_error ("[ASM_Server] MMSoundMgrSessionGetSubSession failed....ret = [%x]\n", ret); + } + + /* Return result msg */ + asm_snd_msg.instance_id = rcv_instance_id; + asm_snd_msg.data.result_sound_command = subsession; + if (asm_ret_msg == NULL) + __asm_snd_message(&asm_snd_msg); + } + break; + + case ASM_REQUEST_EMERGENT_EXIT: + emergent_exit(rcv_instance_id); + break; + + default: + break; + } + + + if (asm_ret_msg) { + *asm_ret_msg = asm_snd_msg; + } + + pthread_mutex_unlock(&g_mutex_asm); + debug_log ("[ASM_Server] --------------------------------------------------------------------- [%s] End (UNLOCKED) ", __func__); +} + +void __asm_main_run (void* param) +{ + ASM_msg_lib_to_asm_t asm_rcv_msg; + + if (sysconf_set_mempolicy(OOM_IGNORE)) { + fprintf(stderr, "set mem policy failed\n"); + } + signal(SIGPIPE, SIG_IGN); + + /* Init Msg Queue */ + __asm_create_message_queue(); + + int temp_msgctl_id1 = msgctl(asm_snd_msgid, IPC_RMID, 0); + int temp_msgctl_id2 = msgctl(asm_rcv_msgid, IPC_RMID, 0); + int temp_msgctl_id3 = msgctl(asm_cb_msgid, IPC_RMID, 0); + + if (temp_msgctl_id1 == -1 || temp_msgctl_id2 == -1 || temp_msgctl_id3 == -1) { + debug_error("[ASM_Server] msgctl failed with error(%d,%s) \n", errno, strerror(errno)); + exit(EXIT_FAILURE); + } + //------------------------------------------------------------------- + /* + This is unnessasry finaly, but nessasary during implement. + */ + /* FIXME: Do we need to do this again ? */ + __asm_create_message_queue(); + + /* Init List */ + head_list = (asm_instance_list_t *)malloc(sizeof(asm_instance_list_t)); + tail_list = (asm_instance_list_t *)malloc(sizeof(asm_instance_list_t)); + head_list->next = tail_list; + tail_list->next = tail_list; + + + /* + * Init Vconf + */ + if (vconf_set_int(SOUND_STATUS_KEY, 0)) { + debug_error("[ASM_Server] vconf_set_int fail\n"); + if (vconf_set_int(SOUND_STATUS_KEY, 0)) { + debug_error("[ASM_Server] vconf_set_int fail\n"); + } + } + +#ifdef SUPPORT_GCF + if (vconf_get_int(VCONFKEY_ADMIN_GCF_TEST, &is_gcf)) { + debug_warning("[ASM_Server] vconf_get_int for VCONFKEY_ADMIN_GCF_TEST failed, set as default\n"); + is_gcf = GCF_DEFAULT; + } +#endif + + /* Set READY flag */ + if (vconf_set_int(ASM_READY_KEY, 1)) { + debug_error("[ASM_Server] vconf_set_int fail\n"); + } + + /* Msg Loop */ + while (true) { + debug_log("[ASM_Server] asm_Server is waiting message(%d)!!!\n", asm_is_send_msg_to_cb); + if (asm_is_send_msg_to_cb) + continue; + + /* Receive Msg */ + __asm_rcv_message(&asm_rcv_msg); + + /* Do msg handling */ + __asm_process_message (&asm_rcv_msg, NULL); + + /* TODO : Error Handling */ + } +} + + +int MMSoundMgrASMInit(void) +{ + int ret = 0; + debug_fenter(); + + ret = MMSoundThreadPoolRun(NULL, __asm_main_run); + if (ret != MM_ERROR_NONE) { + /* TODO : Error Handling */ + debug_error ("MMSoundThreadPoolRun failed....ret = [%x]\n", ret); + } + + debug_fleave(); + return ret; +} + +int MMSoundMgrASMFini(void) +{ + debug_fenter(); + + debug_fleave(); + return MM_ERROR_NONE; +} + diff --git a/server/mm_sound_mgr_codec.c b/server/mm_sound_mgr_codec.c new file mode 100644 index 0000000..849de31 --- /dev/null +++ b/server/mm_sound_mgr_codec.c @@ -0,0 +1,629 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "include/mm_sound_mgr_common.h" +#include "include/mm_sound_mgr_codec.h" +#include "include/mm_sound_plugin_codec.h" +#include "include/mm_sound_thread_pool.h" + +#include "include/mm_sound_mgr_asm.h" + + + +#define _ENABLE_KEYTONE /* Temporal test code */ + +typedef struct { + int (*callback)(int, void *, void *); /* msg_type(pid) client callback & client data info */ + void *param; + int pid; + void *msgcallback; + void *msgdata; + MMHandleType plughandle; + + int pluginid; + int status; + int session_type; + int session_handle; + } __mmsound_mgr_codec_handle_t; + +static MMSoundPluginType *g_codec_plugins = NULL; +static __mmsound_mgr_codec_handle_t g_slots[MANAGER_HANDLE_MAX]; +static mmsound_codec_interface_t g_plugins[MM_SOUND_SUPPORTED_CODEC_NUM]; +static pthread_mutex_t g_slot_mutex; + +static int _MMSoundMgrCodecStopCallback(int param); +static int _MMSoundMgrCodecFindKeytoneSlot(int *slotid); +static int _MMSoundMgrCodecGetEmptySlot(int *slotid); +static int _MMSoundMgrCodecFindLocaleSlot(int *slotid); +static int _MMSoundMgrCodecRegisterInterface(MMSoundPluginType *plugin); + +#define STATUS_IDLE 0 +#define STATUS_KEYTONE 1 +#define STATUS_LOCALE 2 +#define STATUS_SOUND 3 + +#define SOUND_SLOT_START 0 + + + +ASM_cb_result_t +sound_codec_asm_callback(int handle, ASM_event_sources_t event_src, ASM_sound_commands_t command, unsigned int sound_status, void* cb_data) +{ + int slotid = (int)cb_data; + int result = MM_ERROR_NONE; + ASM_cb_result_t cb_res = ASM_CB_RES_NONE; + + debug_log("Got audio session callback msg for session_handle %d\n", handle); + + switch(command) + { + case ASM_COMMAND_STOP: + case ASM_COMMAND_PAUSE: + debug_log("Got msg from asm to Stop or Pause %d\n", command); + result = MMSoundMgrCodecStop(slotid); + cb_res = ASM_CB_RES_STOP; + break; + case ASM_COMMAND_RESUME: + case ASM_COMMAND_PLAY: + debug_log("Got msg from asm to Play or Resume %d\n", command); + cb_res = ASM_CB_RES_NONE;; + default: + break; + } + return cb_res; +} + + +int MMSoundMgrCodecInit(const char *targetdir) +{ + int loop = 0; + int count = 0; + + debug_enter("\n"); + + memset (g_slots, 0, sizeof(g_slots)); + + if(pthread_mutex_init(&g_slot_mutex, NULL)) { + debug_error("pthread_mutex_init failed [%s][%d]\n", __func__, __LINE__); + return MM_ERROR_SOUND_INTERNAL; + } + + for (count = 0; count < MANAGER_HANDLE_MAX; count++) { + g_slots[count].status = STATUS_IDLE; + g_slots[count].plughandle = -1; + } + + if (g_codec_plugins) { + debug_warning("Please Check Init twice\n"); + MMSoundPluginRelease(g_codec_plugins); + } + + MMSoundPluginScan(targetdir, MM_SOUND_PLUGIN_TYPE_CODEC, &g_codec_plugins); + + while (g_codec_plugins[loop].type != MM_SOUND_PLUGIN_TYPE_NONE) { + _MMSoundMgrCodecRegisterInterface(&g_codec_plugins[loop++]); + } + + debug_leave("\n"); + return MM_ERROR_NONE; +} + +int MMSoundMgrCodecFini(void) +{ + debug_enter("\n"); + + memset(g_plugins, 0, sizeof(mmsound_codec_interface_t) * MM_SOUND_SUPPORTED_CODEC_NUM); + MMSoundPluginRelease(g_codec_plugins); + g_codec_plugins = NULL; + pthread_mutex_destroy(&g_slot_mutex); + + debug_leave("\n"); + return MM_ERROR_NONE; +} + + +int MMSoundMgrCodecPlay(int *slotid, const mmsound_mgr_codec_param_t *param) +{ + int count = 0; + mmsound_codec_info_t info; + mmsound_codec_param_t codec_param; + int err = MM_ERROR_NONE; + int errorcode = 0; + int need_asm_unregister = 0; + + debug_enter("\n"); + + debug_msg("DTMF : [%d]\n",param->tone); + debug_msg("Repeat : [%d]\n",param->repeat_count); + debug_msg("Volume : [%f]\n",param->volume); + + for (count = 0; g_plugins[count].GetSupportTypes; count++) { + /* Find codec */ + if (g_plugins[count].Parse(param->source, &info) == MM_ERROR_NONE) + break; + } + + debug_msg("Find plugin codec ::: [%d]\n", count); /*The count num means codec type WAV, MP3 */ + + if (g_plugins[count].GetSupportTypes == NULL) { /* Codec not found */ + debug_error("unsupported file type %d\n", count); + err = MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE; + goto cleanup; + } + + /* KeyTone */ + if (param->keytone == 1) { + /* Find keytone slot */ + err = _MMSoundMgrCodecFindKeytoneSlot(slotid); + /* Not First connect */ + if (err == MM_ERROR_NONE) { + if(g_slots[*slotid].status != STATUS_IDLE) { + MMSoundMgrCodecStop(*slotid); + } + debug_msg("Key tone : Stop to Play !!!\n"); + } + codec_param.keytone = param->keytone; + } else if (param->keytone == 2) { + /* Find keytone slot */ + err = _MMSoundMgrCodecFindLocaleSlot(slotid); + /* Not First connect */ + if (err == MM_ERROR_NONE) { + if(g_slots[*slotid].status != STATUS_IDLE) { + MMSoundMgrCodecStop(*slotid); + } + debug_msg("Key tone : Stop to Play !!!\n"); + } + codec_param.keytone = param->keytone; + } else { + debug_msg("Get New handle\n"); + codec_param.keytone = 0; + } + + err = _MMSoundMgrCodecGetEmptySlot(slotid); + if (err != MM_ERROR_NONE) { + debug_error("Empty g_slot is not found\n"); + goto cleanup; + } + + codec_param.tone = param->tone; + codec_param.volume_config = param->volume_config; + codec_param.repeat_count = param->repeat_count; + codec_param.volume = param->volume; + codec_param.source = param->source; + codec_param.priority = param->priority; + codec_param.stop_cb = _MMSoundMgrCodecStopCallback; + codec_param.param = *slotid; + codec_param.pid = (int)param->param; + codec_param.handle_route = param->handle_route; + + pthread_mutex_lock(&g_slot_mutex); + debug_msg("After Slot_mutex LOCK\n"); + + /* In case of KEYTONE */ + if (param->keytone == 1) + g_slots[*slotid].status = STATUS_KEYTONE; + + /* In case of LOCALE */ + if (param->keytone == 2) /* KeyTone */ + g_slots[*slotid].status = STATUS_LOCALE; + + /* + * Register ASM here + */ + + if(param->session_type != ASM_EVENT_CALL && param->session_type != ASM_EVENT_VIDEOCALL) { + if(!ASM_register_sound_ex((int)param->param, ¶m->session_handle, param->session_type, ASM_STATE_PLAYING, + sound_codec_asm_callback, (void*)*slotid, ASM_RESOURCE_NONE, &errorcode, __asm_process_message)) { + debug_critical("ASM_register_sound() failed %d\n", errorcode); + pthread_mutex_unlock(&g_slot_mutex); + return MM_ERROR_POLICY_INTERNAL; + } + } + // + + /* Codec id WAV or MP3 */ + g_slots[*slotid].pluginid = count; + g_slots[*slotid].callback = param->callback; + g_slots[*slotid].msgcallback = param->msgcallback; + g_slots[*slotid].msgdata = param->msgdata; + g_slots[*slotid].param = param->param; /* This arg is used callback data */ + g_slots[*slotid].session_type = param->session_type; + g_slots[*slotid].session_handle = param->session_handle; + + debug_msg("Using Slotid : [%d] Slot Status : [%d]\n", *slotid, g_slots[*slotid].status); + + + + err = g_plugins[g_slots[*slotid].pluginid].Create(&codec_param, &info, &(g_slots[*slotid].plughandle)); + debug_msg("Created audio handle : [%d]\n", g_slots[*slotid].plughandle); + if (err != MM_ERROR_NONE) { + debug_error("Plugin create fail : 0x%08X\n", err); + g_slots[*slotid].status = STATUS_IDLE; + pthread_mutex_unlock(&g_slot_mutex); + debug_warning("After Slot_mutex UNLOCK\n"); + need_asm_unregister = 1; + goto cleanup; + } + + err = g_plugins[g_slots[*slotid].pluginid].Play(g_slots[*slotid].plughandle); + if (err != MM_ERROR_NONE) { + debug_error("Fail to play : 0x%08X\n", err); + g_plugins[g_slots[*slotid].pluginid].Destroy(g_slots[*slotid].plughandle); + need_asm_unregister = 1; + } + + pthread_mutex_unlock(&g_slot_mutex); + debug_msg("After Slot_mutex UNLOCK\n"); + +cleanup: + if(param->session_type != ASM_EVENT_CALL && param->session_type != ASM_EVENT_VIDEOCALL && need_asm_unregister == 1) { + if(!ASM_unregister_sound_ex(param->session_handle, param->session_type, &errorcode,__asm_process_message)) { + debug_error("Unregister sound failed 0x%X\n", errorcode); + return MM_ERROR_POLICY_INTERNAL; + } + } + + debug_leave("\n"); + + return err; +} + +#define DTMF_PLUGIN_COUNT 2 +int MMSoundMgrCodecPlayDtmf(int *slotid, const mmsound_mgr_codec_param_t *param) +{ + int count = 0; + int *codec_type; + mmsound_codec_info_t info; + mmsound_codec_param_t codec_param; + int err = MM_ERROR_NONE; + + debug_enter("\n"); + + debug_msg("DTMF : [%d]\n",param->tone); + debug_msg("Repeat : [%d]\n",param->repeat_count); + debug_msg("Volume : [%f]\n",param->volume); + + for (count = 0; g_plugins[count].GetSupportTypes; count++) { + /* Find codec */ + codec_type = g_plugins[count].GetSupportTypes(); + if(codec_type && (MM_SOUND_SUPPORTED_CODEC_DTMF == codec_type[0])) + break; + } + + debug_msg("Find plugin codec ::: [%d]\n", count); /*The count num means codec type DTMF */ + + if (g_plugins[count].GetSupportTypes == NULL) { /* Codec not found */ + debug_error("unsupported file type %d\n", count); + printf("unsupported file type %d\n", count); + err = MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE; + goto cleanup; + } + + debug_msg("Get New handle\n"); + codec_param.keytone = 0; + + err = _MMSoundMgrCodecGetEmptySlot(slotid); + if(err != MM_ERROR_NONE) + { + debug_error("Empty g_slot is not found\n"); + goto cleanup; + } + + codec_param.tone = param->tone; + codec_param.priority = 0; + codec_param.volume_config = param->volume_config; + codec_param.repeat_count = param->repeat_count; + codec_param.volume = param->volume; + codec_param.stop_cb = _MMSoundMgrCodecStopCallback; + codec_param.param = *slotid; + codec_param.pid = (int)param->param; + + pthread_mutex_lock(&g_slot_mutex); + debug_msg("After Slot_mutex LOCK\n"); + + // + /* + * Register ASM here + */ + int errorcode = 0; + int need_asm_unregister = 0; + + if(param->session_type != ASM_EVENT_CALL && param->session_type != ASM_EVENT_VIDEOCALL) { + if(!ASM_register_sound_ex((int)param->param, ¶m->session_handle, param->session_type, ASM_STATE_PLAYING, + sound_codec_asm_callback, (void*)*slotid, ASM_RESOURCE_NONE, &errorcode, __asm_process_message)) { + debug_critical("ASM_register_sound() failed %d\n", errorcode); + pthread_mutex_unlock(&g_slot_mutex); + return MM_ERROR_POLICY_INTERNAL; + } + } + + g_slots[*slotid].pluginid = count; + g_slots[*slotid].callback = param->callback; + g_slots[*slotid].param = param->param; /* This arg is used callback data */ + g_slots[*slotid].session_type = param->session_type; + g_slots[*slotid].session_handle = param->session_handle; + + debug_msg("Using Slotid : [%d] Slot Status : [%d]\n", *slotid, g_slots[*slotid].status); + + err = g_plugins[g_slots[*slotid].pluginid].Create(&codec_param, &info, &(g_slots[*slotid].plughandle)); + debug_msg("Created audio handle : [%d]\n", g_slots[*slotid].plughandle); + if (err != MM_ERROR_NONE) { + debug_error("Plugin create fail : 0x%08X\n", err); + g_slots[*slotid].status = STATUS_IDLE; + pthread_mutex_unlock(&g_slot_mutex); + debug_warning("After Slot_mutex UNLOCK\n"); + need_asm_unregister = 1; + goto cleanup; + } + + err = g_plugins[g_slots[*slotid].pluginid].Play(g_slots[*slotid].plughandle); + if (err != MM_ERROR_NONE) { + debug_error("Fail to play : 0x%08X\n", err); + g_plugins[g_slots[*slotid].pluginid].Destroy(g_slots[*slotid].plughandle); + need_asm_unregister = 1; + } + + pthread_mutex_unlock(&g_slot_mutex); + + debug_msg("Using Slotid : [%d] Slot Status : [%d]\n", *slotid, g_slots[*slotid].status); + debug_msg("After Slot_mutex UNLOCK\n") + +cleanup: + debug_leave("\n"); + + return err; +} + + +int MMSoundMgrCodecStop(const int slotid) +{ + int err = MM_ERROR_NONE; + + debug_enter("(Slotid : [%d])\n", slotid); + + if (slotid < 0 || MANAGER_HANDLE_MAX <= slotid) { + return MM_ERROR_INVALID_ARGUMENT; + } + + pthread_mutex_lock (&g_slot_mutex); + debug_msg("After Slot_mutex LOCK\n"); + if (g_slots[slotid].status == STATUS_IDLE) { + err = MM_ERROR_SOUND_INVALID_STATE; + debug_warning("The playing slots is not found, Slot ID : [%d]\n", slotid); + goto cleanup; + } + debug_msg("Found slot, Slotid [%d] State [%d]\n", slotid, g_slots[slotid].status); + + err = g_plugins[g_slots[slotid].pluginid].Stop(g_slots[slotid].plughandle); + if (err != MM_ERROR_NONE) { + debug_error("Fail to STOP Code : 0x%08X\n", err); + } + debug_msg("Found slot, Slotid [%d] State [%d]\n", slotid, g_slots[slotid].status); +cleanup: + pthread_mutex_unlock(&g_slot_mutex); + debug_msg("After Slot_mutex UNLOCK\n"); + debug_leave("(err : 0x%08X)\n", err); + + return err; +} + +static int _MMSoundMgrCodecStopCallback(int param) +{ + int err = MM_ERROR_NONE; + + debug_enter("(Slot : %d)\n", param); + + pthread_mutex_lock(&g_slot_mutex); + debug_msg("[CODEC MGR] Slot_mutex lock done\n"); + + + /* + * Unregister ASM here + */ + + int errorcode = 0; + + if(g_slots[param].session_type != ASM_EVENT_CALL && g_slots[param].session_type != ASM_EVENT_VIDEOCALL) { + debug_msg("[CODEC MGR] ASM unregister\n"); + if(!ASM_unregister_sound_ex(g_slots[param].session_handle, g_slots[param].session_type, &errorcode, __asm_process_message)) { + debug_error("[CODEC MGR] Unregister sound failed 0x%X\n", errorcode); + } + } + + + + if (g_slots[param].msgcallback) { + debug_msg("[CODEC MGR] msgcallback : %p\n", g_slots[param].msgcallback); + debug_msg("[CODEC MGR] msg data : %p\n", g_slots[param].msgdata); + debug_msg("[CODEC MGR] mgr codec callback : %p\n", g_slots[param].callback); + g_slots[param].callback((int)g_slots[param].param, g_slots[param].msgcallback, g_slots[param].msgdata); /*param means client msg_type */ + } + debug_msg("Client callback msg_type (instance) : [%d]\n", (int)g_slots[param].param); + debug_msg("Handle allocated handle : [0x%08X]\n", g_slots[param].plughandle); + err = g_plugins[g_slots[param].pluginid].Destroy(g_slots[param].plughandle); + if (err < 0 ) { + debug_critical("[CODEC MGR] Fail to destroy slot number : [%d] err [0x%x]\n", param, err); + } + memset(&g_slots[param], 0, sizeof(__mmsound_mgr_codec_handle_t)); + g_slots[param].status = STATUS_IDLE; + pthread_mutex_unlock(&g_slot_mutex); + debug_msg("[CODEC MGR] Slot_mutex done\n"); + + return err; +} + +static int _MMSoundMgrCodecFindKeytoneSlot(int *slotid) +{ + int count = 0; + int err = MM_ERROR_NONE; + + debug_enter("\n"); + + pthread_mutex_lock(&g_slot_mutex); + debug_warning("After Slot_mutex LOCK\n"); + + for (count = SOUND_SLOT_START; count < MANAGER_HANDLE_MAX ; count++) { + if (g_slots[count].status == STATUS_KEYTONE) { + break; + } + } + pthread_mutex_unlock(&g_slot_mutex); + debug_warning("After Slot_mutex UNLOCK\n"); + if (count < MANAGER_HANDLE_MAX) { + debug_msg("Found keytone handle allocated (Slot : [%d])\n", count); + *slotid = count; + err = MM_ERROR_NONE; + } else { + debug_warning("Handle is full handle [KEY TONE] : [%d]\n", count); + err = MM_ERROR_SOUND_INTERNAL; + } + + debug_leave("\n"); + + return err; +} + +static int _MMSoundMgrCodecFindLocaleSlot(int *slotid) +{ + int count = 0; + int err = MM_ERROR_NONE; + + debug_enter("\n"); + + pthread_mutex_lock(&g_slot_mutex); + debug_warning("After Slot_mutex LOCK\n"); + + for (count = SOUND_SLOT_START; count < MANAGER_HANDLE_MAX ; count++) { + if (g_slots[count].status == STATUS_LOCALE) { + break; + } + } + pthread_mutex_unlock(&g_slot_mutex); + + debug_warning("After Slot_mutex UNLOCK\n"); + if (count < MANAGER_HANDLE_MAX) { + debug_msg("Found locale handle allocated (Slot : [%d])\n", count); + *slotid = count; + err = MM_ERROR_NONE; + } else { + debug_warning("Handle is full handle [KEY TONE] \n"); + err = MM_ERROR_SOUND_INTERNAL; + } + + debug_leave("\n"); + + return err; +} + +static int _MMSoundMgrCodecGetEmptySlot(int *slot) +{ + int count = 0; + int err = MM_ERROR_NONE; + + debug_enter("\n"); + debug_msg("Codec slot ID : [%d]\n", *slot); + pthread_mutex_lock(&g_slot_mutex); + debug_msg("After Slot_mutex LOCK\n"); + + for (count = SOUND_SLOT_START; count < MANAGER_HANDLE_MAX ; count++) { + if (g_slots[count].status == STATUS_IDLE) { + g_slots[count].status = STATUS_SOUND; + break; + } + } + pthread_mutex_unlock(&g_slot_mutex); + debug_msg("After Slot_mutex UNLOCK\n"); + + if (count < MANAGER_HANDLE_MAX) { + debug_msg("New handle allocated (codec slot ID : [%d])\n", count); + *slot = count; + err = MM_ERROR_NONE; + } else { + debug_warning("Handle is full handle : [%d]\n", count); + *slot = -1; + /* Temporal code for reset */ + while(count--) { + g_slots[count].status = STATUS_IDLE; + } + err = MM_ERROR_SOUND_INTERNAL; + } + + debug_leave("\n"); + + return err; +} + +static int _MMSoundMgrCodecRegisterInterface(MMSoundPluginType *plugin) +{ + int err = MM_ERROR_NONE; + int count = 0; + void *getinterface = NULL; + + debug_enter("\n"); + + /* find emptry slot */ + for (count = 0; count < MM_SOUND_SUPPORTED_CODEC_NUM; count++) { + if (g_plugins[count].GetSupportTypes == NULL) + break; + } + + if (count == MM_SOUND_SUPPORTED_CODEC_NUM) { + debug_critical("The plugin support type is not valid\n"); + return MM_ERROR_COMMON_OUT_OF_RANGE; + } + + debug_msg("Empty slot find : %d\n", count); + + err = MMSoundPluginGetSymbol(plugin, CODEC_GET_INTERFACE_FUNC_NAME, &getinterface); + if (err != MM_ERROR_NONE) { + debug_error("Get Symbol CODEC_GET_INTERFACE_FUNC_NAME is fail : %x\n", err); + goto cleanup; + } + debug_msg("Getinterface name : %s\n", (char*)getinterface ); + + err = MMSoundPlugCodecCastGetInterface(getinterface)(&g_plugins[count]); + if (err != MM_ERROR_NONE) { + debug_error("Get interface fail : %x\n", err); + +cleanup: + /* If error occur, clean interface */ + memset(&g_plugins[count], 0, sizeof(mmsound_codec_interface_t)); + } else { + if (g_plugins[count].SetThreadPool) + g_plugins[count].SetThreadPool(MMSoundThreadPoolRun); + } + + debug_leave("\n"); + + return err; +} + diff --git a/server/mm_sound_mgr_device.c b/server/mm_sound_mgr_device.c new file mode 100644 index 0000000..98523bb --- /dev/null +++ b/server/mm_sound_mgr_device.c @@ -0,0 +1,414 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "include/mm_sound_mgr_common.h" +#include "include/mm_sound_mgr_ipc.h" +#include "include/mm_sound_mgr_device.h" +#include "include/mm_sound_thread_pool.h" +#include "../include/mm_sound_msg.h" +#include "../include/mm_sound_common.h" +#include "../include/mm_sound_utils.h" + +#include "include/mm_sound_mgr_session.h" + +void _mm_sound_get_devices_from_route(mm_sound_route route, mm_sound_device_in *device_in, mm_sound_device_out *device_out); + +static GList *g_active_device_cb_list = NULL; +static pthread_mutex_t g_active_device_cb_mutex = PTHREAD_MUTEX_INITIALIZER; +static GList *g_available_route_cb_list = NULL; +static pthread_mutex_t g_available_route_cb_mutex = PTHREAD_MUTEX_INITIALIZER; + +int _mm_sound_mgr_device_init(void) +{ + debug_fenter(); + + debug_fleave(); + return MM_ERROR_NONE; +} + +int _mm_sound_mgr_device_fini(void) +{ + debug_fenter(); + + debug_fleave(); + return MM_ERROR_NONE; +} + +int _mm_sound_mgr_device_is_route_available(const _mm_sound_mgr_device_param_t *param, bool *is_available) +{ + mm_sound_route route = param->route; + mm_sound_device_in device_in = MM_SOUND_DEVICE_IN_NONE; + mm_sound_device_out device_out = MM_SOUND_DEVICE_OUT_NONE; + int ret = MM_ERROR_NONE; + + debug_fenter(); + + _mm_sound_get_devices_from_route(route, &device_in, &device_out); + + /* check given input & output device is available */ + ret = MMSoundMgrSessionIsDeviceAvailable(device_out, device_in, is_available); + + debug_fleave(); + return ret; +} + +int _mm_sound_mgr_device_foreach_available_route_cb(mm_ipc_msg_t *msg) +{ + mm_sound_route *route_list = NULL; + int route_list_count = 0; + int route_index = 0; + int available_count = 0; + bool is_available = 0; + int ret = MM_ERROR_NONE; + + debug_fenter(); + + route_list_count = _mm_sound_get_valid_route_list(&route_list); + for (route_index = 0; route_index < route_list_count; route_index++) { + mm_sound_device_in device_in = MM_SOUND_DEVICE_IN_NONE; + mm_sound_device_out device_out = MM_SOUND_DEVICE_OUT_NONE; + + _mm_sound_get_devices_from_route(route_list[route_index], &device_in, &device_out); + /* check input & output device of given route is available */ + ret = MMSoundMgrSessionIsDeviceAvailable(device_out, device_in, &is_available); + if (ret != MM_ERROR_NONE) { + debug_error("MMSoundMgrSessionIsDeviceAvailable() failed (%d)\n", ret); + goto FINISH; + } + + /* add route to avaiable route list */ + if (is_available) { + if (available_count >= (sizeof(msg->sound_msg.route_list) / sizeof(int))) { + debug_error("Cannot add available route, list is full\n"); + ret = MM_ERROR_SOUND_INTERNAL; + goto FINISH; + } + msg->sound_msg.route_list[available_count++] = route_list[route_index]; + } + } +FINISH: + debug_fleave(); + return ret; +} + +int _mm_sound_mgr_device_set_active_route(const _mm_sound_mgr_device_param_t *param) +{ + mm_sound_route route = param->route; + mm_sound_device_in device_in = MM_SOUND_DEVICE_IN_NONE; + mm_sound_device_out device_out = MM_SOUND_DEVICE_OUT_NONE; + bool is_available = 0; + int ret = MM_ERROR_NONE; + + debug_fenter(); + + _mm_sound_get_devices_from_route(route, &device_in, &device_out); + /* check specific route is available */ + ret = _mm_sound_mgr_device_is_route_available(param, &is_available); + if ((ret != MM_ERROR_NONE) || (!is_available)) { + + } + + ret = MMSoundMgrSessionSetDeviceActive(device_out, device_in); + + debug_fleave(); + return ret; +} + +int _mm_sound_mgr_device_get_active_device(const _mm_sound_mgr_device_param_t *param, mm_sound_device_in *device_in, mm_sound_device_out *device_out) +{ + int ret = MM_ERROR_NONE; + + debug_fenter(); + + ret = MMSoundMgrSessionGetDeviceActive(device_out, device_in); + + debug_fleave(); + return ret; +} + +int _mm_sound_mgr_device_add_active_device_callback(const _mm_sound_mgr_device_param_t *param) +{ + int ret = MM_ERROR_NONE; + GList *list = NULL; + _mm_sound_mgr_device_param_t *cb_param = NULL; + bool is_already_set = FALSE; + + debug_fenter(); + + MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(&g_active_device_cb_mutex, MM_ERROR_SOUND_INTERNAL); + + for (list = g_active_device_cb_list; list != NULL; list = list->next) + { + cb_param = (_mm_sound_mgr_device_param_t *)list->data; + if ((cb_param) && (cb_param->pid == param->pid)) + { + cb_param->callback = param->callback; + cb_param->cbdata = param->cbdata; + is_already_set = TRUE; + break; + } + } + if (!is_already_set) { + cb_param = g_malloc(sizeof(_mm_sound_mgr_device_param_t)); + memcpy(cb_param, param, sizeof(_mm_sound_mgr_device_param_t)); + g_active_device_cb_list = g_list_append(g_active_device_cb_list, cb_param); + if (g_active_device_cb_list) { + debug_log("active device cb registered for pid [%d]", cb_param->pid); + } else { + debug_error("g_list_append failed\n"); + ret = MM_ERROR_SOUND_INTERNAL; + goto FINISH; + } + } + +FINISH: + MMSOUND_LEAVE_CRITICAL_SECTION(&g_active_device_cb_mutex); + debug_fleave(); + return ret; +} + +int _mm_sound_mgr_device_remove_active_device_callback(const _mm_sound_mgr_device_param_t *param) +{ + int ret = MM_ERROR_NONE; + GList *list = NULL; + _mm_sound_mgr_device_param_t *cb_param = NULL; + + debug_fenter(); + + MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(&g_active_device_cb_mutex, MM_ERROR_SOUND_INTERNAL); + + for (list = g_active_device_cb_list; list != NULL; list = list->next) + { + cb_param = (_mm_sound_mgr_device_param_t *)list->data; + if ((cb_param) && (cb_param->pid == param->pid)) + { + g_active_device_cb_list = g_list_remove(g_active_device_cb_list, cb_param); + g_free(cb_param); + break; + } + } + + MMSOUND_LEAVE_CRITICAL_SECTION(&g_active_device_cb_mutex); + + debug_fleave(); + return ret; +} + +int _mm_sound_mgr_device_active_device_callback(mm_sound_device_in device_in, mm_sound_device_out device_out) +{ + int ret = MM_ERROR_NONE; + GList *list = NULL; + _mm_sound_mgr_device_param_t *cb_param = NULL; + mm_ipc_msg_t msg; + + debug_fenter(); + + MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(&g_active_device_cb_mutex, MM_ERROR_SOUND_INTERNAL); + + for (list = g_active_device_cb_list; list != NULL; list = list->next) + { + cb_param = (_mm_sound_mgr_device_param_t *)list->data; + if ((cb_param) && (cb_param->callback)) + { + memset(&msg, 0, sizeof(mm_ipc_msg_t)); + SOUND_MSG_SET(msg.sound_msg, MM_SOUND_MSG_INF_ACTIVE_DEVICE_CB, 0, MM_ERROR_NONE, cb_param->pid); + msg.sound_msg.device_in = device_in; + msg.sound_msg.device_out = device_out; + msg.sound_msg.callback = cb_param->callback; + msg.sound_msg.cbdata = cb_param->cbdata; + + ret = _MMIpcCBSndMsg(&msg); + if (ret != MM_ERROR_NONE) { + debug_error("Fail to send callback message (%x)\n", ret); + goto FINISH; + } + } + } +FINISH: + MMSOUND_LEAVE_CRITICAL_SECTION(&g_active_device_cb_mutex); + + debug_fleave(); + return ret; +} + +int _mm_sound_mgr_device_add_available_route_callback(const _mm_sound_mgr_device_param_t *param) +{ + int ret = MM_ERROR_NONE; + GList *list = NULL; + _mm_sound_mgr_device_param_t *cb_param = NULL; + bool is_already_set = FALSE; + + debug_fenter(); + + MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(&g_available_route_cb_mutex, MM_ERROR_SOUND_INTERNAL); + + for (list = g_available_route_cb_list; list != NULL; list = list->next) + { + cb_param = (_mm_sound_mgr_device_param_t *)list->data; + if ((cb_param) && (cb_param->pid == param->pid)) + { + cb_param->callback = param->callback; + cb_param->cbdata = param->cbdata; + is_already_set = TRUE; + break; + } + } + if (!is_already_set) { + cb_param = g_malloc(sizeof(_mm_sound_mgr_device_param_t)); + memcpy(cb_param, param, sizeof(_mm_sound_mgr_device_param_t)); + g_available_route_cb_list = g_list_append(g_available_route_cb_list, cb_param); + if (g_available_route_cb_list) { + debug_log("available route cb registered for pid [%d]", cb_param->pid); + } else { + debug_error("g_list_append failed\n"); + ret = MM_ERROR_SOUND_INTERNAL; + goto FINISH; + } + } +FINISH: + MMSOUND_LEAVE_CRITICAL_SECTION(&g_available_route_cb_mutex); + + debug_fleave(); + return ret; +} + +int _mm_sound_mgr_device_remove_available_route_callback(const _mm_sound_mgr_device_param_t *param) +{ + int ret = MM_ERROR_NONE; + GList *list = NULL; + _mm_sound_mgr_device_param_t *cb_param = NULL; + + debug_fenter(); + + MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(&g_available_route_cb_mutex, MM_ERROR_SOUND_INTERNAL); + + for (list = g_available_route_cb_list; list != NULL; list = list->next) + { + cb_param = (_mm_sound_mgr_device_param_t *)list->data; + if ((cb_param) && (cb_param->pid == param->pid)) + { + g_available_route_cb_list = g_list_remove(g_available_route_cb_list, cb_param); + g_free(cb_param); + break; + } + } + + MMSOUND_LEAVE_CRITICAL_SECTION(&g_available_route_cb_mutex); + + debug_fleave(); + return ret; +} + +int _mm_sound_mgr_device_available_device_callback(mm_sound_device_in device_in, mm_sound_device_out device_out, bool available) +{ + int ret = MM_ERROR_NONE; + _mm_sound_mgr_device_param_t *cb_param = NULL; + mm_ipc_msg_t msg; + int route_list_count = 0; + int route_index = 0; + int available_count = 0; + mm_sound_route *route_list = NULL; + GList *list = NULL; + + debug_fenter(); + + memset (&msg, 0, sizeof(mm_ipc_msg_t)); + + route_list_count = _mm_sound_get_valid_route_list(&route_list); + debug_log("in=[%x], out=[%x], route_list_count = [%d], available = [%d]", device_in, device_out, route_list_count, available); + for (route_index = 0; route_index < route_list_count; route_index++) { + mm_sound_device_in route_device_in = MM_SOUND_DEVICE_IN_NONE; + mm_sound_device_out route_device_out = MM_SOUND_DEVICE_OUT_NONE; + bool is_changed = 0; + + _mm_sound_get_devices_from_route(route_list[route_index], &route_device_in, &route_device_out); + + if ((device_in != MM_SOUND_DEVICE_IN_NONE) && (device_in == route_device_in)) { + /* device(in&out) changed together & they can be combined as this route */ + if ((device_out != MM_SOUND_DEVICE_OUT_NONE) && (device_out == route_device_out)) { + is_changed = 1; + /* device(in) changed & this route has device(in) only */ + } else if (route_device_out == MM_SOUND_DEVICE_OUT_NONE) { + is_changed = 1; + /* device(in) changed & this route have device(in&out), we need to check availability of output device of this route */ + } else { + MMSoundMgrSessionIsDeviceAvailableNoLock(route_device_out, MM_SOUND_DEVICE_IN_NONE, &is_changed); + } + } + if ((is_changed == 0) && (device_out != MM_SOUND_DEVICE_OUT_NONE) && (device_out == route_device_out)) { + /* device(out) changed & this route has device(out) only */ + if (route_device_in == MM_SOUND_DEVICE_IN_NONE) { + is_changed = 1; + /* device(out) changed & this route have device(in&out), we need to check availability of input device of this route */ + } else { + MMSoundMgrSessionIsDeviceAvailableNoLock(MM_SOUND_DEVICE_OUT_NONE, route_device_in, &is_changed); + } + } + /* add route to avaiable route list */ + if (is_changed) { + if (available_count >= (sizeof(msg.sound_msg.route_list) / sizeof(int))) { + debug_error("Cannot add available route, list is full\n"); + return MM_ERROR_SOUND_INTERNAL; + } + debug_log("route_index [%d] is added to route_list [%d]", route_index, available_count); + msg.sound_msg.route_list[available_count++] = route_list[route_index]; + } + } + + MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(&g_available_route_cb_mutex, MM_ERROR_SOUND_INTERNAL); + + for (list = g_available_route_cb_list; list != NULL; list = list->next) + { + cb_param = (_mm_sound_mgr_device_param_t *)list->data; + if ((cb_param) && (cb_param->callback)) + { + SOUND_MSG_SET(msg.sound_msg, MM_SOUND_MSG_INF_AVAILABLE_ROUTE_CB, 0, MM_ERROR_NONE, cb_param->pid); + msg.sound_msg.is_available = available; + msg.sound_msg.callback = cb_param->callback; + msg.sound_msg.cbdata = cb_param->cbdata; + + ret = _MMIpcCBSndMsg(&msg); + if (ret != MM_ERROR_NONE) { + debug_error("Fail to send callback message\n"); + goto FINISH; + } + } + } +FINISH: + MMSOUND_LEAVE_CRITICAL_SECTION(&g_available_route_cb_mutex); + + debug_fleave(); + return ret; +} + diff --git a/server/mm_sound_mgr_dock.c b/server/mm_sound_mgr_dock.c new file mode 100644 index 0000000..7cfdcc3 --- /dev/null +++ b/server/mm_sound_mgr_dock.c @@ -0,0 +1,246 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "include/mm_sound_mgr_common.h" +#include "../include/mm_sound_common.h" + +#include +#include + +#include "include/mm_sound_mgr_dock.h" +#include "include/mm_sound_mgr_session.h" + +/******************************* Dock Code **********************************/ + +#include +#include +#include +#include + +#include "mm_ipc.h" +#include "mm_sound_common.h" +#include "mm_sound.h" + +#include +#include + +#define SOUND_DOCK_ON "/usr/share/sounds/sound-server/dock.wav" +#define SOUND_DOCK_OFF "/usr/share/sounds/sound-server/undock.wav" +#define SOUND_DOCK_ON_DELAY 1000000 +#define SOUND_DOCK_OFF_DELAY 10000 + +#define DOCK_OFF false +#define DOCK_ON true + +#define DOCK_NO_RESTORE false +#define DOCK_RESTORE true + +int g_saved_dock_status; + +static void __dock_sound_finished_cb (void *data) +{ + debug_log ("dock sound play finished!!!\n"); + *(bool*)data = true; +} +static void __play_dock_sound_sync(bool is_on, bool need_restore) +{ + int handle; + bool is_play_finished = false; + + if (g_saved_dock_status == -1) { + debug_log ("skip dock sound because status is not valid [%d]\n", g_saved_dock_status); + return; + } + + debug_log ("start to play dock sound : is_on=[%d], need_restore=[%d]\n", is_on, need_restore); + + if (need_restore) { + mm_sound_play_loud_solo_sound((is_on? SOUND_DOCK_ON:SOUND_DOCK_OFF), VOLUME_TYPE_FIXED, __dock_sound_finished_cb, &is_play_finished, &handle); + debug_log ("waiting for dock sound finish\n"); + while (!is_play_finished) { + usleep (SOUND_DOCK_OFF_DELAY); + } + } else { + mm_sound_play_loud_solo_sound_no_restore((is_on? SOUND_DOCK_ON:SOUND_DOCK_OFF), VOLUME_TYPE_FIXED, __dock_sound_finished_cb, &is_play_finished, &handle); + debug_log ("waiting for dock sound finish\n"); + usleep (SOUND_DOCK_ON_DELAY); + } + + debug_log ("dock sound finished!!!\n"); +} + +/* DOCK status value from system server */ +static void _dock_status_changed_cb(keynode_t* node, void* data) +{ + int ret = 0; + int dock_enable = 0; + int dock_available = 0; + + if (node == NULL) { + debug_error ("node is null...\n"); + return; + } + + debug_msg ("Handling [%s] Starts\n", vconf_keynode_get_name(node)); + + /* Get actual vconf value */ + vconf_get_int(VCONFKEY_SYSMAN_CRADLE_STATUS, &dock_available); + debug_msg ("DOCK : [%s]=[%d]\n", VCONFKEY_SYSMAN_CRADLE_STATUS, dock_available); + + /* Set available/non-available based on vconf status value */ + if (dock_available) { + /* Check user preference first */ + vconf_get_bool(VCONFKEY_DOCK_EXT_SPEAKER, &dock_enable); + debug_msg ("DOCK : [%s]=[%d]\n", VCONFKEY_DOCK_EXT_SPEAKER, dock_enable); + + /* If user preference is enabled, available it */ + if (dock_enable) { + /* Play sound for dock status */ + __play_dock_sound_sync (DOCK_ON, DOCK_NO_RESTORE); + + /* Update device available status (available) */ + ret = MMSoundMgrSessionSetDeviceAvailable (DEVICE_DOCK, dock_available, 0, NULL); + if (ret != MM_ERROR_NONE) { + debug_error ("MMSoundMgrSessionSetDeviceAvailable() failed...ret=%x\n", ret); + goto EXIT; + } + } else { + /* Play sound for dock status */ + __play_dock_sound_sync (DOCK_ON, DOCK_RESTORE); + + debug_msg ("Dock is not enabled by user, no need to set available device\n"); + } + } else { + /* Play sound for dock status */ + __play_dock_sound_sync (DOCK_OFF, DOCK_RESTORE); + + /* Update device available status (non-available) */ + ret = MMSoundMgrSessionSetDeviceAvailable (DEVICE_DOCK, dock_available, 0, NULL); + if (ret != MM_ERROR_NONE) { + debug_error ("MMSoundMgrSessionSetDeviceAvailable() failed...ret=%x\n", ret); + goto EXIT; + } + } + +EXIT: + g_saved_dock_status = dock_available; + + debug_msg ("Handling [%s] Ends normally\n", vconf_keynode_get_name(node)); +} + +static int _register_dock_status () +{ + /* set callback for vconf key change */ + int ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_CRADLE_STATUS, _dock_status_changed_cb, NULL); + debug_msg ("vconf [%s] set ret = [%d]\n", VCONFKEY_SYSMAN_CRADLE_STATUS, ret); + return ret; +} + +/* DOCK enable setting */ +static void _dock_setting_enable_changed_cb(keynode_t* node, void* data) +{ + int ret = 0; + int dock_enable = 0; + int dock_available = 0; + + if (node == NULL) { + debug_error ("node is null...return\n"); + return; + } + + debug_msg ("Handling [%s] Starts\n", vconf_keynode_get_name(node)); + + /* Get actual vconf value */ + vconf_get_bool(VCONFKEY_DOCK_EXT_SPEAKER, &dock_enable); + debug_msg ("DOCK : [%s]=[%d]\n", VCONFKEY_DOCK_EXT_SPEAKER, dock_enable); + + vconf_get_int(VCONFKEY_SYSMAN_CRADLE_STATUS, &dock_available); + debug_msg ("DOCK : [%s]=[%d]\n", VCONFKEY_SYSMAN_CRADLE_STATUS, dock_available); + + /* Take care if dock is available now */ + if (dock_available) { + ret = MMSoundMgrSessionSetDeviceAvailable (DEVICE_DOCK, dock_enable, 0, NULL); + if (ret != MM_ERROR_NONE) { + debug_error ("MMSoundMgrSessionSetDeviceAvailable() failed...ret=%x\n", ret); + return; + } + } else { + /* Do nothing */ + debug_msg ("Dock is enabled/disabled while not available, Nothing to do Now\n"); + } + + debug_msg ("Handling [%s] Ends normally\n", vconf_keynode_get_name(node)); +} + +static int _register_dock_enable_setting () +{ + /* set callback for vconf key change */ + int ret = vconf_notify_key_changed(VCONFKEY_DOCK_EXT_SPEAKER, _dock_setting_enable_changed_cb, NULL); + debug_msg ("vconf [%s] set ret = [%d]\n", VCONFKEY_DOCK_EXT_SPEAKER, ret); + return ret; +} + + + +int MMSoundMgrDockInit(void) +{ + int ret = 0; + debug_enter("\n"); + + g_saved_dock_status = -1; + + ret = vconf_get_int(VCONFKEY_SYSMAN_CRADLE_STATUS, &g_saved_dock_status); + debug_msg ("Initial status is [%d], ret=[%d]\n", g_saved_dock_status, ret); + + if (_register_dock_status () != 0) { + debug_error ("Registering dock status failed\n"); + return MM_ERROR_SOUND_INTERNAL; + } + if (_register_dock_enable_setting() != 0) { + debug_error ("Registering dock enable setting failed\n"); + return MM_ERROR_SOUND_INTERNAL; + } + + debug_leave("\n"); + return MM_ERROR_NONE; +} + +int MMSoundMgrDockFini(void) +{ + debug_enter("\n"); + + debug_leave("\n"); + return MM_ERROR_NONE; +} + diff --git a/server/mm_sound_mgr_hdmi.c b/server/mm_sound_mgr_hdmi.c new file mode 100644 index 0000000..c804d47 --- /dev/null +++ b/server/mm_sound_mgr_hdmi.c @@ -0,0 +1,95 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "include/mm_sound_mgr_common.h" +#include "../include/mm_sound_common.h" + +#include +#include + +#include "include/mm_sound_mgr_hdmi.h" +#include "include/mm_sound_mgr_session.h" + +/******************************* HDMI Code **********************************/ + +#include "mm_sound.h" + +#include +#include + + +/* HDMI status value from system server */ +static void _hdmi_status_changed_cb(keynode_t* node, void* data) +{ + int hdmi_available = 0; + + /* Get actual vconf value */ + vconf_get_int(VCONFKEY_SYSMAN_HDMI, &hdmi_available); + + debug_msg ("[%s] changed callback called\n", vconf_keynode_get_name(node)); + debug_msg ("HDMI : [%s]=[%d]\n", + VCONFKEY_SYSMAN_HDMI, hdmi_available); + + MMSoundMgrSessionSetDeviceAvailable (DEVICE_HDMI, hdmi_available, 0, NULL); +} + +static int _register_hdmi_status(void) +{ + /* set callback for vconf key change */ + int ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_HDMI, _hdmi_status_changed_cb, NULL); + debug_msg ("vconf [%s] set ret = [%d]\n", VCONFKEY_SYSMAN_HDMI, ret); + return ret; +} + +int MMSoundMgrHdmiInit(void) +{ + debug_enter("\n"); + + if (_register_hdmi_status() != 0) { + debug_error ("Registering hdmi status failed\n"); + return MM_ERROR_SOUND_INTERNAL; + } + + debug_leave("\n"); + return MM_ERROR_NONE; +} + +int MMSoundMgrHdmiFini(void) +{ + debug_enter("\n"); + + debug_leave("\n"); + return MM_ERROR_NONE; +} + diff --git a/server/mm_sound_mgr_headset.c b/server/mm_sound_mgr_headset.c new file mode 100644 index 0000000..8f4aa14 --- /dev/null +++ b/server/mm_sound_mgr_headset.c @@ -0,0 +1,239 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "include/mm_sound_mgr_common.h" +#include "include/mm_sound_thread_pool.h" +#include "../include/mm_sound_common.h" + +#include +#include + +//#include +#include + +#include "include/mm_sound_mgr_headset.h" +//#include "include/mm_sound_mgr_asm.h" +#include "include/mm_sound_mgr_session.h" + +/******************************* Headset Code **********************************/ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "mm_ipc.h" +#include "mm_sound_common.h" +#include "mm_sound.h" + +#include + +#define EARJACK_EJECTED 0 +#define NO_FORCE_RESET 0 + +void __headset_main_run (void* param) +{ + int current_type = 0; + int new_type = 0; + int waitfd = 0; + int err = AVSYS_STATE_SUCCESS; + int eject_event_count = 0; + int need_mute = 0; + int ret = 0; + + /* re-check current path */ + avsys_audio_path_ex_reset(NO_FORCE_RESET); + + if (AVSYS_FAIL(avsys_audio_earjack_manager_init(¤t_type, &waitfd))) + return; + + while(1) { + //waiting earjack event + err = avsys_audio_earjack_manager_wait(waitfd, ¤t_type, &new_type, &need_mute); + debug_log ("wait result = %x, current_type= %d, new_type = %d, need_mute = %d\n", err, current_type, new_type, need_mute); + if (err & AVSYS_STATE_ERROR) { +#if !defined(_MMFW_I386_ALL_SIMULATOR) + if (err != AVSYS_STATE_ERR_NULL_POINTER) { + if (AVSYS_FAIL(avsys_audio_earjack_manager_unlock())) { + debug_error("avsys_audio_earjack_manager_unlock() failed in %s\n",__func__); + err = MM_ERROR_SOUND_INTERNAL; + goto fail; + } + } +#endif + break; + } else if ((err & AVSYS_STATE_WARING)) { + if (err != AVSYS_STATE_WAR_INVALID_VALUE) { + if (AVSYS_FAIL(avsys_audio_earjack_manager_unlock())) { + debug_error("avsys_audio_earjack_manager_unlock() failed in %s\n",__func__); + err = MM_ERROR_SOUND_INTERNAL; + goto fail; + } + } + continue; /* Ignore current changes and do wait again */ + } + debug_warning("Current type is %d, New type is %d\n", current_type, new_type); + + if (current_type == new_type) { + if (AVSYS_FAIL(avsys_audio_earjack_manager_unlock())) { + debug_error("avsys_audio_earjack_manager_unlock() failed in %s\n",__func__); + err = MM_ERROR_SOUND_INTERNAL; + goto fail; + } + continue; /* Ignore current changes and do wait again */ + } else { + current_type = new_type; + } + debug_warning("Current type is %d\n", current_type); + + /* mute if needed, unmute will be done end of this loop */ + if (need_mute) { + if (AVSYS_FAIL(avsys_audio_set_global_mute(AVSYS_AUDIO_MUTE_NOLOCK))) + debug_error("Set mute failed\n"); + } + + //current_type '0' means earjack ejected + if (current_type == EARJACK_EJECTED) { + eject_event_count++; + if (eject_event_count == 1) { + debug_msg ("earjack [EJECTED]\n"); + + /* ToDo: Device Update */ + MMSoundMgrSessionSetDeviceAvailable (DEVICE_WIRED, NOT_AVAILABLE, 0, NULL); + + } + } else if (current_type != EARJACK_EJECTED) { /* INSERT */ + debug_msg ("earjack is [INSERTED]\n"); + eject_event_count = 0; + + /* ToDo: Device Update */ + ret = MMSoundMgrSessionSetDeviceAvailable (DEVICE_WIRED, AVAILABLE, current_type, NULL); + if (ret != MM_ERROR_NONE) { + /* TODO : Error Handling */ + debug_error ("MMSoundMgrSessionSetDeviceAvailable failed....ret = [%x]\n", ret); + } + } + + //process change + err = avsys_audio_earjack_manager_process(current_type); + if (err & AVSYS_STATE_ERROR) { + debug_error("Earjack Managing Fatal Error 0x%x\n", err); + if (need_mute) { + if (AVSYS_FAIL(avsys_audio_set_global_mute(AVSYS_AUDIO_UNMUTE_NOLOCK))) { + debug_error("Set unmute failed\n"); + } + } +#if !defined(_MMFW_I386_ALL_SIMULATOR) + if (AVSYS_FAIL(avsys_audio_earjack_manager_unlock())) { + debug_error("avsys_audio_earjack_manager_unlock() failed in %s\n",__func__); + err = MM_ERROR_SOUND_INTERNAL; + goto fail; + } +#endif + break; + } else if (err & AVSYS_STATE_WARING) { + debug_error("Earjack Managing Warning 0x%x\n", err); + if (need_mute) { + if (AVSYS_FAIL(avsys_audio_set_global_mute(AVSYS_AUDIO_UNMUTE_NOLOCK))) { + debug_error("Set unmute failed\n"); + } + } + + if (AVSYS_FAIL(avsys_audio_earjack_manager_unlock())) { + debug_error("avsys_audio_earjack_manager_unlock() failed in %s\n",__func__); + err = MM_ERROR_SOUND_INTERNAL; + goto fail; + } + continue; + } + + /* Unmute if muted */ + if (need_mute) { + if (AVSYS_FAIL(avsys_audio_set_global_mute(AVSYS_AUDIO_UNMUTE_NOLOCK))) { + debug_error("Set unmute failed\n"); + } + } + + if (AVSYS_FAIL(avsys_audio_earjack_manager_unlock())) { + debug_error("avsys_audio_earjack_manager_unlock() failed in %s\n",__func__); + err = MM_ERROR_SOUND_INTERNAL; + goto fail; + } + } /* while (1) */ + + if (AVSYS_FAIL(avsys_audio_earjack_manager_deinit(waitfd))) { + err = MM_ERROR_SOUND_INTERNAL; + goto fail; + } + + return; + +fail: + debug_error("earjack manager exit with 0x%x\n", err); +} + +int MMSoundMgrHeadsetGetType (int *type) +{ + if (type) { + *type = avsys_audio_earjack_manager_get_type(); + } + return MM_ERROR_NONE; +} + + +int MMSoundMgrHeadsetInit(void) +{ + debug_enter("\n"); + + MMSoundThreadPoolRun(NULL, __headset_main_run); + + debug_leave("\n"); + return MM_ERROR_NONE; +} + +int MMSoundMgrHeadsetFini(void) +{ + debug_enter("\n"); + + debug_leave("\n"); + return MM_ERROR_NONE; +} + diff --git a/server/mm_sound_mgr_ipc.c b/server/mm_sound_mgr_ipc.c new file mode 100644 index 0000000..4317765 --- /dev/null +++ b/server/mm_sound_mgr_ipc.c @@ -0,0 +1,905 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "include/mm_sound_mgr_common.h" +#include "include/mm_sound_mgr_ipc.h" + +#include "../include/mm_sound_msg.h" +#include "include/mm_sound_thread_pool.h" +#include "include/mm_sound_mgr_codec.h" +#include "include/mm_sound_mgr_device.h" +#include +#include + +#include + +#define SHM_OPEN + +#ifdef PULSE_CLIENT +#include "include/mm_sound_mgr_pulse.h" +#endif + +/* message id */ +int g_rcvid; +int g_sndid; +int g_cbid; + + +/* Msg processing */ +static void _MMSoundMgrRun(void *data); +static int _MMSoundMgrStopCB(int msgid, void* msgcallback, void *msgdata); /* msg_type means instance for client */ +static int _MMSoundMgrIpcPlayFile(int *codechandle, mm_ipc_msg_t *msg); /* codechandle means codec slotid */ +static int _MMSoundMgrIpcPlayMemory(int *codechandle, mm_ipc_msg_t *msg); +static int _MMSoundMgrIpcStop(mm_ipc_msg_t *msg); +static int _MMSoundMgrIpcPlayDTMF(int *codechandle, mm_ipc_msg_t *msg); +static int __mm_sound_mgr_ipc_is_route_available(mm_ipc_msg_t *msg, bool *is_available); +static int __mm_sound_mgr_ipc_foreach_available_route_cb(mm_ipc_msg_t *msg); +static int __mm_sound_mgr_ipc_set_active_route(mm_ipc_msg_t *msg); +static int __mm_sound_mgr_ipc_get_active_device(mm_ipc_msg_t *msg, mm_sound_device_in *device_in, mm_sound_device_out *device_out); +static int __mm_sound_mgr_ipc_add_active_device_changed_cb(mm_ipc_msg_t *msg); +static int __mm_sound_mgr_ipc_remove_active_device_changed_cb(mm_ipc_msg_t *msg); +static int __mm_sound_mgr_ipc_add_available_device_changed_cb(mm_ipc_msg_t *msg); +static int __mm_sound_mgr_ipc_remove_available_device_changed_cb(mm_ipc_msg_t *msg); +static int _MMIpcRecvMsg(int msgtype, mm_ipc_msg_t *msg); +static int _MMIpcSndMsg(mm_ipc_msg_t *msg); + +int MMSoundMgrIpcInit(void) +{ + debug_fenter(); + + /* create msg queue rcv, snd, cb */ + /* This func is called only once */ + g_rcvid = msgget(ftok(KEY_BASE_PATH, RCV_MSG), IPC_CREAT |0666); + g_sndid = msgget(ftok(KEY_BASE_PATH, SND_MSG), IPC_CREAT |0666); + g_cbid = msgget(ftok(KEY_BASE_PATH, CB_MSG), IPC_CREAT |0666); + + if ((g_rcvid == -1 || g_sndid == -1 || g_cbid == -1) != MM_ERROR_NONE) { + if(errno == EACCES) + printf("Require ROOT permission.\n"); + else if(errno == EEXIST) + printf("System memory is empty.\n"); + else if(errno == ENOMEM) + printf("System memory is empty.\n"); + else if(errno == ENOSPC) + printf("Resource is empty.\n"); + + debug_error("Fail to create msgid\n"); + exit(1); + return MM_ERROR_SOUND_INTERNAL; + } + + debug_msg("Created server msg queue id : [%d]\n", g_rcvid); + debug_msg("Created server msg queue id : [%d]\n", g_sndid); + debug_msg("Created server msg queue id : [%d]\n", g_cbid); + + debug_fleave(); + return MM_ERROR_NONE; +} + +int MMSoundMgrIpcFini(void) +{ + return MM_ERROR_NONE; +} + +int MMSoundMgrIpcReady(void) +{ + int ret = MM_ERROR_NONE; + int err1, err2, err3; + mm_ipc_msg_t msg = {0,}; + mm_ipc_msg_t resp = {0,}; + + debug_fenter(); + + debug_msg("Created server msg queue id : [%d]\n", g_rcvid); + debug_msg("Created server msg queue id : [%d]\n", g_sndid); + debug_msg("Created server msg queue id : [%d]\n", g_cbid); + + /* Ready to recive message */ + while(1) { + ret = _MMIpcRecvMsg(0, &msg); + if (ret != MM_ERROR_NONE) { + debug_critical("Fail recieve message. \n"); + exit(1); + } + + debug_msg("msgtype : %d\n", msg.sound_msg.msgtype); + debug_msg("instance msgid : %d\n", msg.sound_msg.msgid); + debug_msg("handle : %d\n", msg.sound_msg.handle); + debug_msg("volume : %d\n", msg.sound_msg.volume); + debug_msg("keytone : %d\n", msg.sound_msg.keytone); + debug_msg("tone : %d\n", msg.sound_msg.tone); + debug_msg("callback : %p\n", msg.sound_msg.callback); + debug_msg("volume_config : %x\n", msg.sound_msg.volume_config); + debug_msg("priority : %d\n", msg.sound_msg.priority); + debug_msg("data : %p\n", msg.sound_msg.cbdata); + debug_msg("route : %d\n", msg.sound_msg.handle_route); + + switch (msg.sound_msg.msgtype) + { + case MM_SOUND_MSG_REQ_FILE: + case MM_SOUND_MSG_REQ_MEMORY: + case MM_SOUND_MSG_REQ_STOP: +#ifdef PULSE_CLIENT + case MM_SOUND_MSG_REQ_GET_AUDIO_ROUTE: + case MM_SOUND_MSG_REQ_SET_AUDIO_ROUTE: +#endif + case MM_SOUND_MSG_REQ_IS_BT_A2DP_ON: + case MM_SOUND_MSG_REQ_DTMF: + case MM_SOUND_MSG_REQ_IS_ROUTE_AVAILABLE: + case MM_SOUND_MSG_REQ_FOREACH_AVAILABLE_ROUTE_CB: + case MM_SOUND_MSG_REQ_SET_ACTIVE_ROUTE: + case MM_SOUND_MSG_REQ_GET_ACTIVE_DEVICE: + case MM_SOUND_MSG_REQ_ADD_ACTIVE_DEVICE_CB: + case MM_SOUND_MSG_REQ_REMOVE_ACTIVE_DEVICE_CB: + case MM_SOUND_MSG_REQ_ADD_AVAILABLE_ROUTE_CB: + case MM_SOUND_MSG_REQ_REMOVE_AVAILABLE_ROUTE_CB: + { + /* Create msg to queue : this will be freed inside thread function after use */ + mm_ipc_msg_t* msg_to_queue = malloc (sizeof(mm_ipc_msg_t)); + if (msg_to_queue) { + memcpy (msg_to_queue, &msg, sizeof (mm_ipc_msg_t)); + debug_msg ("func = %p, alloc param(msg_to_queue) = %p\n", _MMSoundMgrRun, msg_to_queue); + ret = MMSoundThreadPoolRun(msg_to_queue, _MMSoundMgrRun); + /* In case of error condition */ + if (ret != MM_ERROR_NONE) { + /* Do not send msg in Ready, Just print log */ + debug_critical("Fail to run thread [MgrRun]"); + + SOUND_MSG_SET(resp.sound_msg, MM_SOUND_MSG_RES_ERROR, ret, -1, msg.sound_msg.msgid); + ret = _MMIpcSndMsg(&resp); + if (ret != MM_ERROR_NONE) + debug_error("Fail to send message in IPC ready\n"); + } + } else { + debug_error ("failed to alloc msg\n"); + } + } + break; + + default: + /*response err unknown operation*/; + debug_critical("Error condition\n"); + debug_msg("The message Msg [%d] client id [%d]\n", msg.sound_msg.msgtype, msg.sound_msg.msgid); + SOUND_MSG_SET(resp.sound_msg, MM_SOUND_MSG_RES_ERROR, ret, -1, msg.sound_msg.msgid); + ret = _MMIpcSndMsg(&resp); + if (ret != MM_ERROR_NONE) + debug_error("Fail to send message in IPC ready\n"); + break; + } /* end : switch (msg.sound_msg.msgtype) */ + } + + /* destroy msg queue */ + err1 = msgctl(g_rcvid, IPC_RMID, NULL); + err2 = msgctl(g_sndid, IPC_RMID, NULL); + err3 = msgctl(g_cbid, IPC_RMID, NULL); + + if (err1 == -1 ||err2 == -1 ||err3 ==-1) { + debug_error("Base message node destroy fail"); + return MM_ERROR_SOUND_INTERNAL; + } + + debug_fleave(); + return MM_ERROR_NONE; +} + +static void _MMSoundMgrRun(void *data) +{ + mm_ipc_msg_t respmsg = {0,}; + int ret = MM_ERROR_NONE; + int instance; + int handle = -1; + bool is_available = 0; + mm_sound_device_in device_in = MM_SOUND_DEVICE_IN_NONE; + mm_sound_device_out device_out = MM_SOUND_DEVICE_OUT_NONE; + mm_ipc_msg_t *msg = (mm_ipc_msg_t *)data; + + debug_fenter(); + + instance = msg->sound_msg.msgid; + + switch (msg->sound_msg.msgtype) + { + case MM_SOUND_MSG_REQ_FILE: + debug_msg("Recv REQUEST FILE MSG\n"); + ret = _MMSoundMgrIpcPlayFile(&handle, msg); + if ( ret != MM_ERROR_NONE) { + debug_error("Error to MM_SOUND_MSG_REQ_FILE\n"); + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_ERROR, -1, ret, instance); + } else { + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_FILE, handle, MM_ERROR_NONE, instance); + } + break; + + case MM_SOUND_MSG_REQ_MEMORY: + debug_msg("Recv REQUEST MEMORY MSG\n"); + ret =_MMSoundMgrIpcPlayMemory(&handle, msg); + if (ret != MM_ERROR_NONE) { + debug_error("Error to MM_SOUND_MSG_REQ_MEMORY.\n"); + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_ERROR, -1, ret, instance); + } else { + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_MEMORY, handle, MM_ERROR_NONE, instance); + } + break; + + case MM_SOUND_MSG_REQ_STOP: + debug_msg("Recv STOP msg\n"); + debug_msg("STOP Handle(codec slot ID) %d \n", msg->sound_msg.handle); + ret = _MMSoundMgrIpcStop(msg); + if ( ret != MM_ERROR_NONE) { + debug_error("Error to MM_SOUND_MSG_REQ_STOP.\n"); + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_ERROR, -1, ret, instance); + } else { + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_STOP, msg->sound_msg.handle, MM_ERROR_NONE, instance); + } + break; + +#ifdef PULSE_CLIENT + case MM_SOUND_MSG_REQ_IS_BT_A2DP_ON: + debug_msg("Recv REQ_IS_BT_A2DP_ON msg\n"); + MMSoundMgrPulseHandleIsBtA2DPOnReq (msg,_MMIpcSndMsg); + return; +#endif // PULSE_CLIENT + + case MM_SOUND_MSG_REQ_DTMF: + debug_msg("Recv DTMF msg\n"); + debug_msg(" Handle(codec slot ID) %d \n", msg->sound_msg.handle); + ret = _MMSoundMgrIpcPlayDTMF(&handle, msg); + if ( ret != MM_ERROR_NONE) { + debug_error("Error to MM_SOUND_MSG_REQ_STOP.\n"); + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_ERROR, -1, ret, instance); + } else { + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_DTMF, handle, MM_ERROR_NONE, instance); + } + break; + + case MM_SOUND_MSG_REQ_IS_ROUTE_AVAILABLE: + debug_msg("Recv REQ_SET_ACTIVE_ROUTE msg\n"); + ret = __mm_sound_mgr_ipc_is_route_available(msg, &is_available); + if (ret != MM_ERROR_NONE) { + debug_error("Error to MM_SOUND_MSG_REQ_IS_ROUTE_AVAILABLE.\n"); + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_ERROR, -1, ret, instance); + } else { + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_IS_ROUTE_AVAILABLE, 0, MM_ERROR_NONE, instance); + respmsg.sound_msg.is_available = is_available; + } + break; + + case MM_SOUND_MSG_REQ_FOREACH_AVAILABLE_ROUTE_CB: + debug_msg("Recv REQ_FOREACH_AVAILABLE_ROUTE_CB msg\n"); + ret = __mm_sound_mgr_ipc_foreach_available_route_cb(&respmsg); + if (ret != MM_ERROR_NONE) { + debug_error("Error to MM_SOUND_MSG_REQ_FOREACH_AVAILABLE_ROUTE_CB.\n"); + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_ERROR, -1, ret, instance); + } else { + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_FOREACH_AVAILABLE_ROUTE_CB, 0, MM_ERROR_NONE, instance); + } + break; + + case MM_SOUND_MSG_REQ_SET_ACTIVE_ROUTE: + debug_msg("Recv REQ_SET_ACTIVE_ROUTE msg\n"); + ret = __mm_sound_mgr_ipc_set_active_route(msg); + if (ret != MM_ERROR_NONE) { + debug_error("Error to MM_SOUND_MSG_REQ_SET_ACTIVE_ROUTE.\n"); + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_ERROR, -1, ret, instance); + } else { + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_SET_ACTIVE_ROUTE, 0, MM_ERROR_NONE, instance); + } + break; + + case MM_SOUND_MSG_REQ_GET_ACTIVE_DEVICE: + debug_msg("Recv REQ_GET_ACTIVE_DEVICE msg\n"); + ret = __mm_sound_mgr_ipc_get_active_device(msg, &device_in, &device_out); + if (ret != MM_ERROR_NONE) { + debug_error("Error to MM_SOUND_MSG_REQ_GET_ACTIVE_DEVICE.\n"); + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_ERROR, -1, ret, instance); + } else { + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_GET_ACTIVE_DEVICE, 0, MM_ERROR_NONE, instance); + respmsg.sound_msg.device_in = device_in; + respmsg.sound_msg.device_out = device_out; + } + break; + + case MM_SOUND_MSG_REQ_ADD_ACTIVE_DEVICE_CB: + debug_msg("Recv REQ_ADD_ACTIVE_DEVICE_CB msg\n"); + ret = __mm_sound_mgr_ipc_add_active_device_changed_cb(msg); + if (ret != MM_ERROR_NONE) { + debug_error("Error to MM_SOUND_MSG_REQ_ADD_DEVICE_CB.\n"); + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_ERROR, -1, ret, instance); + } else { + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_ADD_ACTIVE_DEVICE_CB, 0, MM_ERROR_NONE, instance); + } + break; + + case MM_SOUND_MSG_REQ_REMOVE_ACTIVE_DEVICE_CB: + debug_msg("Recv REQ_REMOVE_ACTIVE_DEVICE_CB msg\n"); + ret = __mm_sound_mgr_ipc_remove_active_device_changed_cb(msg); + if (ret != MM_ERROR_NONE) { + debug_error("Error to MM_SOUND_MSG_REQ_REMOVE_DEVICE_CB.\n"); + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_ERROR, -1, ret, instance); + } else { + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_REMOVE_ACTIVE_DEVICE_CB, 0, MM_ERROR_NONE, instance); + } + break; + + case MM_SOUND_MSG_REQ_ADD_AVAILABLE_ROUTE_CB: + debug_msg("Recv REQ_ADD_AVAILABLE_ROUTE_CB msg\n"); + ret = __mm_sound_mgr_ipc_add_available_device_changed_cb(msg); + if (ret != MM_ERROR_NONE) { + debug_error("Error to MM_SOUND_MSG_REQ_ADD_DEVICE_CB.\n"); + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_ERROR, -1, ret, instance); + } else { + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_ADD_AVAILABLE_ROUTE_CB, 0, MM_ERROR_NONE, instance); + } + break; + + case MM_SOUND_MSG_REQ_REMOVE_AVAILABLE_ROUTE_CB: + debug_msg("Recv REQ_REMOVE_AVAILABLE_ROUTE_CB msg\n"); + ret = __mm_sound_mgr_ipc_remove_available_device_changed_cb(msg); + if (ret != MM_ERROR_NONE) { + debug_error("Error to MM_SOUND_MSG_REQ_REMOVE_DEVICE_CB.\n"); + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_ERROR, -1, ret, instance); + } else { + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_REMOVE_AVAILABLE_ROUTE_CB, 0, MM_ERROR_NONE, instance); + } + break; + + default: + /* Response error unknown operation */; + debug_critical("Unexpected msg. %d for PID:%d\n", msg->sound_msg.msgtype, msg->sound_msg.msgid ); + SOUND_MSG_SET(respmsg.sound_msg, MM_SOUND_MSG_RES_ERROR, -1, MM_ERROR_SOUND_INTERNAL, instance); + break; + } /* switch (msg->sound_msg.msgtype) */ + + ret = _MMIpcSndMsg(&respmsg); + if (ret != MM_ERROR_NONE) { + debug_error ("Fail to send message \n"); + } + + debug_msg("Sent msg to client msgid [%d] [codechandle %d][message type %d] (code 0x%08X)\n", + msg->sound_msg.msgid, respmsg.sound_msg.handle, respmsg.sound_msg.msgtype, respmsg.sound_msg.code); + + if (msg) { + debug_log ("Free mm_ipc_msg_t [%p]\n", msg); + free (msg); + } + + debug_msg("Ready to next msg\n"); + debug_fleave(); +} + +static int _MMSoundMgrStopCB(int msgid, void* msgcallback, void *msgdata) +{ + /* msgid means client instance(msg_type) must be unique */ + mm_ipc_msg_t resp = {0,}; + int ret = MM_ERROR_SOUND_INTERNAL; + + debug_fenter(); + + SOUND_MSG_SET(resp.sound_msg, MM_SOUND_MSG_INF_STOP_CB, 0, MM_ERROR_NONE, msgid); + resp.sound_msg.callback = msgcallback; + resp.sound_msg.cbdata = msgdata; + + ret = _MMIpcCBSndMsg(&resp); + if (ret != MM_ERROR_NONE) + debug_error("Fail to send callback message\n"); + + debug_fleave(); + return MM_ERROR_NONE; +} + +static int _MMSoundMgrIpcPlayFile(int *codechandle, mm_ipc_msg_t *msg) +{ + mmsound_mgr_codec_param_t param = {0,}; + MMSourceType *source = NULL; + int ret = MM_ERROR_NONE; + int mm_session_type = MM_SESSION_TYPE_SHARE; + + debug_fenter(); + + /* Set source */ + source = (MMSourceType*)malloc(sizeof(MMSourceType)); + + ret = mm_source_open_file(msg->sound_msg.filename, source, MM_SOURCE_CHECK_DRM_CONTENTS); + if(ret != MM_ERROR_NONE) { + debug_error("Fail to open file\n"); + if (source) + free(source); + return ret; + } + + /* Set sound player parameter */ + param.tone = msg->sound_msg.tone; + param.repeat_count = msg->sound_msg.repeat; + param.param = (void*)msg->sound_msg.msgid; //this is pid of client + param.volume = msg->sound_msg.volume; + param.volume_config = msg->sound_msg.volume_config; + param.priority = msg->sound_msg.priority; + mm_session_type = msg->sound_msg.session_type; + param.callback = _MMSoundMgrStopCB; + param.keytone = msg->sound_msg.keytone; + param.msgcallback = msg->sound_msg.callback; + param.msgdata = msg->sound_msg.cbdata; + param.source = source; + param.handle_route = msg->sound_msg.handle_route; + + debug_msg("DTMF %d\n", param.tone); + debug_msg("Loop %d\n", param.repeat_count); + debug_msg("Volume %d\n", param.volume); + debug_msg("Priority %d\n", param.priority); + debug_msg("VolumeConfig %x\n", param.volume_config); + debug_msg("callback %p\n", param.callback); + debug_msg("param %d\n", (int)param.param); + debug_msg("source type %d\n", param.source->type); + debug_msg("source ptr %p\n", param.source->ptr); + debug_msg("keytone %d\n", param.keytone); + debug_msg("Handle route %d\n", param.handle_route); + + //convert mm_session_type to asm_event_type + switch(mm_session_type) + { + case MM_SESSION_TYPE_SHARE: + param.session_type = ASM_EVENT_SHARE_MMSOUND; + break; + case MM_SESSION_TYPE_EXCLUSIVE: + param.session_type = ASM_EVENT_EXCLUSIVE_MMSOUND; + break; + case MM_SESSION_TYPE_NOTIFY: + param.session_type = ASM_EVENT_NOTIFY; + break; + case MM_SESSION_TYPE_ALARM: + param.session_type = ASM_EVENT_ALARM; + break; + case MM_SESSION_TYPE_EMERGENCY: + param.session_type = ASM_EVENT_EMERGENCY; + break; + case MM_SESSION_TYPE_CALL: + param.session_type = ASM_EVENT_CALL; + break; + case MM_SESSION_TYPE_VIDEOCALL: + param.session_type = ASM_EVENT_VIDEOCALL; + break; + default: + debug_error("Unknown session type - use default shared type. %s %d\n", __FUNCTION__, __LINE__); + param.session_type = ASM_EVENT_SHARE_MMSOUND; + break; + } + + + ret = MMSoundMgrCodecPlay(codechandle, ¶m); + if ( ret != MM_ERROR_NONE) { + debug_error("Will be closed a sources, codechandle : 0x%08X\n", *codechandle); + + return ret; + } + + debug_fleave(); + return MM_ERROR_NONE; +} +static int _MMSoundMgrIpcStop(mm_ipc_msg_t *msg) +{ + int ret = MM_ERROR_NONE; + + debug_fenter(); + + ret = MMSoundMgrCodecStop(msg->sound_msg.handle); + + if (ret != MM_ERROR_NONE) { + debug_error("Fail to stop sound\n"); + return ret; + } + + debug_fleave(); + return MM_ERROR_NONE; +} + +static int _MMSoundMgrIpcPlayMemory(int *codechandle, mm_ipc_msg_t *msg) +{ + mmsound_mgr_codec_param_t param = {0,}; + MMSourceType *source = NULL; + int ret = MM_ERROR_NONE; + int shm_fd = -1; + void* mmap_buf = NULL; + + debug_fenter(); + +#ifndef SHM_OPEN + if ((shmid = shmget((key_t)(msg->sound_msg.sharedkey), msg->sound_msg.memsize, 0)) == -1) + { + if(errno == ENOENT) + { + debug_error("Not initialized.\n"); + } + else if(errno == EACCES) + { + debug_error("Require ROOT permission.\n"); + } + else if(errno == ENOSPC) + { + debug_critical("Resource is empty.\n"); + } + return MM_ERROR_SOUND_INTERNAL; + } + + source = (MMSourceType*)malloc(sizeof(MMSourceType)); + + if (mm_source_open_full_memory(shmat(shmid, 0, 0), msg->sound_msg.memsize, 0, source) != MM_ERROR_NONE) + { + debug_error("Fail to set source\n"); + free(source); + return MM_ERROR_SOUND_INTERNAL; + } +#else + + debug_msg("Shm file name : %s\n", msg->sound_msg.filename); + + if(msg->sound_msg.sharedkey != 1) { + debug_error("NOT memory interface\n"); + return MM_ERROR_SOUND_INVALID_PATH; + } + + shm_fd = shm_open(msg->sound_msg.filename, O_RDONLY, 0666); + if(shm_fd < 0) { + debug_error("Fail to open\n"); + return MM_ERROR_SOUND_INTERNAL; + } + + mmap_buf = mmap (0, MEMTYPE_SUPPORT_MAX, PROT_READ , MAP_SHARED, shm_fd, 0); + if (mmap_buf == MAP_FAILED) { + perror("Fail to mmap\n"); + debug_error("MMAP failed \n"); + return MM_ERROR_SOUND_INTERNAL; + } + + /* Set source */ + source = (MMSourceType*)malloc(sizeof(MMSourceType)); + if(!source) { + debug_error("Can not allocate memory"); + return MM_ERROR_OUT_OF_MEMORY; + } + + if (mm_source_open_full_memory(mmap_buf, msg->sound_msg.memsize, 0, source) != MM_ERROR_NONE) { + debug_error("Fail to set source\n"); + free(source); + return MM_ERROR_SOUND_INTERNAL; + } +#endif + + /* Set sound player parameter */ + param.tone = msg->sound_msg.tone; + param.repeat_count = msg->sound_msg.repeat; + param.param = (void*)msg->sound_msg.msgid; + param.volume = msg->sound_msg.volume; + param.volume_config = msg->sound_msg.volume_config; + param.callback = _MMSoundMgrStopCB; + param.keytone = msg->sound_msg.keytone; + param.msgcallback = msg->sound_msg.callback; + param.msgdata = msg->sound_msg.cbdata; + param.priority = msg->sound_msg.priority; + param.source = source; + + debug_msg("DTMF %d\n", param.tone); + debug_msg("Loop %d\n", param.repeat_count); + debug_msg("Volume %d\n",param.volume); + debug_msg("Priority %d\n",param.priority); + debug_msg("VolumeConfig %x\n",param.volume_config); + debug_msg("callback %p\n", param.callback); + debug_msg("param %d\n", (int)param.param); + debug_msg("source type %d\n", param.source->type); + debug_msg("source ptr %p\n", param.source->ptr); + debug_msg("keytone %d\n", param.keytone); + + ret = MMSoundMgrCodecPlay(codechandle, ¶m); + if ( ret != MM_ERROR_NONE) { + debug_error("Will be closed a sources, codec handle : [0x%d]\n", *codechandle); + mm_source_close(source); + if (source) + free(source); + return ret; + } + + debug_fleave(); + return ret; +} + +static int _MMSoundMgrIpcPlayDTMF(int *codechandle, mm_ipc_msg_t *msg) +{ + mmsound_mgr_codec_param_t param = {0,}; + int ret = MM_ERROR_NONE; + + debug_fenter(); + + /* Set sound player parameter */ + param.tone = msg->sound_msg.tone; + param.repeat_count = msg->sound_msg.repeat; + param.param = (void*)msg->sound_msg.msgid; + param.volume = msg->sound_msg.volume; + param.volume_config = msg->sound_msg.volume_config; + param.priority = msg->sound_msg.priority; + param.callback = _MMSoundMgrStopCB; + param.msgcallback = msg->sound_msg.callback; + param.msgdata = msg->sound_msg.cbdata; + + //convert mm_session_type to asm_event_type + switch(msg->sound_msg.session_type) + { + case MM_SESSION_TYPE_SHARE: + param.session_type = ASM_EVENT_SHARE_MMSOUND; + break; + case MM_SESSION_TYPE_EXCLUSIVE: + param.session_type = ASM_EVENT_EXCLUSIVE_MMSOUND; + break; + case MM_SESSION_TYPE_NOTIFY: + param.session_type = ASM_EVENT_NOTIFY; + break; + case MM_SESSION_TYPE_ALARM: + param.session_type = ASM_EVENT_ALARM; + break; + case MM_SESSION_TYPE_EMERGENCY: + param.session_type = ASM_EVENT_EMERGENCY; + break; + case MM_SESSION_TYPE_CALL: + param.session_type = ASM_EVENT_CALL; + break; + case MM_SESSION_TYPE_VIDEOCALL: + param.session_type = ASM_EVENT_VIDEOCALL; + break; + default: + debug_error("Unknown session type - use default shared type. %s %d\n", __FUNCTION__, __LINE__); + param.session_type = ASM_EVENT_SHARE_MMSOUND; + break; + } + + debug_msg("DTMF %d\n", param.tone); + debug_msg("Loop %d\n", param.repeat_count); + debug_msg("Volume %d\n",param.volume); + debug_msg("VolumeConfig %x\n",param.volume_config); + debug_msg("Priority %d\n", param.priority); + debug_msg("callback %p\n", param.callback); + debug_msg("param %d\n", (int)param.param); + debug_msg("session %d\n", param.session_type); + + ret = MMSoundMgrCodecPlayDtmf(codechandle, ¶m); + if ( ret != MM_ERROR_NONE) { + debug_error("Will be closed a sources, codec handle : [0x%d]\n", *codechandle); + return ret; + } + + debug_fleave(); + return ret; +} + +static int __mm_sound_mgr_ipc_is_route_available(mm_ipc_msg_t *msg, bool *is_available) +{ + _mm_sound_mgr_device_param_t param; + int ret = MM_ERROR_NONE; + + debug_fenter(); + + param.route = msg->sound_msg.route; + ret = _mm_sound_mgr_device_is_route_available(¶m, is_available); + + debug_fleave(); + return ret; +} + +static int __mm_sound_mgr_ipc_foreach_available_route_cb(mm_ipc_msg_t *msg) +{ + int ret = MM_ERROR_NONE; + + debug_fenter(); + + ret = _mm_sound_mgr_device_foreach_available_route_cb(msg); + + debug_fleave(); + return ret; +} + +static int __mm_sound_mgr_ipc_set_active_route(mm_ipc_msg_t *msg) +{ + _mm_sound_mgr_device_param_t param; + int ret = MM_ERROR_NONE; + + debug_fenter(); + + param.pid = msg->sound_msg.msgid; + param.route = msg->sound_msg.route; + ret = _mm_sound_mgr_device_set_active_route(¶m); + + debug_fleave(); + return ret; +} + +static int __mm_sound_mgr_ipc_get_active_device(mm_ipc_msg_t *msg, mm_sound_device_in *device_in, mm_sound_device_out *device_out) +{ + _mm_sound_mgr_device_param_t param; + int ret = MM_ERROR_NONE; + + debug_fenter(); + + memset(¶m, 0x00, sizeof(_mm_sound_mgr_device_param_t)); + param.pid = msg->sound_msg.msgid; + + ret = _mm_sound_mgr_device_get_active_device(¶m, device_in, device_out); + + debug_fleave(); + return ret; +} + +static int __mm_sound_mgr_ipc_add_active_device_changed_cb(mm_ipc_msg_t *msg) +{ + _mm_sound_mgr_device_param_t param; + int ret = MM_ERROR_NONE; + + debug_fenter(); + + memset(¶m, 0x00, sizeof(_mm_sound_mgr_device_param_t)); + param.pid = msg->sound_msg.msgid; + param.callback = msg->sound_msg.callback; + param.cbdata = msg->sound_msg.cbdata; + + ret = _mm_sound_mgr_device_add_active_device_callback(¶m); + + debug_fleave(); + return ret; +} + +static int __mm_sound_mgr_ipc_remove_active_device_changed_cb(mm_ipc_msg_t *msg) +{ + _mm_sound_mgr_device_param_t param; + int ret = MM_ERROR_NONE; + + debug_fenter(); + + memset(¶m, 0x00, sizeof(_mm_sound_mgr_device_param_t)); + param.pid = msg->sound_msg.msgid; + + ret = _mm_sound_mgr_device_remove_active_device_callback(¶m); + + debug_fleave(); + return ret; +} + +static int __mm_sound_mgr_ipc_add_available_device_changed_cb(mm_ipc_msg_t *msg) +{ + _mm_sound_mgr_device_param_t param; + int ret = MM_ERROR_NONE; + + debug_fenter(); + + memset(¶m, 0x00, sizeof(_mm_sound_mgr_device_param_t)); + param.pid = msg->sound_msg.msgid; + param.callback = msg->sound_msg.callback; + param.cbdata = msg->sound_msg.cbdata; + + ret = _mm_sound_mgr_device_add_available_route_callback(¶m); + + debug_fleave(); + return ret; +} + +static int __mm_sound_mgr_ipc_remove_available_device_changed_cb(mm_ipc_msg_t *msg) +{ + _mm_sound_mgr_device_param_t param; + int ret = MM_ERROR_NONE; + + debug_fenter(); + + memset(¶m, 0x00, sizeof(_mm_sound_mgr_device_param_t)); + param.pid = msg->sound_msg.msgid; + + ret = _mm_sound_mgr_device_remove_available_route_callback(¶m); + + debug_fleave(); + return ret; +} + +static int _MMIpcRecvMsg(int msgtype, mm_ipc_msg_t *msg) +{ + /* rcv message */ + if(msgrcv(g_rcvid, msg, DSIZE, 0, 0) == -1) + { + if(errno == E2BIG) { + debug_warning("Not acces.\n"); + } else if(errno == EACCES) { + debug_warning("Access denied\n"); + } else if(errno == ENOMSG) { + debug_warning("Blocked process [msgflag & IPC_NOWAIT != 0]\n"); + } else if(errno == EIDRM) { + debug_warning("Removed msgid from system\n"); + } else if(errno == EINTR) { + debug_warning("Iterrrupted by singnal\n"); + } else if(errno == EINVAL) { + debug_warning("Invalid msgid \n"); + } + + debug_warning("Fail to recive msg queue : [%d] \n", g_rcvid); + return MM_ERROR_COMMON_UNKNOWN; + } + return MM_ERROR_NONE; +} + +int _MMIpcSndMsg(mm_ipc_msg_t *msg) +{ + /* snd message */ + int error = MM_ERROR_NONE; + msg->msg_type = msg->sound_msg.msgid; + debug_msg("Send message type (for client) : [%ld]\n",msg->msg_type); + error = msgsnd(g_sndid, msg,DSIZE, 0); + if ( error == -1) + { + if(errno == EACCES) { + debug_warning("Not acces.\n"); + } else if(errno == EAGAIN) { + debug_warning("Blocked process [msgflag & IPC_NOWAIT != 0]\n"); + } else if(errno == EIDRM) { + debug_warning("Removed msgid from system\n"); + } else if(errno == EINTR) { + debug_warning("Iterrrupted by singnal\n"); + } else if(errno == EINVAL) { + debug_warning("Invalid msgid or msgtype < 1 or out of data size \n"); + } else if(errno == EFAULT) { + debug_warning("The address pointed to by msgp isn't accessible \n"); + } else if(errno == ENOMEM) { + debug_warning("The system does not have enough memory to make a copy of the message pointed to by msgp\n"); + } + debug_critical("Fail to send message msg queue : [%d] \n", g_sndid); + debug_critical("Fail to send message msg queue : [%d] \n", errno); + return MM_ERROR_SOUND_INTERNAL; + } + return MM_ERROR_NONE; +} + +int _MMIpcCBSndMsg(mm_ipc_msg_t *msg) +{ + /* rcv message */ + msg->msg_type = msg->sound_msg.msgid; + debug_msg("Send CB message type (for client) : [%ld]\n",msg->msg_type); + if (msgsnd(g_cbid, msg,DSIZE, 0)== -1) + { + if(errno == EACCES) { + debug_warning("Not acces.\n"); + } else if(errno == EAGAIN) { + debug_warning("Blocked process [msgflag & IPC_NOWAIT != 0]\n"); + } else if(errno == EIDRM) { + debug_warning("Removed msgid from system\n"); + } else if(errno == EINTR) { + debug_warning("Iterrrupted by singnal\n"); + } else if(errno == EINVAL) { + debug_warning("Invalid msgid or msgtype < 1 or out of data size \n"); + } + debug_critical("Fail to callback send message msg queue : [%d] \n", g_cbid); + return MM_ERROR_SOUND_INTERNAL; + } + return MM_ERROR_NONE; +} + diff --git a/server/mm_sound_mgr_pulse.c b/server/mm_sound_mgr_pulse.c new file mode 100644 index 0000000..bcd8a6c --- /dev/null +++ b/server/mm_sound_mgr_pulse.c @@ -0,0 +1,522 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "include/mm_sound_mgr_common.h" +#include "../include/mm_sound_common.h" + +#include +#include + +//#include +//#include + +#include +#include + +#define SUPPORT_MONO_AUDIO + +#define SUPPORT_BT_SCO_DETECT + +#include "include/mm_sound_mgr_pulse.h" +#include "include/mm_sound_mgr_session.h" + +#include "include/mm_sound_msg.h" +#include "include/mm_sound_mgr_ipc.h" + + +#include +#include + +#define MAX_STRING 32 + +typedef struct _pulse_info +{ + pa_threaded_mainloop *m; + pa_context *context; + char device_api_name[MAX_STRING]; + char device_bus_name[MAX_STRING]; + bool init_bt_status; + int bt_idx; + int usb_idx; +}pulse_info_t; + +pthread_mutex_t g_mutex = PTHREAD_MUTEX_INITIALIZER; + +pulse_info_t* pulse_info = NULL; + +#define DEVICE_BUS_USB "usb" +#define DEVICE_BUS_BUILTIN "builtin" +#define IS_STREQ(str1, str2) (strcmp (str1, str2) == 0) +#define IS_BUS_USB(bus) IS_STREQ(bus, DEVICE_BUS_USB) + +/* -------------------------------- PULSEAUDIO --------------------------------------------*/ + +static void server_info_cb(pa_context *c, const pa_server_info *i, void *userdata) +{ + int ret = 0; + + if (!i) { + debug_error("error in server info callback\n"); + + } else { + debug_msg ("We got default sink = [%s]\n", i->default_sink_name); + + /* ToDo: Update server info */ + ret = MMSoundMgrSessionSetDefaultSink (i->default_sink_name); + if (ret != MM_ERROR_NONE) { + /* TODO : Error Handling */ + debug_error ("MMSoundMgrSessionSetDefaultSink failed....ret = [%x]\n", ret); + } + } + + +} + +static void init_card_info_cb (pa_context *c, const pa_card_info *i, int eol, void *userdata) +{ + pulse_info_t *pinfo = (pulse_info_t *)userdata; + if (eol || i == NULL) { + debug_msg ("signaling--------------\n"); + pa_threaded_mainloop_signal (pinfo->m, 0); + return; + } + + if (strstr (i->name, "bluez")) { + pinfo->init_bt_status = true; + } +} + +static void new_card_info_cb (pa_context *c, const pa_card_info *i, int eol, void *userdata) +{ + int ret = 0; + char* desc = NULL; + char* bus = NULL; + pulse_info_t *pinfo = (pulse_info_t *)userdata; + + if (eol || i == NULL || pinfo == NULL) { + return; + } + + bus = pa_proplist_gets(i->proplist, PA_PROP_DEVICE_BUS); + debug_msg ("[%s][%d] card name is [%s], card.property.device.bus = [%s]\n", __func__, __LINE__, i->name, bus); + + if (IS_BUS_USB(bus)) { + ret = MMSoundMgrSessionSetDeviceAvailable (DEVICE_USB_AUDIO, AVAILABLE, 0, (desc)? desc : "NONAME"); + if (ret != MM_ERROR_NONE) { + /* TODO : Error Handling */ + debug_error ("MMSoundMgrSessionSetDeviceAvailable failed....ret = [%x]\n", ret); + } + /* Store USB index for future removal */ + pinfo->usb_idx = i->index; + + } else { /* other than USB, we assume this is BT */ + /* Get device name : eg. SBH-600 */ + desc = pa_proplist_gets(i->proplist, PA_PROP_DEVICE_DESCRIPTION); + debug_msg ("[%s][%d] card name is [%s], card.property.device.description = [%s]\n", __func__, __LINE__, i->name, desc); + + /* ToDo: Update Device */ + ret = MMSoundMgrSessionSetDeviceAvailable (DEVICE_BT_A2DP, AVAILABLE, 0, (desc)? desc : "NONAME"); + if (ret != MM_ERROR_NONE) { + /* TODO : Error Handling */ + debug_error ("MMSoundMgrSessionSetDeviceAvailable failed....ret = [%x]\n", ret); + } + /* Store BT index for future removal */ + pinfo->bt_idx = i->index; + } +} + +static void context_subscribe_cb (pa_context * c, pa_subscription_event_type_t t, uint32_t idx, void *userdata) +{ + pulse_info_t *pinfo = (pulse_info_t *)userdata; + debug_msg (">>>>>>>>> [%s][%d] type=(0x%x) idx=(%u) pinfo=(%p)\n", __func__, __LINE__, t, idx, pinfo); + + if (pinfo == NULL) { + debug_error ("pinfo is null, return"); + return; + } + + if ((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_CARD) { + /* FIXME: We assumed that card is bt, card new/remove = bt new/remove */ + + if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_REMOVE) { /* BT/USB is removed */ + if (idx == pinfo->bt_idx) { + MMSoundMgrSessionSetDeviceAvailable (DEVICE_BT_A2DP, NOT_AVAILABLE, 0, NULL); + } else if (idx == pinfo->usb_idx) { + MMSoundMgrSessionSetDeviceAvailable (DEVICE_USB_AUDIO, NOT_AVAILABLE, 0, NULL); + } else { + debug_warning ("Unexpected card index [%d] is removed. (Current bt index=[%d], usb index=[%d]", idx, pinfo->bt_idx, pinfo->usb_idx); + } + } else if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_NEW) { /* BT/USB is loaded */ + /* Get more additional information for this card */ + pa_operation *o; + if (!(o = pa_context_get_card_info_by_index (c, idx, new_card_info_cb, pinfo))) { + return; + } + pa_operation_unref(o); + + } + + } else if ((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SERVER) { + pa_operation_unref(pa_context_get_server_info(c, server_info_cb, NULL)); + } else { + debug_msg ("[%s][%d] type=(0x%x) idx=(%u) is not card or server event, skip...\n", __func__, __LINE__, t, idx); + return; + } +} + + +static void context_state_cb (pa_context *c, void *userdata) +{ + pulse_info_t *pinfo = (pulse_info_t *)userdata; + + switch (pa_context_get_state(c)) { + case PA_CONTEXT_UNCONNECTED: + case PA_CONTEXT_CONNECTING: + case PA_CONTEXT_AUTHORIZING: + case PA_CONTEXT_SETTING_NAME: + case PA_CONTEXT_FAILED: + case PA_CONTEXT_TERMINATED: + break; + + case PA_CONTEXT_READY: + { + if (pinfo->context == c) { + + /* Do CARD and SERVER Subscribe */ + pa_context_set_subscribe_callback(c, context_subscribe_cb, pinfo); + pa_operation *o; + if (!(o = pa_context_subscribe(c, (pa_subscription_mask_t)PA_SUBSCRIPTION_MASK_CARD | PA_SUBSCRIPTION_MASK_SERVER, NULL, NULL))) { + return; + } + pa_operation_unref(o); + + pa_operation_unref(pa_context_get_card_info_list (pinfo->context, init_card_info_cb, pinfo)); + + /* signaling will be done after get card info in card info callback */ + } + break; + } + } +} + + +static int pulse_init (pulse_info_t * pinfo) +{ + int res; + + debug_msg (">>>>>>>>> [%s][%d]\n", __func__, __LINE__); + + /* Create new mainloop */ + pinfo->m = pa_threaded_mainloop_new(); + //g_assert(g_m); + + res = pa_threaded_mainloop_start (pinfo->m); + //g_assert (res == 0); + + /* LOCK thread */ + pa_threaded_mainloop_lock (pinfo->m); + + /* Get mainloop API */ + pa_mainloop_api *api = pa_threaded_mainloop_get_api(pinfo->m); + + /* Create new Context */ + pinfo->context = pa_context_new(api, "SOUND_SERVER_ROUTE_MANAGER"); + + /* Set Callback */ + pa_context_set_state_callback (pinfo->context, context_state_cb, pinfo); + + /* Connect */ + if (pa_context_connect (pinfo->context, NULL, PA_CONTEXT_NOAUTOSPAWN, NULL) < 0) { + debug_error ("connection error\n"); + } + + for (;;) { + pa_context_state_t state; + + state = pa_context_get_state (pinfo->context); + + debug_msg ("context state is now %d\n", state); + + if (!PA_CONTEXT_IS_GOOD (state)) { + debug_error ("connection failed\n"); + break; + } + + if (state == PA_CONTEXT_READY) + break; + + /* Wait until the context is ready */ + debug_msg ("waiting..................\n"); + pa_threaded_mainloop_wait (pinfo->m); + } + + /* UNLOCK thread */ + pa_threaded_mainloop_unlock (pinfo->m); + + debug_msg ("<<<<<<<<<< [%s][%d]\n", __func__, __LINE__); + + return res; +} + + +static void sink_info_cb (pa_context *c, const pa_sink_info *i, int is_last, void *userdata) +{ + pulse_info_t * pinfo = (pulse_info_t *)userdata; + + if (is_last || i == NULL || pinfo == NULL) { + if (is_last < 0) { + debug_error("Failed to get sink information: %s\n", pa_strerror(pa_context_errno(c))); + } + return; + } + + debug_log ("Checking for sink name=[%s] Starts, finding api=[%s],bus=[%s]\n", i->name, pinfo->device_api_name, pinfo->device_bus_name); + + if (i->name && i->proplist) { + const char *api_string = pa_proplist_gets (i->proplist, "device.api"); + if (api_string) { + debug_log (" Found api = [%s]\n", api_string); + if (IS_STREQ(api_string, pinfo->device_api_name)) { + const char *bus_string = pa_proplist_gets (i->proplist, "device.bus"); + if (bus_string) { + debug_log (" Found bus = [%s]\n", bus_string); + if (IS_STREQ(bus_string, pinfo->device_bus_name)) { + debug_log (" ** FOUND!!! set default sink to [%s]\n", i->name); + pa_operation_unref(pa_context_set_default_sink(pinfo->context, i->name, NULL, NULL)); + } else { + debug_warning ("No string [%s] match!!!!\n", pinfo->device_bus_name); + } + } else { + debug_log (" Found no bus "); + if (IS_STREQ(DEVICE_BUS_BUILTIN, pinfo->device_bus_name)) { + debug_log (" searching bus was builtin, then select this"); + pa_operation_unref(pa_context_set_default_sink(pinfo->context, i->name, NULL, NULL)); + } + } + } else { + debug_warning ("No string [%s] match!!!!\n", pinfo->device_api_name); + } + } + } + + debug_log ("Checked for sink name=[%s]\n", i->name); +} + + +static void pulse_set_default_sink (pulse_info_t * pinfo, char *device_api_name, char *device_bus_name) +{ + strcpy (pinfo->device_api_name, device_api_name); + strcpy (pinfo->device_bus_name, device_bus_name); + pa_operation_unref(pa_context_get_sink_info_list(pinfo->context, sink_info_cb, pinfo)); +} + +static int pulse_deinit (pulse_info_t * pinfo) +{ + pa_threaded_mainloop_lock (pinfo->m); + if (pinfo->context) { + pa_context_disconnect (pinfo->context); + + /* Make sure we don't get any further callbacks */ + pa_context_set_state_callback (pinfo->context, NULL, NULL); + + pa_context_unref (pinfo->context); + pinfo->context = NULL; + } + pa_threaded_mainloop_unlock (pinfo->m); + + pa_threaded_mainloop_stop (pinfo->m); + pa_threaded_mainloop_free (pinfo->m); + + debug_msg ("<<<<<<<<<< [%s][%d]\n", __func__, __LINE__); + + return 0; + +} + +/* -------------------------------- MONO AUDIO --------------------------------------------*/ +#ifdef SUPPORT_MONO_AUDIO +#define MONO_KEY VCONFKEY_SETAPPL_ACCESSIBILITY_MONO_AUDIO + +static void success_cb (pa_context *c, int success, void *userdata) +{ + debug_msg ("success = %d\n", success); +} + +static void mono_changed_cb(keynode_t* node, void* data) +{ + int key_value; + pulse_info_t* pinfo = (pulse_info_t*)data; + + debug_msg ("%s changed callback called\n",vconf_keynode_get_name(node)); + + vconf_get_bool(MONO_KEY, &key_value); + debug_msg ("key value = %d\n", key_value); + + pa_operation_unref (pa_ext_policy_set_mono (pinfo->context, key_value, success_cb, NULL)); +} + +int MMSoundMgrPulseHandleRegisterMonoAudio (void* pinfo) +{ + int ret = vconf_notify_key_changed(MONO_KEY, mono_changed_cb, pinfo); + debug_msg ("vconf [%s] set ret = %d\n", MONO_KEY, ret); + return ret; +} +#endif /* SUPPORT_MONO_AUDIO */ + + +/* -------------------------------- BT SCO --------------------------------------------*/ +#ifdef SUPPORT_BT_SCO_DETECT + +static void bt_changed_cb(keynode_t* node, void* data) +{ + int bt_status = VCONFKEY_BT_DEVICE_NONE; + int available = 0; + + debug_msg ("[%s] changed callback called\n", vconf_keynode_get_name(node)); + + /* Get actual vconf value */ + vconf_get_int(VCONFKEY_BT_DEVICE, &bt_status); + debug_msg ("key value = 0x%x\n", bt_status); + + /* Set device available based on vconf key value */ + available = (bt_status & VCONFKEY_BT_DEVICE_HEADSET_CONNECTED)? AVAILABLE : NOT_AVAILABLE; + MMSoundMgrSessionSetDeviceAvailable (DEVICE_BT_SCO, available, 0, NULL); +} + +int MMSoundMgrPulseHandleRegisterBluetoothStatus (void* pinfo) +{ + /* set callback for vconf key change */ + int ret = vconf_notify_key_changed(VCONFKEY_BT_DEVICE , bt_changed_cb, pinfo); + debug_msg ("vconf [%s] set ret = %d\n", VCONFKEY_BT_DEVICE, ret); + return ret; +} +#endif /* SUPPORT_BT_SCO_DETECT */ + +/* -------------------------------- MGR MAIN --------------------------------------------*/ + +int MMSoundMgrPulseHandleIsBtA2DPOnReq (mm_ipc_msg_t *msg, int (*sendfunc)(mm_ipc_msg_t*)) +{ + int ret = 0; + mm_ipc_msg_t respmsg = {0,}; + char* bt_name; + bool is_bt_on = false; + pthread_mutex_lock(&g_mutex); + + debug_enter("msg = %p, sendfunc = %p\n", msg, sendfunc); + + bt_name = MMSoundMgrSessionGetBtA2DPName(); + if (bt_name && strlen(bt_name) > 0) { + is_bt_on = true; + } + + debug_log ("is_bt_on = [%d], name = [%s]\n", is_bt_on, bt_name); + + SOUND_MSG_SET(respmsg.sound_msg, + MM_SOUND_MSG_RES_IS_BT_A2DP_ON, msg->sound_msg.handle, is_bt_on, msg->sound_msg.msgid); + strncpy (respmsg.sound_msg.filename, bt_name, sizeof (respmsg.sound_msg.filename)-1); + + /* Send Response */ + ret = sendfunc (&respmsg); + if (ret != MM_ERROR_NONE) { + /* TODO : Error Handling */ + debug_error ("sendfunc failed....ret = [%x]\n", ret); + } + + pthread_mutex_unlock(&g_mutex); + + debug_leave("\n"); + + return ret; +} + +void MMSoundMgrPulseSetDefaultSink (char* device_api_name, char* device_bus_name) +{ + debug_enter("\n"); + + pulse_set_default_sink(pulse_info, device_api_name, device_bus_name); + + debug_leave("\n"); +} + +void MMSoundMgrPulseGetInitialBTStatus (bool *a2dp, bool *sco) +{ + int bt_status = VCONFKEY_BT_DEVICE_NONE; + + if (a2dp == NULL || sco == NULL) { + debug_error ("Invalide arguments!!!\n"); + return; + } + + /* Get saved bt status */ + *a2dp = pulse_info->init_bt_status; + + /* Get actual vconf value */ + vconf_get_int(VCONFKEY_BT_DEVICE, &bt_status); + debug_msg ("key value = 0x%x\n", bt_status); + *sco = (bt_status & VCONFKEY_BT_DEVICE_HEADSET_CONNECTED)? true : false; + + debug_msg ("returning a2dp=[%d], sco=[%d]\n", *a2dp, *sco); +} + +void* MMSoundMgrPulseInit(void) +{ + pulse_info = (pulse_info_t*) malloc (sizeof(pulse_info_t)); + memset (pulse_info, 0, sizeof(pulse_info_t)); + + debug_enter("\n"); + + pulse_init(pulse_info); + +#ifdef SUPPORT_MONO_AUDIO + MMSoundMgrPulseHandleRegisterMonoAudio(pulse_info); +#endif + +#ifdef SUPPORT_BT_SCO_DETECT + MMSoundMgrPulseHandleRegisterBluetoothStatus(pulse_info); +#endif + + debug_leave("\n"); + return pulse_info; +} + +int MMSoundMgrPulseFini(void* handle) +{ + debug_enter("\n"); + + pulse_deinit((pulse_info_t *)handle); + + debug_leave("\n"); + return MM_ERROR_NONE; +} + diff --git a/server/mm_sound_mgr_run.c b/server/mm_sound_mgr_run.c new file mode 100644 index 0000000..2fdcb10 --- /dev/null +++ b/server/mm_sound_mgr_run.c @@ -0,0 +1,121 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include + +#include "include/mm_sound_plugin_run.h" +#include "include/mm_sound_mgr_run.h" +#include "include/mm_sound_thread_pool.h" + +#include +#include + +static void _MMsoundMgrRunRunInternal(void *param); + +static MMSoundPluginType *g_run_plugins = NULL; + +int MMSoundMgrRunInit(const char *targetdir) +{ + debug_fenter(); + + if (g_run_plugins) { + debug_error("Please Check Init twice\n"); + return MM_ERROR_SOUND_INTERNAL; + } + MMSoundPluginScan(targetdir, MM_SOUND_PLUGIN_TYPE_RUN, &g_run_plugins); + + debug_fleave(); + return MM_ERROR_NONE; +} + +int MMSoundMgrRunFini(void) +{ + debug_fenter(); + + MMSoundPluginRelease(g_run_plugins); + g_run_plugins = NULL; + + debug_fleave(); + return MM_ERROR_NONE; +} + +int MMSoundMgrRunRunAll(void) +{ + int loop = 0; + + debug_fenter(); + + while (g_run_plugins[loop].type != MM_SOUND_PLUGIN_TYPE_NONE) { + MMSoundThreadPoolRun((void*)loop, _MMsoundMgrRunRunInternal); + loop++; + } + + debug_fleave(); + return MM_ERROR_NONE; +} + +int MMSoundMgrRunStopAll(void) +{ + mmsound_run_interface_t intface; + void *func = NULL; + int loop = 0; + + debug_fenter(); + + while (g_run_plugins[loop].type != MM_SOUND_PLUGIN_TYPE_NONE) { + debug_msg("loop : %d\n", loop); + MMSoundPluginGetSymbol(&g_run_plugins[loop], RUN_GET_INTERFACE_FUNC_NAME, &func); + MMSoundPlugRunCastGetInterface(func)(&intface); + intface.stop(); + loop++; + } + + debug_fleave(); + return MM_ERROR_NONE; +} + +static void _MMsoundMgrRunRunInternal(void *param) +{ + int err = MM_ERROR_NONE; + mmsound_run_interface_t intface; + void* func = NULL; + + debug_enter("plugin number %d\n", (int)param); + + err = MMSoundPluginGetSymbol(&g_run_plugins[(int)param], RUN_GET_INTERFACE_FUNC_NAME, &func); + if (err != MM_ERROR_NONE) { + debug_error("Get Symbol RUN_GET_INTERFACE_FUNC_NAME is fail : %x\n", err); + } + err = MMSoundPlugRunCastGetInterface(func)(&intface); + if (err != MM_ERROR_NONE) { + debug_error("Get interface fail : %x\n", err); + /* If error occur, clean interface */ + //memset(&g_run_plugins[(int)param], 0, sizeof(mmsound_run_interface_t)); + } + if(intface.SetThreadPool) + intface.SetThreadPool(MMSoundThreadPoolRun); + intface.run(); + debug_msg("Trace\n"); + debug_msg("Trace\n"); + + debug_fleave(); +} + diff --git a/server/mm_sound_mgr_session.c b/server/mm_sound_mgr_session.c new file mode 100644 index 0000000..404b623 --- /dev/null +++ b/server/mm_sound_mgr_session.c @@ -0,0 +1,1542 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "../include/mm_sound_common.h" +#include "../include/mm_sound_utils.h" +#include "include/mm_sound_mgr_common.h" +#include "include/mm_sound_mgr_session.h" +#include "include/mm_sound_mgr_device.h" +#include "include/mm_sound_mgr_headset.h" +#include "include/mm_sound_mgr_pulse.h" +#include "include/mm_sound_mgr_asm.h" + +#define EARJACK_WITH_MIC 2 + +#define MAX_STRING_LEN 256 + +#define DEVICE_API_BLUETOOTH "bluez" +#define DEVICE_API_ALSA "alsa" +#ifdef USE_PULSE_WFD /* Not enabled yet */ +#define DEVICE_API_WFD "wfd" +#endif + +#define DEVICE_BUS_BLUETOOTH "bluetooth" +#define DEVICE_BUS_USB "usb" +#define DEVICE_BUS_BUILTIN "builtin" +#ifdef SEPARATE_SPEAKER_AND_WIRED_ACCESSORY +#define DEVICE_BUS_WIRED "wired" +#endif + +#define MM_SOUND_DEVICE_OUT_ANY 0x000FFF00 +#define MM_SOUND_DEVICE_IN_ANY 0x000000FF + +#define MM_SOUND_DEVICE_OUT_FILTER 0x000000FF +#define MM_SOUND_DEVICE_IN_FILTER 0x000FFF00 + +pthread_mutex_t g_mutex_session = PTHREAD_MUTEX_INITIALIZER; + +#define LOCK_SESSION() do { debug_log("(*)LOCKING\n"); /*pthread_mutex_lock(&g_mutex_session);*/ debug_log("(+)LOCKED\n"); }while(0) +#define UNLOCK_SESSION() do { /* pthread_mutex_unlock(&g_mutex_session);*/ debug_log("(-)UNLOCKED\n"); }while(0) + +#define RESET_ACTIVE(x) (g_info.device_active &= x) +#define RESET_AVAILABLE(x) (g_info.device_available &= x) + +#define SET_ACTIVE(x) (g_info.device_active |= x) +#define SET_AVAILABLE(x) (g_info.device_available |= x) + +#define SET_PLAYBACK_ONLY_ACTIVE(x) do { RESET_ACTIVE(MM_SOUND_DEVICE_OUT_FILTER); SET_ACTIVE(x); }while(0) +#define SET_CAPTURE_ONLY_ACTIVE(x) do { RESET_ACTIVE(MM_SOUND_DEVICE_IN_FILTER); SET_ACTIVE(x); }while(0) + + +#define UNSET_ACTIVE(x) (g_info.device_active &= (~x)) +#define UNSET_AVAILABLE(x) (g_info.device_available &= (~x)) + +#define TOGGLE_ACTIVE(x) (g_info.device_active ^= x) +#define TOGGLE_AVAILABLE(x) (g_info.device_available ^= x) + +#define IS_ACTIVE(x) (g_info.device_active & x) +#define IS_AVAILABLE(x) (g_info.device_available & x) + +#define GET_AVAILABLE_PLAYBACK() IS_AVAILABLE(MM_SOUND_DEVICE_OUT_ANY) +#define GET_AVAILABLE_CAPTURE() IS_AVAILABLE(MM_SOUND_DEVICE_IN_ANY) + +#define GET_ACTIVE_PLAYBACK() IS_ACTIVE(MM_SOUND_DEVICE_OUT_ANY) +#define GET_ACTIVE_CAPTURE() IS_ACTIVE(MM_SOUND_DEVICE_IN_ANY) + +#define IS_COMMUNICATION_SESSION() ((g_info.session == SESSION_VOICECALL) || (g_info.session == SESSION_VOIP)) +#define IS_NOTIFICATION_SESSION() (g_info.session == SESSION_NOTIFICATION) +#define IS_EMERGENCY_SESSION() (g_info.session == SESSION_EMERGENCY) + +static int __set_sound_path_for_current_active (); +static int __set_sound_path_to_dual (); +static int __set_sound_path_to_speaker (); +static void __select_playback_active_device (void); +static void __select_capture_active_device (void); + +#define ENABLE_CALLBACK +#ifndef ENABLE_CALLBACK +#define _mm_sound_mgr_device_available_device_callback(a,b,c) MM_ERROR_NONE +#define _mm_sound_mgr_device_active_device_callback(a,b) MM_ERROR_NONE +#endif + +typedef struct _session_info_struct +{ + int asm_handle; + int device_available; + int device_active; + int headset_type; + + session_t session; + subsession_t subsession; + + char bt_name[MAX_STRING_LEN]; + char default_sink_name[MAX_STRING_LEN]; + + +} SESSION_INFO_STRUCT; + + +SESSION_INFO_STRUCT g_info; + +typedef enum +{ + NO_NOTI = 0, + DO_NOTI +} noti_t; + + +static void dump_info () +{ + int i = 0; + + const char *playback_device_str[] = { "SPEAKER ", "RECEIVER ", "HEADSET ", "BTSCO ", "BTA2DP ", "DOCK ", "HDMI ", "WFD ", "USB " }; + const char *capture_device_str[] = { "MAINMIC ", "HEADSET ", "BTMIC " }; + + int playback_max = sizeof (playback_device_str) / sizeof (char*); + int capture_max = sizeof (capture_device_str) / sizeof (char*); + + static char tmp_str[128]; + static char tmp_str2[128]; + + debug_log ("<----------------------------------------------------->\n"); + + + strcpy (tmp_str, "PLAYBACK = [ "); + for (i=0; i> 8) & (0x01 << i)) { + strcat (tmp_str, playback_device_str[i]); + } + } + strcat (tmp_str, "]"); + + strcpy (tmp_str2, "CAPTURE = [ "); + for (i=0; i> 8) & (0x01 << i)) { + strcat (tmp_str, playback_device_str[i]); + } + } + strcat (tmp_str, "]"); + + strcpy (tmp_str2, "CAPTURE = [ "); + for (i=0; i\n"); +} + +/* ------------------------- ASM ------------------------------------*/ +static pthread_mutex_t _asm_mutex = PTHREAD_MUTEX_INITIALIZER; + +static bool _asm_register_for_headset (int * handle) +{ + int asm_error = 0; + + if (handle == NULL) { + debug_error ("Handle is not valid!!!\n"); + return false; + } + + if (!ASM_register_sound_ex (-1, handle, ASM_EVENT_EARJACK_UNPLUG, ASM_STATE_NONE, NULL, NULL, ASM_RESOURCE_NONE, &asm_error, __asm_process_message)) { + debug_warning("earjack event register failed with 0x%x\n", asm_error); + return false; + } + + return true; +} + +static void _asm_pause_process(int handle) +{ + int asm_error = 0; + + MMSOUND_ENTER_CRITICAL_SECTION( &_asm_mutex ) + + /* If no asm handle register here */ + if (g_info.asm_handle == -1) { + debug_msg ("ASM handle is not valid, try to register once more\n"); + + /* This register should be success */ + if (_asm_register_for_headset (&g_info.asm_handle)) { + debug_msg("_asm_register_for_headset() success\n"); + } else { + debug_error("_asm_register_for_headset() failed\n"); + } + } + + //do pause + debug_warning("Send earphone unplug event to Audio Session Manager Server for BT headset\n"); + + if (!ASM_set_sound_state_ex(handle, ASM_EVENT_EARJACK_UNPLUG, ASM_STATE_PLAYING, ASM_RESOURCE_NONE, &asm_error, __asm_process_message)) { + debug_error("earjack event set sound state to playing failed with 0x%x\n", asm_error); + } + + if (!ASM_set_sound_state_ex(handle, ASM_EVENT_EARJACK_UNPLUG, ASM_STATE_STOP, ASM_RESOURCE_NONE, &asm_error, __asm_process_message)) { + debug_error("earjack event set sound state to stop failed with 0x%x\n", asm_error); + } + + MMSOUND_LEAVE_CRITICAL_SECTION( &_asm_mutex ) +} + +static bool _asm_unregister_for_headset (int *handle) +{ + int asm_error = 0; + + if (handle == NULL) { + debug_error ("Handle is not valid!!!\n"); + return false; + } + + if (!ASM_unregister_sound_ex(*handle, ASM_EVENT_EARJACK_UNPLUG, &asm_error, __asm_process_message)) { + debug_error("earjack event unregister failed with 0x%x\n", asm_error); + return false; + } + + return true; +} + +/* ------------------------- INTERNAL FUNCTIONS ------------------------------------*/ + +static void __set_path_with_notification(noti_t noti) +{ + int ret = MM_ERROR_NONE; + + debug_msg ("[%s] noti=%d\n", __func__,noti); + + /* Set path based on current active device */ + ret = __set_sound_path_for_current_active(); + if (ret != MM_ERROR_NONE) { + debug_error ("__set_sound_path_for_current_active() failed [%x]\n", ret); + return; + } + + if (noti == DO_NOTI) { + /* Notify current active device */ + ret = _mm_sound_mgr_device_active_device_callback(GET_ACTIVE_CAPTURE(), GET_ACTIVE_PLAYBACK()); + if (ret != MM_ERROR_NONE) { + debug_error ("_mm_sound_mgr_device_active_device_callback() failed [%x]\n", ret); + } + } +} + +static int __set_playback_route_communication (session_state_t state) +{ + int ret = MM_ERROR_NONE; + int gain; + + debug_fenter(); + + if (state == SESSION_START) { + SET_AVAILABLE(MM_SOUND_DEVICE_OUT_RECEIVER); + debug_log ("voicecall session started...only receiver available set on..."); + + ret = _mm_sound_mgr_device_available_device_callback(MM_SOUND_DEVICE_IN_NONE, MM_SOUND_DEVICE_OUT_RECEIVER, 1); + if (ret != MM_ERROR_NONE) { + debug_error ("_mm_sound_mgr_device_available_device_callback() failed [%x]\n", ret); + goto ROUTE_COMM_EXIT; + } + + /* Set default subsession as MEDIA */ + g_info.subsession = SUBSESSION_MEDIA; + + /* (speaker = receiver, headset = headset, bt a2dp = bt sco) */ + /* OUT */ + if (IS_ACTIVE(MM_SOUND_DEVICE_OUT_SPEAKER)) { + debug_log ("active out was SPEAKER => activate receiver!!\n"); + SET_PLAYBACK_ONLY_ACTIVE(MM_SOUND_DEVICE_OUT_RECEIVER); + + } else if (IS_ACTIVE(MM_SOUND_DEVICE_OUT_BT_A2DP)) { + debug_log ("active out was BT A2DP => activate BT SCO!!\n"); + SET_PLAYBACK_ONLY_ACTIVE(MM_SOUND_DEVICE_OUT_BT_SCO); + SET_CAPTURE_ONLY_ACTIVE(MM_SOUND_DEVICE_IN_BT_SCO); + } + /* FIXME : Do we have to set IN device ??? */ + + __set_path_with_notification(DO_NOTI); + + dump_info(); + + } else { /* SESSION_END */ + UNSET_AVAILABLE(MM_SOUND_DEVICE_OUT_RECEIVER); + + ret = _mm_sound_mgr_device_available_device_callback(MM_SOUND_DEVICE_IN_NONE, MM_SOUND_DEVICE_OUT_RECEIVER, 0); + if (ret != MM_ERROR_NONE) { + debug_error ("_mm_sound_mgr_device_available_device_callback() failed [%x]\n", ret); + goto ROUTE_COMM_EXIT; + } + + // RESET + if (g_info.session == SESSION_VOICECALL) + gain = AVSYS_AUDIO_GAIN_EX_VOICECALL; + else if (g_info.session == SESSION_VOIP) + gain = AVSYS_AUDIO_GAIN_EX_VIDEOCALL; + else { + debug_warning ("Not valid session info....\n"); + gain = AVSYS_AUDIO_GAIN_EX_VOICECALL; + } + + + if (AVSYS_FAIL(avsys_audio_set_path_ex( gain, + AVSYS_AUDIO_PATH_EX_NONE, AVSYS_AUDIO_PATH_EX_NONE, + AVSYS_AUDIO_PATH_OPTION_NONE ))) { + debug_error ("avsys_audio_set_path_ex() failed [%x]\n", ret); + ret = MM_ERROR_SOUND_INTERNAL; + goto ROUTE_COMM_EXIT; + } + + /* activate current available device based on priority */ + debug_log ("Reset ACTIVE and find new one by priority.\n"); + RESET_ACTIVE(0); + __select_playback_active_device(); + __select_capture_active_device(); + + debug_log ("voicecall session stopped...set path based on current active device"); + __set_path_with_notification(DO_NOTI); + + dump_info(); + } + +ROUTE_COMM_EXIT: + + debug_fleave(); + + return ret; +} + +static int __set_playback_route_fmradio (session_state_t state) +{ + int ret = MM_ERROR_NONE; + int out; + + debug_fenter(); + + if (state == SESSION_START) { + + if (IS_ACTIVE(MM_SOUND_DEVICE_OUT_SPEAKER)) + out = AVSYS_AUDIO_PATH_EX_SPK; + else if (IS_ACTIVE(MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY)) + out = AVSYS_AUDIO_PATH_EX_HEADSET; + else if (IS_ACTIVE(MM_SOUND_DEVICE_OUT_BT_A2DP)) + out = AVSYS_AUDIO_PATH_EX_A2DP; + + /* PATH SET */ + if (AVSYS_FAIL(avsys_audio_set_path_ex( AVSYS_AUDIO_GAIN_EX_FMRADIO, + out, AVSYS_AUDIO_PATH_EX_FMINPUT, + AVSYS_AUDIO_PATH_OPTION_NONE))) { + debug_error ("avsys_audio_set_path_ex() failed\n"); + ret = MM_ERROR_SOUND_INTERNAL; + goto ROUTE_FMRADIO_EXIT; + } + + + } else { /* SESSION_END */ + /* PATH RELEASE */ + if (AVSYS_FAIL(avsys_audio_set_path_ex( AVSYS_AUDIO_GAIN_EX_FMRADIO, + AVSYS_AUDIO_PATH_EX_NONE, AVSYS_AUDIO_PATH_EX_NONE, + AVSYS_AUDIO_PATH_OPTION_NONE ))) { + debug_error ("avsys_audio_set_path_ex() failed\n"); + ret = MM_ERROR_SOUND_INTERNAL; + goto ROUTE_FMRADIO_EXIT; + } + + /* Set as current active status */ + __set_path_with_notification (NO_NOTI); + } + + if (AVSYS_FAIL(avsys_audio_set_ext_device_status(AVSYS_AUDIO_EXT_DEVICE_FMRADIO, state))) { + debug_error ("avsys_audio_set_ext_device_status() failed\n"); + ret = MM_ERROR_SOUND_INTERNAL; + } + +ROUTE_FMRADIO_EXIT: + + debug_fleave(); + + return ret; +} + +static int __set_playback_route_notification (session_state_t state) +{ + int ret = MM_ERROR_NONE; + + debug_fenter(); + + if (state == SESSION_START) { + ret = __set_sound_path_to_dual (); + if (ret != MM_ERROR_NONE) { + debug_error ("__set_sound_path_to_dual() failed [%x]\n", ret); + } + + } else { /* SESSION_END */ + __set_path_with_notification (NO_NOTI); + } + + debug_fleave(); + + return ret; +} + +static int __set_playback_route_emergency (session_state_t state) +{ + int ret = MM_ERROR_NONE; + + debug_fenter(); + + if (state == SESSION_START) { + ret = __set_sound_path_to_speaker (); + if (ret != MM_ERROR_NONE) { + debug_error ("__set_sound_path_to_speaker() failed [%x]\n", ret); + } + + } else { /* SESSION_END */ + __set_path_with_notification (NO_NOTI); + } + + debug_fleave(); + + return ret; +} + +static bool __is_forced_session () +{ + return (IS_NOTIFICATION_SESSION() || IS_EMERGENCY_SESSION())? true : false; +} + +static int __set_sound_path_for_current_active (void) +{ + int ret = MM_ERROR_NONE; + int option = AVSYS_AUDIO_PATH_OPTION_NONE; + int in = 0, out = 0, gain = 0; + int sound_play; + + debug_fenter(); + + if (__is_forced_session()) { + debug_log ("Current session is NOTI/EMER, pending path setting. path set will be done after session ends") + goto CURRENT_ACTIVE_END; + } + + /* Pulseaudio route */ + if (IS_ACTIVE(MM_SOUND_DEVICE_OUT_BT_A2DP)) { + debug_log ("BT A2DP is active, Set default sink to BLUEZ"); + MMSoundMgrPulseSetDefaultSink (DEVICE_API_BLUETOOTH, DEVICE_BUS_BLUETOOTH); + goto CURRENT_ACTIVE_END; + } else if (IS_ACTIVE(MM_SOUND_DEVICE_OUT_WFD)) { +#ifdef USE_PULSE_WFD /* Not enabled yet */ + debug_log ("WFD is active, Set default sink to WFD"); + MMSoundMgrPulseSetDefaultSink (DEVICE_API_WFD, DEVICE_BUS_BUILTIN); + goto CURRENT_ACTIVE_END; +#endif + } else if (IS_ACTIVE(MM_SOUND_DEVICE_OUT_USB_AUDIO)) { + debug_log ("USB Audio is active, Set default sink to USB Audio"); + MMSoundMgrPulseSetDefaultSink (DEVICE_API_ALSA, DEVICE_BUS_USB); + goto CURRENT_ACTIVE_END; + } + +#ifndef SEPARATE_SPEAKER_AND_WIRED_ACCESSORY + /* ALSA route */ + debug_log ("Set default sink to ALSA with BUILTIN"); + MMSoundMgrPulseSetDefaultSink (DEVICE_API_ALSA, DEVICE_BUS_BUILTIN); +#endif + + /* prepare IN */ + if (IS_ACTIVE(MM_SOUND_DEVICE_IN_MIC)) { + in = AVSYS_AUDIO_PATH_EX_MIC; + } else if (IS_ACTIVE(MM_SOUND_DEVICE_IN_WIRED_ACCESSORY)) { + in = AVSYS_AUDIO_PATH_EX_HEADSETMIC; + } else if (IS_ACTIVE(MM_SOUND_DEVICE_IN_BT_SCO)) { + in = AVSYS_AUDIO_PATH_EX_BTMIC; + } + + /* prepare OUT */ + if (IS_ACTIVE(MM_SOUND_DEVICE_OUT_SPEAKER)) { + out = AVSYS_AUDIO_PATH_EX_SPK; + } else if (IS_ACTIVE(MM_SOUND_DEVICE_OUT_RECEIVER)) { + out = AVSYS_AUDIO_PATH_EX_RECV; + } else if (IS_ACTIVE(MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY)) { + out = AVSYS_AUDIO_PATH_EX_HEADSET; + } else if (IS_ACTIVE(MM_SOUND_DEVICE_OUT_BT_SCO)) { + out = AVSYS_AUDIO_PATH_EX_BTHEADSET; + } else if (IS_ACTIVE(MM_SOUND_DEVICE_OUT_DOCK)) { + out = AVSYS_AUDIO_PATH_EX_DOCK; + } else if (IS_ACTIVE(MM_SOUND_DEVICE_OUT_HDMI)) { + out = AVSYS_AUDIO_PATH_EX_HDMI; + } else if (IS_ACTIVE(MM_SOUND_DEVICE_OUT_WFD)) { +#ifndef USE_PULSE_WFD + out = AVSYS_AUDIO_PATH_EX_HDMI; +#endif + } + + /* prepare GAIN */ + switch (g_info.session) { + case SESSION_MEDIA: + case SESSION_NOTIFICATION: + case SESSION_EMERGENCY: + gain = AVSYS_AUDIO_GAIN_EX_KEYTONE; + break; + + case SESSION_VOICECALL: + case SESSION_VOIP: + if (g_info.subsession == SUBSESSION_RINGTONE) { + gain = AVSYS_AUDIO_GAIN_EX_RINGTONE; + in = AVSYS_AUDIO_PATH_EX_NONE; + + /* If sound is mute mode, force ringtone path to headset */ + vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sound_play); + if (sound_play) { + /* Normal Ringtone */ + out = AVSYS_AUDIO_PATH_EX_SPK; + option = AVSYS_AUDIO_PATH_OPTION_DUAL_OUT; + } else { + /* Mute Ringtone */ + out = AVSYS_AUDIO_PATH_EX_HEADSET; + } + } else if (g_info.subsession == SUBSESSION_MEDIA) { + gain = AVSYS_AUDIO_GAIN_EX_CALLTONE; + in = AVSYS_AUDIO_PATH_EX_NONE; + } else if (g_info.subsession == SUBSESSION_VOICE) { + gain = (g_info.session == SESSION_VOICECALL)? + AVSYS_AUDIO_GAIN_EX_VOICECALL : AVSYS_AUDIO_GAIN_EX_VIDEOCALL; + + if (out == AVSYS_AUDIO_PATH_EX_HEADSET) { + debug_log ("Fix in path to headsetmic when out path is headset\n"); + in = AVSYS_AUDIO_PATH_EX_HEADSETMIC; + } + } else { + debug_warning ("Unexpected SUBSESSION [%d]\n", g_info.subsession); + } + break; + + case SESSION_FMRADIO: + gain = AVSYS_AUDIO_GAIN_EX_FMRADIO; + in = AVSYS_AUDIO_PATH_EX_FMINPUT; + break; + + default: + debug_warning ("session [%d] is not handled...\n", g_info.session); + break; + } + +#ifdef SEPARATE_SPEAKER_AND_WIRED_ACCESSORY + if (!IS_ACTIVE(MM_SOUND_DEVICE_OUT_BT_A2DP)) { + debug_log ("BT A2DP is not active, Set default sink to ALSA_XX"); + if (out == AVSYS_AUDIO_PATH_EX_HEADSET) { + debug_log ("Set default sink to ALSA_WIRED_ACCESSORY"); + MMSoundMgrPulseSetDefaultSink (DEVICE_API_ALSA, DEVICE_BUS_WIRED); + } else if (out == AVSYS_AUDIO_PATH_EX_SPK) { + debug_log ("Set default sink to ALSA_SPEAKER"); + MMSoundMgrPulseSetDefaultSink (DEVICE_API_ALSA, DEVICE_BUS_BUILTIN); + } + } +#endif + + debug_log ("Trying to set avsys set path gain[%d], out[%d], in[%d], option[%d]\n", gain, out, in, option); + + /* Set Path (GAIN, OUT, IN) */ + if (AVSYS_FAIL(avsys_audio_set_path_ex(gain, out, in, option))) { + debug_error ("avsys_audio_set_path_ex failed\n"); + ret = MM_ERROR_SOUND_INTERNAL; + } + +CURRENT_ACTIVE_END: + /* clean up */ + debug_fleave(); + return ret; +} + +static int __set_sound_path_to_dual (void) +{ + int ret = MM_ERROR_NONE; + + debug_fenter(); + + /* Sound path for ALSA */ + debug_log ("Set path to DUAL.\n"); + if (AVSYS_FAIL(avsys_audio_set_path_ex(AVSYS_AUDIO_GAIN_EX_KEYTONE, + AVSYS_AUDIO_PATH_EX_SPK, AVSYS_AUDIO_PATH_EX_NONE, + AVSYS_AUDIO_PATH_OPTION_DUAL_OUT))) { + debug_error ("avsys_audio_set_path_ex failed\n"); + ret = MM_ERROR_SOUND_INTERNAL; + } + + /* clean up */ + debug_fleave(); + return ret; +} + +static int __set_sound_path_to_speaker (void) +{ + int ret = MM_ERROR_NONE; + + debug_fenter(); + + /* Sound path for ALSA */ + debug_log ("Set path to SPEAKER.\n"); + if(AVSYS_FAIL(avsys_audio_set_path_ex(AVSYS_AUDIO_GAIN_EX_KEYTONE, + AVSYS_AUDIO_PATH_EX_SPK, AVSYS_AUDIO_PATH_EX_NONE, + AVSYS_AUDIO_PATH_OPTION_NONE))) { + debug_error ("avsys_audio_set_path_ex failed\n"); + ret = MM_ERROR_SOUND_INTERNAL; + } + + /* clean up */ + debug_fleave(); + return ret; +} + +static void __select_playback_active_device (void) +{ + if (IS_ACTIVE(MM_SOUND_DEVICE_OUT_ANY)) { + debug_log ("Active device exists. Nothing needed...\n"); + return; + } + + debug_log ("No playback active device, set active based on priority!!\n"); + + /* set active device based on device priority (bt>ear>spk) */ + if (IS_AVAILABLE(MM_SOUND_DEVICE_OUT_BT_A2DP)) { + debug_log ("BT A2DP available, set as active!!\n"); + SET_ACTIVE(MM_SOUND_DEVICE_OUT_BT_A2DP); + } else if (IS_AVAILABLE(MM_SOUND_DEVICE_OUT_WFD)) { + debug_log ("WFD available, set as active!!\n"); + SET_ACTIVE(MM_SOUND_DEVICE_OUT_WFD); + } else if (IS_AVAILABLE(MM_SOUND_DEVICE_OUT_DOCK)) { + debug_log ("DOCK available, set as active!!\n"); + SET_ACTIVE(MM_SOUND_DEVICE_OUT_DOCK); + } else if (IS_AVAILABLE(MM_SOUND_DEVICE_OUT_HDMI)) { + debug_log ("HDMI available, set as active!!\n"); + SET_ACTIVE(MM_SOUND_DEVICE_OUT_HDMI); + } else if (IS_AVAILABLE(MM_SOUND_DEVICE_OUT_USB_AUDIO)) { + debug_log ("USB Audio available, set as active!!\n"); + SET_ACTIVE(MM_SOUND_DEVICE_OUT_USB_AUDIO); + } else if (IS_AVAILABLE(MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY)) { + debug_log ("WIRED available, set as active!!\n"); + SET_ACTIVE(MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY); + } else { + debug_log ("SPEAKER available, set as active!!\n"); + SET_ACTIVE(MM_SOUND_DEVICE_OUT_SPEAKER); + } +} + +static void __select_capture_active_device (void) +{ + if (IS_ACTIVE(MM_SOUND_DEVICE_IN_ANY)) { + debug_log ("Active device exists. Nothing needed...\n"); + return; + } + + debug_log ("No capture active device, set active based on priority!!\n"); + + /* set active device based on device priority (bt>ear>spk) */ + if (IS_AVAILABLE(MM_SOUND_DEVICE_IN_BT_SCO) && IS_COMMUNICATION_SESSION()) { + debug_log ("BT SCO available, set as active!!\n"); + SET_ACTIVE(MM_SOUND_DEVICE_IN_BT_SCO); + } else if (IS_AVAILABLE(MM_SOUND_DEVICE_IN_WIRED_ACCESSORY)) { + debug_log ("WIRED available, set as active!!\n"); + SET_ACTIVE(MM_SOUND_DEVICE_IN_WIRED_ACCESSORY); + } else { + debug_log ("MIC available, set as active!!\n"); + SET_ACTIVE(MM_SOUND_DEVICE_IN_MIC); + } +} + +static void __set_initial_active_device (void) +{ + int type = 0; + bool a2dp = 0, sco = 0; + + /* Set SPK & MIC as default available device */ + /* FIXME : spk & mic can be always on??? */ + SET_AVAILABLE(MM_SOUND_DEVICE_OUT_SPEAKER); + SET_AVAILABLE(MM_SOUND_DEVICE_IN_MIC); + + /* Get wired status and set available status */ + MMSoundMgrHeadsetGetType (&type); + if (type > 0) { + SET_AVAILABLE(MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY); + if (type == EARJACK_WITH_MIC) { + SET_AVAILABLE(MM_SOUND_DEVICE_IN_WIRED_ACCESSORY); + } + } + + /* Get BT status and set available status */ + MMSoundMgrPulseGetInitialBTStatus (&a2dp, &sco); + if (a2dp) { + SET_AVAILABLE(MM_SOUND_DEVICE_OUT_BT_A2DP); + } + if (sco) { + SET_AVAILABLE(MM_SOUND_DEVICE_OUT_BT_SCO); + SET_AVAILABLE(MM_SOUND_DEVICE_IN_BT_SCO); + } + + /* Set Active device based on priority */ + __select_playback_active_device (); + __select_capture_active_device (); + + __set_path_with_notification (NO_NOTI); + + dump_info(); +} + +static void __handle_bt_a2dp_on (void) +{ + int ret = MM_ERROR_NONE; + + /* at this time, pulseaudio default sink is bt sink */ + if (IS_COMMUNICATION_SESSION()) { + debug_log ("Current session is VOICECALL, no auto-activation!!!\n"); + return; + } + + debug_log ("Activate BT_A2DP device\n"); + SET_PLAYBACK_ONLY_ACTIVE(MM_SOUND_DEVICE_OUT_BT_A2DP); + + ret = _mm_sound_mgr_device_active_device_callback(GET_ACTIVE_CAPTURE(), GET_ACTIVE_PLAYBACK()); + if (ret != MM_ERROR_NONE) { + debug_error ("_mm_sound_mgr_device_active_device_callback() failed [%x]\n", ret); + } + + dump_info (); +} + +static void __handle_bt_a2dp_off (void) +{ + if (!IS_ACTIVE(MM_SOUND_DEVICE_OUT_BT_A2DP)) { + debug_msg("MM_SOUND_DEVICE_OUT_BT_A2DP was not active. nothing to do here."); + dump_info (); + return; + } + + /* if bt was active, then do asm pause */ + debug_msg("Do pause here"); + _asm_pause_process (g_info.asm_handle); + + /* set bt device to none */ + debug_msg("Deactivate BT_A2DP device\n"); + UNSET_ACTIVE(MM_SOUND_DEVICE_OUT_BT_A2DP); + + /* activate current available device based on priority */ + __select_playback_active_device(); + + /* Do set path and notify result */ + __set_path_with_notification(DO_NOTI); + + dump_info (); +} + +static void __handle_bt_sco_off (void) +{ + /* If sco is not activated, just return */ + if (!IS_ACTIVE(MM_SOUND_DEVICE_OUT_BT_SCO) && !IS_ACTIVE(MM_SOUND_DEVICE_IN_BT_SCO)) { + debug_msg("BT SCO was not active. nothing to do here."); + dump_info (); + return; + } + + /* set bt device to none */ + debug_msg("Deactivate BT_SCO device\n"); + UNSET_ACTIVE(MM_SOUND_DEVICE_OUT_BT_SCO); + UNSET_ACTIVE(MM_SOUND_DEVICE_IN_BT_SCO); + + /* activate current available device based on priority */ + __select_playback_active_device(); + __select_capture_active_device(); + + /* Do set path and notify result */ + __set_path_with_notification(DO_NOTI); + + dump_info (); +} + +static void __handle_headset_on (int type) +{ + /* at this time, pulseaudio default sink is bt sink */ + /* if fmradio session, do nothing */ + + /* Skip when noti session */ + + /* ToDo : alarm/notification session ???? */ + if (IS_COMMUNICATION_SESSION()) { + debug_log ("Current session is VOICECALL, no auto-activation!!!\n"); + return; + } + + debug_log ("Activate WIRED OUT device\n"); + SET_PLAYBACK_ONLY_ACTIVE(MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY); + if (type == EARJACK_WITH_MIC) { + debug_log ("Activate WIRED IN device\n"); + SET_CAPTURE_ONLY_ACTIVE(MM_SOUND_DEVICE_IN_WIRED_ACCESSORY); + } + + /* Do set path and notify result */ + __set_path_with_notification(DO_NOTI); + + dump_info (); +} + +static void __handle_headset_off (void) +{ + if (!IS_ACTIVE(MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY)) { + debug_msg("MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY was not active. nothing to do here."); + return; + } + + /* if bt was active, then do asm pause */ + debug_msg("Do pause here"); + _asm_pause_process (g_info.asm_handle); + + /* set bt device to none */ + debug_msg("Deactivate WIRED IN/OUT device\n"); + UNSET_ACTIVE(MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY); + UNSET_ACTIVE(MM_SOUND_DEVICE_IN_WIRED_ACCESSORY); + + /* For voicecall session, activation device is up-to application policy */ + if (IS_COMMUNICATION_SESSION()) { + debug_log ("Current session is VOICECALL, no auto-activation!!!\n"); + return; + } + + /* activate current available device based on priority */ + __select_playback_active_device(); + __select_capture_active_device(); + + /* Do set path and notify result */ + __set_path_with_notification(DO_NOTI); + + dump_info (); +} + +static void __handle_dock_on (void) +{ + /* ToDo : alarm/notification session ???? */ + if (IS_COMMUNICATION_SESSION()) { + debug_log ("Current session is VOICECALL, no auto-activation!!!\n"); + return; + } + + debug_log ("Activate DOCK device\n"); + SET_PLAYBACK_ONLY_ACTIVE(MM_SOUND_DEVICE_OUT_DOCK); + + /* Do set path and notify result */ + __set_path_with_notification(DO_NOTI); + + dump_info (); +} + +static void __handle_dock_off (void) +{ + if (!IS_ACTIVE(MM_SOUND_DEVICE_OUT_DOCK)) { + debug_msg("MM_SOUND_DEVICE_OUT_DOCK was not active. nothing to do here."); + return; + } + + /* No PAUSE on Dock off case */ + + /* set DOCK device to none */ + debug_msg("Deactivate DOCK device\n"); + UNSET_ACTIVE(MM_SOUND_DEVICE_OUT_DOCK); + + /* activate current available device based on priority */ + __select_playback_active_device(); + + /* Do set path and notify result */ + __set_path_with_notification(DO_NOTI); + + dump_info (); +} + +static void __handle_hdmi_on (void) +{ + /* ToDo : alarm/notification session ???? */ + if (IS_COMMUNICATION_SESSION()) { + debug_log ("Current session is VOICECALL, no auto-activation!!!\n"); + return; + } + + debug_log ("Activate HDMI device\n"); + SET_PLAYBACK_ONLY_ACTIVE(MM_SOUND_DEVICE_OUT_HDMI); + + /* Do set path and notify result */ + __set_path_with_notification(DO_NOTI); + + dump_info (); +} + +static void __handle_hdmi_off (void) +{ + if (!IS_ACTIVE(MM_SOUND_DEVICE_OUT_HDMI)) { + debug_msg("MM_SOUND_DEVICE_OUT_HDMI was not active. nothing to do here."); + return; + } + + /* if HDMI was active, then do asm pause */ + debug_msg("Do pause here"); + _asm_pause_process (g_info.asm_handle); + + /* set DOCK device to none */ + debug_msg("Deactivate HDMIdevice\n"); + UNSET_ACTIVE(MM_SOUND_DEVICE_OUT_HDMI); + + /* activate current available device based on priority */ + __select_playback_active_device(); + + /* Do set path and notify result */ + __set_path_with_notification(DO_NOTI); + + dump_info (); +} + +static void __handle_wfd_on (void) +{ + /* ToDo : alarm/notification session ???? */ + if (IS_COMMUNICATION_SESSION()) { + debug_log ("Current session is VOICECALL, no auto-activation!!!\n"); + return; + } + + debug_log ("Activate WFD device\n"); + SET_PLAYBACK_ONLY_ACTIVE(MM_SOUND_DEVICE_OUT_WFD); + + /* Do set path and notify result */ + __set_path_with_notification(DO_NOTI); + + dump_info (); +} + +static void __handle_wfd_off (void) +{ + if (!IS_ACTIVE(MM_SOUND_DEVICE_OUT_WFD)) { + debug_msg("MM_SOUND_DEVICE_OUT_WFD was not active. nothing to do here."); + return; + } + + /* if WFD was active, then do asm pause */ + debug_msg("Do pause here"); + _asm_pause_process (g_info.asm_handle); + + /* set WFD device to none */ + debug_msg("Deactivate WFD device\n"); + UNSET_ACTIVE(MM_SOUND_DEVICE_OUT_WFD); + + /* activate current available device based on priority */ + __select_playback_active_device(); + + /* Do set path and notify result */ + __set_path_with_notification(DO_NOTI); + + dump_info (); +} + +static void __handle_usb_audio_on (void) +{ + int ret = MM_ERROR_NONE; + + if (IS_COMMUNICATION_SESSION()) { + debug_log ("Current session is VOICECALL, no auto-activation!!!\n"); + return; + } + + debug_log ("Activate USB Audio device\n"); + SET_PLAYBACK_ONLY_ACTIVE(MM_SOUND_DEVICE_OUT_USB_AUDIO); + + ret = _mm_sound_mgr_device_active_device_callback(GET_ACTIVE_CAPTURE(), GET_ACTIVE_PLAYBACK()); + if (ret != MM_ERROR_NONE) { + debug_error ("_mm_sound_mgr_device_active_device_callback() failed [%x]\n", ret); + } + + dump_info (); +} + +static void __handle_usb_audio_off (void) +{ + if (!IS_ACTIVE(MM_SOUND_DEVICE_OUT_USB_AUDIO)) { + debug_msg("MM_SOUND_DEVICE_OUT_USB_AUDIO was not active. nothing to do here."); + dump_info (); + return; + } + + /* if device was active, then do asm pause */ + debug_msg("Do pause here"); + _asm_pause_process (g_info.asm_handle); + + /* set bt device to none */ + debug_msg("Deactivate USB Audio device\n"); + UNSET_ACTIVE(MM_SOUND_DEVICE_OUT_USB_AUDIO); + + /* activate current available device based on priority */ + __select_playback_active_device(); + + /* Do set path and notify result */ + __set_path_with_notification(DO_NOTI); + + dump_info (); +} + + +/* ------------------------- EXTERNAL FUNCTIONS ------------------------------------*/ +/* DEVICE : Called by mgr_pulse for updating current default_sink_name */ +int MMSoundMgrSessionSetDefaultSink (char *default_sink_name) +{ + LOCK_SESSION(); + + strcpy (g_info.default_sink_name, default_sink_name); + debug_msg ("[SESSION][%s][%d] default sink=[%s]\n", __func__, __LINE__, default_sink_name); + + /* ToDo: do something */ + + UNLOCK_SESSION(); + + return MM_ERROR_NONE; +} + +/* DEVICE : Called by mgr_pulse for bt and mgr_headset for headset */ +int MMSoundMgrSessionSetDeviceAvailable (device_type_t device, int available, int type, char* name) +{ + LOCK_SESSION(); + + debug_msg ("[SESSION] device = %d, available = %d, type = %d, name = %s\n", device, available, type, name); + switch (device) { + case DEVICE_WIRED: + if (available) { + + if (!IS_AVAILABLE(MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY)) { + SET_AVAILABLE(MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY); + if (type == EARJACK_WITH_MIC) { + SET_AVAILABLE(MM_SOUND_DEVICE_IN_WIRED_ACCESSORY); + _mm_sound_mgr_device_available_device_callback( + MM_SOUND_DEVICE_IN_WIRED_ACCESSORY, + MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY, + AVAILABLE); + } else { + _mm_sound_mgr_device_available_device_callback( + MM_SOUND_DEVICE_IN_NONE, + MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY, + AVAILABLE); + } + __handle_headset_on(type); + } else { + debug_log ("Already device [%d] is available...\n", device); + } + + } else { + + if (IS_AVAILABLE(MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY)) { + UNSET_AVAILABLE(MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY); + if (IS_AVAILABLE(MM_SOUND_DEVICE_IN_WIRED_ACCESSORY)) { + UNSET_AVAILABLE(MM_SOUND_DEVICE_IN_WIRED_ACCESSORY); + _mm_sound_mgr_device_available_device_callback( + MM_SOUND_DEVICE_IN_WIRED_ACCESSORY, + MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY, + NOT_AVAILABLE); + + } else { + _mm_sound_mgr_device_available_device_callback( + MM_SOUND_DEVICE_IN_NONE, + MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY, + NOT_AVAILABLE); + } + __handle_headset_off(); + } else { + debug_log ("Already device [%d] is unavailable...\n", device); + } + + } + break; + + case DEVICE_BT_A2DP: + strcpy (g_info.bt_name, (name)? name : ""); + if (available) { + if (!IS_AVAILABLE(MM_SOUND_DEVICE_OUT_BT_A2DP)) { + SET_AVAILABLE(MM_SOUND_DEVICE_OUT_BT_A2DP); + _mm_sound_mgr_device_available_device_callback( + MM_SOUND_DEVICE_IN_NONE, + MM_SOUND_DEVICE_OUT_BT_A2DP, + AVAILABLE); + + __handle_bt_a2dp_on(); + } else { + debug_log ("Already device [%d] is available...\n", device); + } + } else { + if (IS_AVAILABLE(MM_SOUND_DEVICE_OUT_BT_A2DP)) { + UNSET_AVAILABLE(MM_SOUND_DEVICE_OUT_BT_A2DP); + _mm_sound_mgr_device_available_device_callback( + MM_SOUND_DEVICE_IN_NONE, + MM_SOUND_DEVICE_OUT_BT_A2DP, + NOT_AVAILABLE); + + __handle_bt_a2dp_off(); + } else { + debug_log ("Already device [%d] is unavailable...\n", device); + } + } + break; + + case DEVICE_BT_SCO: + if (available) { + if (!IS_AVAILABLE(MM_SOUND_DEVICE_OUT_BT_SCO)) { + SET_AVAILABLE(MM_SOUND_DEVICE_OUT_BT_SCO); + SET_AVAILABLE(MM_SOUND_DEVICE_IN_BT_SCO); + _mm_sound_mgr_device_available_device_callback( + MM_SOUND_DEVICE_IN_BT_SCO, + MM_SOUND_DEVICE_OUT_BT_SCO, + AVAILABLE); + } else { + debug_log ("Already device [%d] is available...\n", device); + } + } else { + if (IS_AVAILABLE(MM_SOUND_DEVICE_OUT_BT_SCO)) { + UNSET_AVAILABLE(MM_SOUND_DEVICE_OUT_BT_SCO); + UNSET_AVAILABLE(MM_SOUND_DEVICE_IN_BT_SCO); + _mm_sound_mgr_device_available_device_callback( + MM_SOUND_DEVICE_IN_BT_SCO, + MM_SOUND_DEVICE_OUT_BT_SCO, + NOT_AVAILABLE); + + __handle_bt_sco_off(); + } else { + debug_log ("Already device [%d] is unavailable...\n", device); + } + } + break; + + case DEVICE_DOCK: + if (available) { + if (!IS_AVAILABLE(MM_SOUND_DEVICE_OUT_DOCK)) { + SET_AVAILABLE(MM_SOUND_DEVICE_OUT_DOCK); + _mm_sound_mgr_device_available_device_callback( + MM_SOUND_DEVICE_IN_NONE, + MM_SOUND_DEVICE_OUT_DOCK, + AVAILABLE); + __handle_dock_on(); + } else { + debug_log ("Already device [%d] is available...\n", device); + } + } else { + if (IS_AVAILABLE(MM_SOUND_DEVICE_OUT_DOCK)) { + UNSET_AVAILABLE(MM_SOUND_DEVICE_OUT_DOCK); + _mm_sound_mgr_device_available_device_callback( + MM_SOUND_DEVICE_IN_NONE, + MM_SOUND_DEVICE_OUT_DOCK, + NOT_AVAILABLE); + + __handle_dock_off(); + } else { + debug_log ("Already device [%d] is unavailable...\n", device); + } + } + break; + + case DEVICE_HDMI: + if (available) { + if (!IS_AVAILABLE(MM_SOUND_DEVICE_OUT_HDMI)) { + SET_AVAILABLE(MM_SOUND_DEVICE_OUT_HDMI); + _mm_sound_mgr_device_available_device_callback( + MM_SOUND_DEVICE_IN_NONE, + MM_SOUND_DEVICE_OUT_HDMI, + AVAILABLE); + __handle_hdmi_on(); + } else { + debug_log ("Already device [%d] is available...\n", device); + } + } else { + if (IS_AVAILABLE(MM_SOUND_DEVICE_OUT_HDMI)) { + UNSET_AVAILABLE(MM_SOUND_DEVICE_OUT_HDMI); + _mm_sound_mgr_device_available_device_callback( + MM_SOUND_DEVICE_IN_NONE, + MM_SOUND_DEVICE_OUT_HDMI, + NOT_AVAILABLE); + + __handle_hdmi_off(); + } else { + debug_log ("Already device [%d] is unavailable...\n", device); + } + } + break; + + case DEVICE_WFD: + if (available) { + if (!IS_AVAILABLE(MM_SOUND_DEVICE_OUT_WFD)) { + SET_AVAILABLE(MM_SOUND_DEVICE_OUT_WFD); + _mm_sound_mgr_device_available_device_callback( + MM_SOUND_DEVICE_IN_NONE, + MM_SOUND_DEVICE_OUT_WFD, + AVAILABLE); + __handle_wfd_on(); + } else { + debug_log ("Already device [%d] is available...\n", device); + } + } else { + if (IS_AVAILABLE(MM_SOUND_DEVICE_OUT_WFD)) { + UNSET_AVAILABLE(MM_SOUND_DEVICE_OUT_WFD); + _mm_sound_mgr_device_available_device_callback( + MM_SOUND_DEVICE_IN_NONE, + MM_SOUND_DEVICE_OUT_WFD, + NOT_AVAILABLE); + + __handle_wfd_off(); + } else { + debug_log ("Already device [%d] is unavailable...\n", device); + } + } + break; + + case DEVICE_USB_AUDIO: + if (available) { + if (!IS_AVAILABLE(MM_SOUND_DEVICE_OUT_USB_AUDIO)) { + SET_AVAILABLE(MM_SOUND_DEVICE_OUT_USB_AUDIO); + _mm_sound_mgr_device_available_device_callback( + MM_SOUND_DEVICE_IN_NONE, + MM_SOUND_DEVICE_OUT_USB_AUDIO, + AVAILABLE); + __handle_usb_audio_on(); + } else { + debug_log ("Already device [%d] is available...\n", device); + } + } else { + if (IS_AVAILABLE(MM_SOUND_DEVICE_OUT_USB_AUDIO)) { + UNSET_AVAILABLE(MM_SOUND_DEVICE_OUT_USB_AUDIO); + _mm_sound_mgr_device_available_device_callback( + MM_SOUND_DEVICE_IN_NONE, + MM_SOUND_DEVICE_OUT_USB_AUDIO, + NOT_AVAILABLE); + + __handle_usb_audio_off(); + } else { + debug_log ("Already device [%d] is unavailable...\n", device); + } + } + break; + + default: + debug_warning ("device [%d] is not handled...\n", device); + break; + } + + UNLOCK_SESSION(); + + return MM_ERROR_NONE; +} + +int MMSoundMgrSessionIsDeviceAvailableNoLock (mm_sound_device_out playback, mm_sound_device_in capture, bool *available) +{ + int ret = MM_ERROR_NONE; + debug_log ("[SESSION][%s][%d] query playback=[0x%X] capture=[0x%X], current available = [0x%X]\n", + __func__, __LINE__, playback, capture, g_info.device_available); + + if (available) { + if (playback == MM_SOUND_DEVICE_OUT_NONE) { + *available = IS_AVAILABLE(capture); + } else if (capture == MM_SOUND_DEVICE_IN_NONE) { + *available = IS_AVAILABLE(playback); + } else { + *available = (IS_AVAILABLE(playback) && IS_AVAILABLE(capture)); + } + debug_log ("[%s][%d] return available = [%d]\n", __func__, __LINE__, *available); + } else { + debug_warning ("Invalid argument!!!\n"); + ret = MM_ERROR_INVALID_ARGUMENT; + } + + return ret; +} + + +int MMSoundMgrSessionIsDeviceAvailable (mm_sound_device_out playback, mm_sound_device_in capture, bool *available) +{ + int ret = MM_ERROR_NONE; + + LOCK_SESSION(); + ret = MMSoundMgrSessionIsDeviceAvailableNoLock (playback, capture, available); + UNLOCK_SESSION(); + + return ret; +} + +int MMSoundMgrSessionGetAvailableDevices (int *playback, int *capture) +{ + if (playback == NULL || capture == NULL) { + debug_error ("Invalid input parameter\n"); + return MM_ERROR_INVALID_ARGUMENT; + } + + LOCK_SESSION(); + + *playback = GET_AVAILABLE_PLAYBACK(); + *capture = GET_AVAILABLE_CAPTURE(); + debug_msg ("[SESSION][%s][%d] return available playback=[0x%X]/capture=[0x%X]\n", __func__, __LINE__, *playback, *capture); + + UNLOCK_SESSION(); + + return MM_ERROR_NONE; +} + +int MMSoundMgrSessionSetDeviceActive (mm_sound_device_out playback, mm_sound_device_in capture) +{ + int ret = MM_ERROR_NONE; + int old_active = g_info.device_active; + + LOCK_SESSION(); + + debug_msg ("[SESSION][%s][%d] playback=[0x%X] capture=[0x%X]\n", __func__, __LINE__, playback, capture); + + /* Check whether device is available */ + if ((playback && !IS_AVAILABLE(playback)) || (capture && !IS_AVAILABLE(capture))) { + debug_warning ("Failed to set active state to unavailable device!!!\n"); + ret = MM_ERROR_INVALID_ARGUMENT; + goto END_SET_DEVICE; + } + + /* Update active state */ + debug_log ("Update active device as request\n"); + if (playback) { + SET_PLAYBACK_ONLY_ACTIVE(playback); + } + if (capture) { + SET_CAPTURE_ONLY_ACTIVE(capture); + } + + /* If there's changes do path set and inform callback */ + if (old_active != g_info.device_active) { + debug_msg ("Changes happens....set path based on current active device and inform callback!!!\n"); + + /* Do set path based on current active state */ + __set_path_with_notification(DO_NOTI); + } else { + debug_msg ("No changes....nothing to do...\n"); + } + +END_SET_DEVICE: + UNLOCK_SESSION(); + return ret; +} + +int MMSoundMgrSessionGetDeviceActive (mm_sound_device_out *playback, mm_sound_device_in *capture) +{ + if (playback == NULL || capture == NULL) { + debug_error ("Invalid input parameter\n"); + return MM_ERROR_INVALID_ARGUMENT; + } + + LOCK_SESSION(); + + *playback = GET_ACTIVE_PLAYBACK(); + *capture = GET_ACTIVE_CAPTURE(); + debug_msg ("[SESSION][%s][%d] return active playback=[0x%X]/capture=[0x%X]\n", __func__, __LINE__, + *playback,*capture); + + UNLOCK_SESSION(); + return MM_ERROR_NONE; +} + +/* SUBSESSION */ +int MMSoundMgrSessionSetSession(session_t session, session_state_t state) +{ + LOCK_SESSION(); + + debug_msg ("[SESSION][%s][%d] session=[%d] state=[%d]\n", __func__, __LINE__, session, state); + + /* Update session */ + if (state) + g_info.session = session; + else + g_info.session = SESSION_MEDIA; + + /* Do action based on new session */ + switch (session) { + case SESSION_MEDIA: + /* ToDo: + start + mic setting + end + */ + break; + + case SESSION_VOICECALL: + case SESSION_VOIP: + __set_playback_route_communication (state); + break; + + case SESSION_FMRADIO: + __set_playback_route_fmradio (state); + break; + + case SESSION_NOTIFICATION: + __set_playback_route_notification (state); + break; + + case SESSION_EMERGENCY: + __set_playback_route_emergency (state); + break; + + default: + debug_warning ("session [%d] is not handled...\n", session); + break; + } + + UNLOCK_SESSION(); + return MM_ERROR_NONE; +} + +int MMSoundMgrSessionGetSession(session_t *session) +{ + if (session == NULL) { + debug_error ("Invalid input parameter\n"); + return MM_ERROR_INVALID_ARGUMENT; + } + + //LOCK_SESSION(); + *session = g_info.session; + //UNLOCK_SESSION(); + + return MM_ERROR_NONE; +} + +/* SUBSESSION */ +int MMSoundMgrSessionSetSubSession(subsession_t subsession) +{ + LOCK_SESSION(); + + if (g_info.subsession == subsession) { + debug_msg ("[SESSION][%s][%d] already subsession is [%d]. skip this!!\n", __func__, __LINE__, subsession); + } else { + g_info.subsession = subsession; + debug_msg ("[SESSION][%s][%d] subsession=[%d]\n", __func__, __LINE__, subsession); + + __set_path_with_notification (NO_NOTI); + } + + UNLOCK_SESSION(); + + return MM_ERROR_NONE; +} + +int MMSoundMgrSessionGetSubSession(subsession_t *subsession) +{ + if (subsession == NULL) { + debug_error ("Invalid input parameter\n"); + return MM_ERROR_INVALID_ARGUMENT; + } + + LOCK_SESSION(); + + *subsession = g_info.subsession; + + UNLOCK_SESSION(); + + return MM_ERROR_NONE; +} + +char* MMSoundMgrSessionGetBtA2DPName () +{ + return g_info.bt_name; +} + +int MMSoundMgrSessionInit(void) +{ + LOCK_SESSION(); + + debug_fenter(); + + memset (&g_info, 0, sizeof (SESSION_INFO_STRUCT)); + + /* FIXME: Initial status should be updated */ + __set_initial_active_device (); + + /* Register for headset unplug */ + if (_asm_register_for_headset (&g_info.asm_handle) == false) { + debug_error ("Failed to register ASM for headset\n"); + } + + debug_fleave(); + + UNLOCK_SESSION(); + return MM_ERROR_NONE; +} + +int MMSoundMgrSessionFini(void) +{ + LOCK_SESSION(); + + debug_fenter(); + + /* Unregister for headset unplug */ + _asm_unregister_for_headset (&g_info.asm_handle); + + debug_fleave(); + + UNLOCK_SESSION(); + + return MM_ERROR_NONE; +} + diff --git a/server/mm_sound_mgr_wfd.c b/server/mm_sound_mgr_wfd.c new file mode 100644 index 0000000..9e76989 --- /dev/null +++ b/server/mm_sound_mgr_wfd.c @@ -0,0 +1,98 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "include/mm_sound_mgr_common.h" +#include "../include/mm_sound_common.h" + +#include +#include + +#include "include/mm_sound_mgr_wfd.h" +#include "include/mm_sound_mgr_session.h" + +/******************************* WFD Code **********************************/ + +#include "mm_sound.h" + +#include +#include + + +/* WFD status value */ +static void _wfd_status_changed_cb(keynode_t* node, void* data) +{ + int wfd_available = 0; + int wfd_status = 0; + + /* Get actual vconf value */ + vconf_get_int(VCONFKEY_WIFI_DIRECT_STATE, &wfd_status); + + debug_msg ("[%s] changed callback called\n", vconf_keynode_get_name(node)); + debug_msg ("WFD : [%s]=[%d]\n", + VCONFKEY_WIFI_DIRECT_STATE, wfd_status); + + wfd_available = (wfd_status == VCONFKEY_WIFI_DIRECT_GROUP_OWNER)? 1 : 0; + + MMSoundMgrSessionSetDeviceAvailable (DEVICE_WFD, wfd_available, 0, NULL); +} + +static int _register_wfd_status(void) +{ + /* set callback for vconf key change */ + int ret = vconf_notify_key_changed(VCONFKEY_WIFI_DIRECT_STATE, _wfd_status_changed_cb, NULL); + debug_msg ("vconf [%s] set ret = [%d]\n", VCONFKEY_WIFI_DIRECT_STATE, ret); + return ret; +} + +int MMSoundMgrWfdInit(void) +{ + debug_enter("\n"); + + if (_register_wfd_status() != 0) { + debug_error ("Registering WFD status failed\n"); + return MM_ERROR_SOUND_INTERNAL; + } + + debug_leave("\n"); + return MM_ERROR_NONE; +} + +int MMSoundMgrWfdFini(void) +{ + debug_enter("\n"); + + debug_leave("\n"); + return MM_ERROR_NONE; +} + diff --git a/server/mm_sound_plugin.c b/server/mm_sound_plugin.c new file mode 100644 index 0000000..689e219 --- /dev/null +++ b/server/mm_sound_plugin.c @@ -0,0 +1,272 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include + +#include +#include +#include +#include +#include + +#include "include/mm_sound_plugin.h" +#include +#include + +static char* __strcatdup(const char *str1, const char *str2); +static int _MMSoundPluginGetList(const char *plugdir ,char ***list); +static int _MMSoundPluginDestroyList(char **list); + +char* MMSoundPluginGetTypeName(int type) +{ + static char *typename[] = { + "ERROR", + "SOUND", + "RUN", + }; + + if (type < MM_SOUND_PLUGIN_TYPE_LAST && type > -1) + return typename[type]; + else + return "Unknown"; /* error condition */ +} + +int MMSoundPluginScan(const char *plugindir, const int type, MMSoundPluginType **pluginlist) +{ + char **list = NULL; + int err = MM_ERROR_NONE; + char *item = NULL; + int index = 0; + MMSoundPluginType plugin[100]; + int plugin_index = 0; + + debug_fenter (); + + debug_msg(" Plugin dir :: %s \n", plugindir); + err = _MMSoundPluginGetList(plugindir, &list); + if (err != MM_ERROR_NONE) + return err; + + while((item = list[index++]) != NULL) { + if(MMSoundPluginOpen(item, &plugin[plugin_index]) != MM_ERROR_NONE) { + debug_warning("%s is not sound plugin\n", item); + continue; + } + if (plugin[plugin_index].type != type) + MMSoundPluginClose(&plugin[plugin_index]); + else + plugin_index++; + } + + _MMSoundPluginDestroyList(list); + + *pluginlist = (MMSoundPluginType*) malloc(sizeof(MMSoundPluginType) * (plugin_index+1)); + if ((*pluginlist) == NULL) { + debug_critical("Memory allocation fail\n"); + /* Occur segmentation fault */ + *pluginlist = (void*)1; + } + + memcpy(*pluginlist, plugin, sizeof(MMSoundPluginType) * (plugin_index+1)); + /* Marking end of array */ + (*pluginlist)[plugin_index].type = MM_SOUND_PLUGIN_TYPE_NONE; + (*pluginlist)[plugin_index].module = NULL; + + debug_fleave (); + + return MM_ERROR_NONE; +} + +int MMSoundPluginRelease(MMSoundPluginType *pluginlist) +{ + int loop = 0; + + debug_fenter (); + + while (pluginlist[loop].type != MM_SOUND_PLUGIN_TYPE_NONE) { + MMSoundPluginClose(&pluginlist[loop++]); + } + + free (pluginlist); + + debug_fleave (); + + return MM_ERROR_NONE; +} + +int MMSoundPluginOpen(char *file, MMSoundPluginType *plugin) +{ + void *pdll = NULL; + int (*func)(void) = NULL; + int t = -1; + + debug_fenter (); + + pdll = dlopen(file, RTLD_NOW|RTLD_GLOBAL); + + if (pdll == NULL) { + debug_error("%s\n", dlerror()); + return MM_ERROR_SOUND_INVALID_FILE; + } + + func = (int (*)(void))dlsym(pdll, "MMSoundGetPluginType"); + if (func == NULL) { + dlclose(pdll); + debug_error("Cannot find symbol : MMSoundGetPluginType\n"); + return MM_ERROR_SOUND_INVALID_FILE; + } + t = func(); + + debug_msg("%s is %s\n", file, + t == MM_SOUND_PLUGIN_TYPE_CODEC ? "CODEC": + t == MM_SOUND_PLUGIN_TYPE_RUN ? "RUN" : "Unknown"); + switch(t) + { + case MM_SOUND_PLUGIN_TYPE_CODEC: + case MM_SOUND_PLUGIN_TYPE_RUN: + plugin->type = t; + plugin->module = pdll; + break; + default: + debug_error("Type is %d\n",t); + dlclose(pdll); + return MM_ERROR_SOUND_INVALID_FILE; + } + + debug_fleave (); + + return MM_ERROR_NONE; +} + +int MMSoundPluginClose(MMSoundPluginType *plugin) +{ + debug_fenter (); + + if(plugin->module) + dlclose(plugin->module); + plugin->type = MM_SOUND_PLUGIN_TYPE_NONE; + plugin->module = NULL; + + debug_fleave (); + return MM_ERROR_NONE; +} + +int MMSoundPluginGetSymbol(MMSoundPluginType *plugin, const char *symbol, void **func) +{ + void *fn = NULL; + + debug_fenter (); + + if (plugin->module == NULL) + return MM_ERROR_SOUND_INVALID_FILE; + fn = dlsym(plugin->module, symbol); + if (fn == NULL) + return MM_ERROR_SOUND_INVALID_FILE; + *func = fn; + + debug_fleave (); + return MM_ERROR_NONE; +} +#define MAX_PATH_SIZE 256 +static int _MMSoundPluginGetList(const char *plugdir ,char ***list) +{ + struct dirent **entry = NULL; + int items; + struct stat finfo; + char **temp; + int tn = 0; + static char curdir[MAX_PATH_SIZE]; + int item_idx; + int ret = MM_ERROR_NONE; + + items = scandir(plugdir, &entry, NULL, alphasort); + debug_msg("Items %d\n", items); + + if (items == -1) + return MM_ERROR_INVALID_ARGUMENT; + + temp = (char **)malloc(sizeof(char *) * (items + 1)); + if(!temp) { + ret = MM_ERROR_OUT_OF_MEMORY; + goto free_entry; + } + memset(temp, 0, sizeof(char*) * (items + 1)); + memset(curdir, '\0', sizeof(curdir)); + if(NULL == getcwd(curdir, sizeof(curdir)-1)) { + if (temp) { + free (temp); + temp = NULL; + } + ret = MM_ERROR_OUT_OF_STORAGE; + goto free_entry; + } + /* FIXME : need to handle error case */ + chdir(plugdir); + + for(item_idx = items; item_idx--; ) { + if(stat(entry[item_idx]->d_name, &finfo) < 0) { + debug_error("Stat error\n"); + if (temp) { + free(temp); + temp = NULL; + } + ret = MM_ERROR_INVALID_ARGUMENT; + goto free_entry; + } + + debug_msg("item %d is %s\n", item_idx, entry[item_idx]->d_name); + + if (S_ISREG(finfo.st_mode)) { + temp[tn++] = __strcatdup(plugdir, entry[item_idx]->d_name); + } + } + *list = temp; +free_entry: + for(item_idx = 0; item_idx < items; item_idx++) { + free(entry[item_idx]); + } + free(entry); + return ret; +} + +static int _MMSoundPluginDestroyList(char **list) +{ + int tn = 0; + while(list[tn]) { + free(list[tn++]); + } + free (list); + return MM_ERROR_NONE; +} + +static char* __strcatdup(const char *str1, const char *str2) +{ + char *dest = NULL; + int len = 0; + len = strlen(str1) + strlen(str2) + 1; + dest = (char*) malloc(len*sizeof(char)); + if (!dest) + return NULL; + strncpy(dest, str1, len-1); + strncat(dest, str2, len-1); + return dest; +} diff --git a/server/mm_sound_server.c b/server/mm_sound_server.c new file mode 100644 index 0000000..5a4c67d --- /dev/null +++ b/server/mm_sound_server.c @@ -0,0 +1,383 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "../include/mm_sound_common.h" +#include "../include/mm_sound_utils.h" +#include "include/mm_sound_thread_pool.h" +#include "include/mm_sound_mgr_run.h" +#include "include/mm_sound_mgr_codec.h" +#include "include/mm_sound_mgr_ipc.h" +#include "include/mm_sound_mgr_pulse.h" +#include "include/mm_sound_mgr_asm.h" +#include "include/mm_sound_mgr_session.h" +#include "include/mm_sound_mgr_device.h" +#include "include/mm_sound_mgr_headset.h" +#include "include/mm_sound_mgr_dock.h" +#include "include/mm_sound_mgr_hdmi.h" +#include "include/mm_sound_mgr_wfd.h" + +#include + +#include + +#define PLUGIN_ENV "MM_SOUND_PLUGIN_PATH" +#define PLUGIN_DIR "/usr/lib/soundplugins/" +#define PLUGIN_MAX 30 + +#define HIBERNATION_SOUND_CHECK_PATH "/tmp/hibernation/sound_ready" +#define USE_SYSTEM_SERVER_PROCESS_MONITORING + +#define ASM_CHECK_INTERVAL 10000 + +#define MAX_PLUGIN_DIR_PATH_LEN 256 + +typedef struct { + char plugdir[MAX_PLUGIN_DIR_PATH_LEN]; + int startserver; + int printlist; + int testmode; +} server_arg; + +static int getOption(int argc, char **argv, server_arg *arg); +static int usgae(int argc, char **argv); + +static struct sigaction sigint_action; /* Backup pointer of SIGINT handler */ +static struct sigaction sigabrt_action; /* Backup pointer of SIGABRT signal handler */ +static struct sigaction sigsegv_action; /* Backup pointer of SIGSEGV fault signal handler */ +static struct sigaction sigterm_action; /* Backup pointer of SIGTERM signal handler */ +static struct sigaction sigsys_action; /* Backup pointer of SIGSYS signal handler */ +static void _exit_handler(int sig); + +GMainLoop *g_mainloop; + +void* pulse_handle; + +gpointer event_loop_thread(gpointer data) +{ + g_mainloop = g_main_loop_new(NULL, TRUE); + if(g_mainloop == NULL) { + debug_error("g_main_loop_new() failed\n"); + } + g_main_loop_run(g_mainloop); + return NULL; +} + +#ifdef USE_HIBERNATION +static void __hibernation_leave_cb() +{ + int volumes[VOLUME_TYPE_MAX] = {0, }; + + MMSoundMgrPulseHandleRegisterMonoAudio(pulse_handle); + MMSoundMgrPulseHandleRegisterBluetoothStatus (pulse_handle); + + _mm_sound_volume_get_values_on_bootup(volumes); + if (avsys_audio_hibernation_reset(volumes)) { + debug_error("Audio reset failed\n"); + } else { + debug_msg("Audio reset success\n"); + } +} +#endif + +static void __wait_for_asm_ready () +{ + int retry_count = 0; + int asm_ready = 0; + while (!asm_ready) { + debug_log("Checking ASM ready....[%d]\n", retry_count++); + if (vconf_get_int(ASM_READY_KEY, &asm_ready)) { + debug_warning("vconf_get_int for ASM_READY_KEY (%s) failed\n", ASM_READY_KEY); + } + usleep (ASM_CHECK_INTERVAL); + } + debug_log("ASM is now ready...clear key!!!\n"); + vconf_unset (ASM_READY_KEY); +} + +int main(int argc, char **argv) +{ + server_arg serveropt; + struct sigaction action; +#ifdef USE_HIBERNATION + int heynotifd = -1; +#endif + int volumes[VOLUME_TYPE_MAX] = {0, }; +#if !defined(USE_SYSTEM_SERVER_PROCESS_MONITORING) + int pid; + int ret; +#endif + + action.sa_handler = _exit_handler; + action.sa_flags = 0; + sigemptyset(&action.sa_mask); + + if (getOption(argc, argv, &serveropt)) + return 1; + + /* Daemon process create */ + if (!serveropt.testmode && serveropt.startserver) { +#if !defined(USE_SYSTEM_SERVER_PROCESS_MONITORING) + daemon(0,0); //chdir to ("/"), and close stdio +#endif + } + + signal(SIGPIPE, SIG_IGN); //ignore SIGPIPE + + _mm_sound_volume_get_values_on_bootup(volumes); + if (avsys_audio_hibernation_reset(volumes)) { + debug_error("Audio reset failed\n"); + } else { + debug_msg("Audio reset success\n"); + } + +#ifdef USE_HIBERNATION + heynotifd = heynoti_init(); + if(heynoti_subscribe(heynotifd, "HIBERNATION_LEAVE", __hibernation_leave_cb, NULL)) { + debug_error("heynoti_subscribe failed...\n"); + } else { + debug_msg("heynoti_subscribe() success\n"); + } + + if(heynoti_attach_handler(heynotifd)) { + debug_error("heynoti_attach_handler() failed\n"); + } else { + debug_msg("heynoti_attach_handler() success\n"); + } +#endif + +#if !defined(USE_SYSTEM_SERVER_PROCESS_MONITORING) + while(1) + { + if ((pid = fork()) < 0) + { + fprintf(stderr, "Sub Fork Error\n"); + return 2; + } + else if(pid == 0) + { + break; + } + else if(pid > 0) + { + wait(&ret); + fprintf(stderr, "Killed by signal [%05X]\n", ret); + fprintf(stderr, "Daemon is run againg\n"); + } + } +#endif + sigaction(SIGABRT, &action, &sigabrt_action); + sigaction(SIGSEGV, &action, &sigsegv_action); + sigaction(SIGTERM, &action, &sigterm_action); + sigaction(SIGSYS, &action, &sigsys_action); + + if (!g_thread_supported ()) + g_thread_init (NULL); + + if(NULL == g_thread_create(event_loop_thread, NULL, FALSE, NULL)) { + fprintf(stderr,"event loop thread create failed\n"); + return 3; + } + + + if (serveropt.startserver || serveropt.printlist) { + MMSoundThreadPoolInit(); + MMSoundMgrRunInit(serveropt.plugdir); + MMSoundMgrCodecInit(serveropt.plugdir); + if (!serveropt.testmode) + MMSoundMgrIpcInit(); + + pulse_handle = MMSoundMgrPulseInit(); + MMSoundMgrASMInit(); + /* Wait for ASM Ready */ + __wait_for_asm_ready(); + _mm_sound_mgr_device_init(); + MMSoundMgrHeadsetInit(); + MMSoundMgrDockInit(); + MMSoundMgrHdmiInit(); + MMSoundMgrWfdInit(); + MMSoundMgrSessionInit(); + } + + if (serveropt.startserver) { + /* Start Run types */ + MMSoundMgrRunRunAll(); + +#ifdef USE_HIBERNATION + /* set hibernation check */ + _mm_sound_check_hibernation (HIBERNATION_SOUND_CHECK_PATH); +#endif + + /* Start Ipc mgr */ + MMSoundMgrIpcReady(); + } + + if (serveropt.startserver || serveropt.printlist) { + MMSoundMgrRunStopAll(); + if (!serveropt.testmode) + MMSoundMgrIpcFini(); + + MMSoundMgrCodecFini(); + MMSoundMgrRunFini(); + MMSoundThreadPoolFini(); + + MMSoundMgrWfdFini(); + MMSoundMgrHdmiFini(); + MMSoundMgrDockFini(); + MMSoundMgrHeadsetFini(); + MMSoundMgrSessionFini(); + _mm_sound_mgr_device_fini(); + MMSoundMgrASMFini(); + MMSoundMgrPulseFini(pulse_handle); + +#ifdef USE_HIBERNATION + if(heynoti_unsubscribe(heynotifd, "HIBERNATION_LEAVE", NULL)) { + debug_error("heynoti_unsubscribe failed..\n"); + } + heynoti_close(heynotifd); +#endif + } + return 0; +} + +static int getOption(int argc, char **argv, server_arg *arg) +{ + int c; + char *plugin_env_dir = NULL; + static struct option long_options[] = { + {"start", 0, 0, 'S'}, + {"list", 0, 0, 'L'}, + {"help", 0, 0, 'H'}, + {"plugdir", 1, 0, 'P'}, + {"testmode", 0, 0, 'T'}, + {0, 0, 0, 0} + }; + memset(arg, 0, sizeof(server_arg)); + + plugin_env_dir = getenv(PLUGIN_ENV); + if (plugin_env_dir) { + strncpy (arg->plugdir, plugin_env_dir, sizeof(arg->plugdir)-1); + } else { + strncpy (arg->plugdir, PLUGIN_DIR, sizeof(arg->plugdir)-1); + } + + arg->testmode = 0; + + while (1) + { + int opt_idx = 0; + + c = getopt_long (argc, argv, "SLHRP:T", long_options, &opt_idx); + if (c == -1) + break; + switch (c) + { + case 'S': /* Start daemon */ + arg->startserver = 1; + break; + case 'L': /* list of plugins */ + arg->printlist = 1; + break; + case 'R': + MMSoundMgrCodecInit(arg->plugdir); + break; + case 'P': /* Custom plugindir */ + strncpy (arg->plugdir, optarg, sizeof(arg->plugdir)-1); + break; + case 'T': /* Test mode */ + arg->testmode = 1; + break; + case 'H': /* help msg */ + default: + return usgae(argc, argv); + } + } + if (argc == 1) + return usgae(argc, argv); + return 0; +} + +//__attribute__ ((destructor)) +static void _exit_handler(int sig) +{ + int ret = MM_ERROR_NONE; + + ret = MMSoundMgrRunStopAll(); + if (ret != MM_ERROR_NONE) { + debug_error("Fail to stop run-plugin\n"); + } else { + debug_log("All run-type plugin stopped\n"); + } + + switch(sig) + { + case SIGINT: + sigaction(SIGINT, &sigint_action, NULL); + debug_error("signal(SIGINT) error"); + break; + case SIGABRT: + sigaction(SIGABRT, &sigabrt_action, NULL); + debug_error("signal(SIGABRT) error"); + break; + case SIGSEGV: + sigaction(SIGSEGV, &sigsegv_action, NULL); + debug_error("signal(SIGSEGV) error"); + break; + case SIGTERM: + sigaction(SIGTERM, &sigterm_action, NULL); + debug_error("signal(SIGTERM) error"); + break; + case SIGSYS: + sigaction(SIGSYS, &sigsys_action, NULL); + debug_error("signal(SIGSYS) error"); + break; + default: + break; + } + raise(sig); +} + +static int usgae(int argc, char **argv) +{ + fprintf(stderr, "Usage: %s [Options]\n", argv[0]); + fprintf(stderr, "\t%-20s: start sound server.\n", "--start,-S"); + fprintf(stderr, "\t%-20s: print plugin list.\n", "--list,-L"); + fprintf(stderr, "\t%-20s: print this message.\n", "--help,-H"); + fprintf(stderr, "\t%-20s: print this message.\n", "--plugdir,-P"); + + return 1; +} + diff --git a/server/mm_sound_thread_pool.c b/server/mm_sound_thread_pool.c new file mode 100644 index 0000000..ebbd251 --- /dev/null +++ b/server/mm_sound_thread_pool.c @@ -0,0 +1,359 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include + +#include +#include +#include + +#define USE_G_THREAD_POOL +#ifdef USE_G_THREAD_POOL +#include +GThreadPool* g_pool; + +#define MAX_UNUSED_THREADS_IN_THREADPOOL 10 + +typedef struct __THREAD_INFO +{ + void (*func)(gpointer data); + void *param; +} THREAD_INFO; + +static void __DummyWork (void* param) +{ + debug_msg ("thread index = %d\n", (int)param); + sleep (1); +} + +static void __ThreadWork(gpointer data, gpointer user_data) +{ + THREAD_INFO* info = (THREAD_INFO*)data; + if (info) { + if (info->func) { + debug_msg ("Calling [%p] with param [%p]\n", info->func, info->param); + info->func (info->param); + } else { + debug_warning ("No func to call....\n"); + } + + /* Info was allocated by MMSoundThreadPoolRun(). + The actual content of info should be freed whether inside func or outside (if handle) */ + debug_msg ("free [%p]\n", info); + free (info); + info = NULL; + } else { + debug_warning ("No valid thread info...Nothing to do...\n"); + } +} + +int MMSoundThreadPoolDump(int fulldump) +{ + if (g_pool == NULL) { + debug_error ("No thread pool initialized....\n"); + return MM_ERROR_SOUND_INTERNAL; + } + + if (fulldump) { + debug_msg ("##### [ThreadPool] max threads=[%d], max unused=[%d], max idle time=[%d]\n", + g_thread_pool_get_max_threads (g_pool), + g_thread_pool_get_max_unused_threads(), + g_thread_pool_get_max_idle_time() ); + } + debug_msg ("***** [ThreadPool] running=[%d], unused=[%d]\n", + g_thread_pool_get_num_threads (g_pool), + g_thread_pool_get_num_unused_threads() ); + + return MM_ERROR_NONE; +} + +int MMSoundThreadPoolInit() +{ + int i=0; + GError* error = NULL; + + /* Create thread pool (non-exclude mode with infinite max threads) */ + g_pool = g_thread_pool_new (__ThreadWork, NULL, -1, FALSE, &error); + if (g_pool == NULL && error != NULL) { + debug_error ("thread pool created failed : %s\n", error->message); + g_error_free (error); + return MM_ERROR_SOUND_INTERNAL; + } + debug_msg ("thread pool created successfully\n"); + + MMSoundThreadPoolDump(TRUE); + + /* Thread pool setting : this will maintain at least 10 unused threads and this will be reused. */ + /* If no unused thread left, new thread will be created, but always maintain 10 unused thread */ + debug_msg ("thread pool set max unused threads to %d\n", MAX_UNUSED_THREADS_IN_THREADPOOL); + g_thread_pool_set_max_unused_threads (MAX_UNUSED_THREADS_IN_THREADPOOL); + + /* To reserve unused threads, let's start some threads for beggining + This dummy thread will be remained unused as soon as it started */ + debug_msg ("run threads to reserve minimum thread\n"); + for (i=0; ifunc = func; + thread_info->param = param; + debug_msg ("alloc thread_info = %p\n", thread_info); + + /* Add thread to queue of thread pool */ + g_thread_pool_push (g_pool, thread_info, &error); + if (error) { + debug_error ("g_thread_pool_push failed : %s\n", error->message); + g_error_free (error); + return MM_ERROR_SOUND_INTERNAL; + } + } else { + debug_error("failed to alloc thread info\n"); + return MM_ERROR_SOUND_INTERNAL; + } + + return MM_ERROR_NONE; +} + +int MMSoundThreadPoolFini(void) +{ + /* If immediate is TRUE, no new task is processed for pool. + Otherwise pool is not freed before the last task is processed. + Note however, that no thread of this pool is interrupted, while processing a task. + Instead at least all still running threads can finish their tasks before the pool is freed. + + If wait_ is TRUE, the functions does not return before all tasks to be processed + (dependent on immediate, whether all or only the currently running) are ready. + Otherwise the function returns immediately. */ + debug_msg ("thread pool will be free\n"); + g_thread_pool_free (g_pool, TRUE, FALSE); + + return MM_ERROR_NONE; +} + +#else // USE_G_THREAD_POOL + +#define THREAD_POOL_MAX 10 + +struct __control_t +{ + pthread_t threadid; + pthread_cond_t condition; + int stopflag; + void *param; + void (*func)(void *); +}; + +static int threadmap[THREAD_POOL_MAX]; +static struct __control_t control[THREAD_POOL_MAX]; + +static pthread_cond_t startcond = PTHREAD_COND_INITIALIZER; +static pthread_mutex_t startsync = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t controlsync = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t funcsync = PTHREAD_MUTEX_INITIALIZER; + +static int __GetEmptyPool(void) +{ + int count = 0; + while ((count < THREAD_POOL_MAX) && threadmap[count] == 1) + ++count; + return count == THREAD_POOL_MAX ? -1 : count; +} + +static void __SetPool(int n) +{ + threadmap[n] = 1; +} + +static void __ResetPool(int n) +{ + threadmap[n] = 0; +} + +static void __InitPool(void) +{ + int count = 0; + for (count = 0; count < THREAD_POOL_MAX; count++) + { + threadmap[count] = 0; + if (pthread_cond_init(&control[count].condition, NULL) != 0) + perror("Make Thread Condition"); + } +} + +static void __DestroyPool(void) +{ + int count = 0; + for (count = 0; count < THREAD_POOL_MAX; count++) + { + if (pthread_cond_destroy(&control[count].condition) != 0) + { + perror("Remove Thread Condition"); + exit(0); + } + } +} + +static void* __ThreadWork(void *param) +{ + int myid = -1; + + myid = (int)param; + + pthread_mutex_lock(&startsync); + pthread_cond_signal(&startcond); + pthread_mutex_unlock(&startsync); + + while(1) + { + pthread_mutex_lock(&controlsync); + pthread_cond_wait(&control[myid].condition, &controlsync); + pthread_mutex_unlock(&controlsync); + + if (control[myid].func != NULL) + control[myid].func(control[myid].param); +/* if (control[myid].param != NULL) + free(control[myid].param);*/ + + control[myid].func = NULL; + control[myid].param = NULL; + pthread_mutex_lock(&startsync); + __ResetPool(myid); + pthread_mutex_unlock(&startsync); + + if (control[myid].stopflag) { + pthread_exit(0); + } + } +} + +int MMSoundThreadPoolDump(void) +{ + int count = 0; + int ret = MM_ERROR_NONE; + + fprintf(stdout, "================================================================================\n"); + fprintf(stdout, " Thread States \n"); + fprintf(stdout, "--------------------------------------------------------------------------------\n"); + for (count = 0; count < THREAD_POOL_MAX; count ++) + { + fprintf(stdout, "Thread %d\n", control[count].threadid); + fprintf(stdout, "Current State is \"%s\"\n", threadmap[count] ? "Running" : "Ready"); + if (threadmap[count]) + { + fprintf(stdout, "Running function address %p\n", control[count].func); + } + else + { + fprintf(stdout, "Threadmap is NULL\n"); + ret = MM_ERROR_SOUND_INTERNAL; + } + } + fprintf(stdout, "================================================================================\n"); + return ret; +} + +int MMSoundThreadPoolInit(void) +{ + volatile int count = 0; + pthread_mutex_lock(&funcsync); + + __InitPool(); + + for (count = 0; count < THREAD_POOL_MAX; count++) + { + control[count].stopflag = 0; + pthread_mutex_lock(&startsync); + if (pthread_create(&control[count].threadid, NULL, __ThreadWork, (void*)count) < 0) + { + perror("Make Thread Fail"); + exit(0); + } + pthread_cond_wait(&startcond, &startsync); + pthread_mutex_unlock(&startsync); + usleep(100); /* Delay for thread init */ + } + pthread_mutex_unlock(&funcsync); + return MM_ERROR_NONE; +} + +int MMSoundThreadPoolRun(void *param, void (*func)(void*)) +{ + int poolnum = -1; + + pthread_mutex_lock(&funcsync); + pthread_mutex_lock(&startsync); + poolnum = __GetEmptyPool(); + if (poolnum < 0) { + pthread_mutex_unlock(&startsync); + pthread_mutex_unlock(&funcsync); + return MM_ERROR_COMMON_NO_FREE_SPACE; + } + __SetPool(poolnum); + pthread_mutex_unlock(&startsync); + control[poolnum].param = param; + control[poolnum].func = func; + pthread_cond_signal(&control[poolnum].condition); + pthread_mutex_unlock(&funcsync); + + return MM_ERROR_NONE; +} + +int MMSoundThreadPoolFini(void) +{ + int count = 0; + + pthread_mutex_lock(&funcsync); + for (count = 0; count < THREAD_POOL_MAX; count++) + { + control[count].stopflag = 1; + pthread_cond_signal(&control[count].condition); + if (pthread_join(control[count].threadid, NULL) < 0) + { + perror("Join Fail"); + exit(0); + } + } + __DestroyPool(); + pthread_mutex_unlock(&funcsync); + + return MM_ERROR_NONE; +} +#endif // USE_G_THREAD_POOL + diff --git a/server/plugin/Makefile.am b/server/plugin/Makefile.am new file mode 100644 index 0000000..d25a171 --- /dev/null +++ b/server/plugin/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = wav keytone tone diff --git a/server/plugin/keytone/Makefile.am b/server/plugin/keytone/Makefile.am new file mode 100644 index 0000000..05d2f7a --- /dev/null +++ b/server/plugin/keytone/Makefile.am @@ -0,0 +1,23 @@ +lib_LTLIBRARIES = libsoundpluginkeytone.la + +#libsoundpluginkeytone_la_SOURCES = mm_sound_plugin_run_keytone.c +#libsoundpluginkeytone_la_SOURCES = mm_sound_plugin_run_keytone_alsa.c +libsoundpluginkeytone_la_SOURCES = mm_sound_plugin_run_key_tone.c + +libsoundpluginkeytone_la_CFLAGS = \ + $(MMCOMMON_CFLAGS) \ + -I$(srcdir)/../../../include \ + -I$(srcdir)/../../include \ + $(MMLOGSVR_CFLAGS) -DMMF_LOG_OWNER=0x020 -DMMF_DEBUG_PREFIX=\"MMF-SOUND\" + +libsoundpluginkeytone_la_LIBADD = $(MMCOMMON_LIBS) \ + $(MMLOGSVR_LIBS) \ + $(srcdir)/../../../common/libmmfsoundcommon.la + +libsoundpluginkeytone_la_CFLAGS += $(AVSYSTEM_CFLAGS) +libsoundpluginkeytone_la_LIBADD += $(AVSYSTEM_LIBS) + +install-exec-hook: + mkdir -p $(DESTDIR)$(libdir)/soundplugins + ln -sf /usr/lib/libsoundpluginkeytone.so $(DESTDIR)$(libdir)/soundplugins/libsoundpluginkeytone.so + diff --git a/server/plugin/keytone/mm_sound_plugin_run_key_tone.c b/server/plugin/keytone/mm_sound_plugin_run_key_tone.c new file mode 100644 index 0000000..d3f8213 --- /dev/null +++ b/server/plugin/keytone/mm_sound_plugin_run_key_tone.c @@ -0,0 +1,580 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + + +#include "../../include/mm_sound_plugin_run.h" +#include "../../include/mm_sound_plugin_codec.h" + +#define TIMEOUT_SEC 2 +#define MAX_BUFFER_SIZE 1920 +#define KEYTONE_PATH "/tmp/keytone" /* Keytone pipe path */ +#define KEYTONE_GROUP 6526 /* Keytone group : assigned by security */ +#define FILE_FULL_PATH 1024 /* File path lenth */ +#define AUDIO_CHANNEL 1 +#define AUDIO_SAMPLERATE 44100 + + +enum { + WAVE_CODE_UNKNOWN = 0, + WAVE_CODE_PCM = 1, + WAVE_CODE_ADPCM = 2, + WAVE_CODE_G711 = 3, + WAVE_CODE_IMA_ADPCM = 17, + WAVE_CODE_G723_ADPCM = 20, + WAVE_CODE_GSM = 49, + WAVE_CODE_G721_ADPCM = 64, + WAVE_CODE_MPEG = 80, +}; + +#define MAKE_FOURCC(a, b, c, d) ((a) | (b) << 8) | ((c) << 16 | ((d) << 24)) +#define RIFF_CHUNK_ID ((unsigned long) MAKE_FOURCC('R', 'I', 'F', 'F')) +#define RIFF_CHUNK_TYPE ((unsigned long) MAKE_FOURCC('W', 'A', 'V', 'E')) +#define FMT_CHUNK_ID ((unsigned long) MAKE_FOURCC('f', 'm', 't', ' ')) +#define DATA_CHUNK_ID ((unsigned long) MAKE_FOURCC('d', 'a', 't', 'a')) + +enum { + RENDER_READY, + RENDER_START, + RENDER_STARTED, + RENDER_STOP, + RENDER_STOPED, + RENDER_STOPED_N_WAIT, + RENDER_COND_TIMED_WAIT, +}; + +typedef struct +{ + pthread_mutex_t sw_lock; + pthread_cond_t sw_cond; + avsys_handle_t handle; + + int period; + int volume_config; + int state; + void *src; +} keytone_info_t; + +typedef struct +{ + char filename[FILE_FULL_PATH]; + int volume_config; +} ipc_type; + +typedef struct +{ + mmsound_codec_info_t *info; + MMSourceType *source; +} buf_param_t; + +static int (*g_thread_pool_func)(void*, void (*)(void*)) = NULL; + +int CreateAudioHandle(); +static int g_CreatedFlag; +static int __MMSoundKeytoneParse(MMSourceType *source, mmsound_codec_info_t *info); +static int _MMSoundKeytoneInit(void); +static int _MMSoundKeytoneFini(void); +static int _MMSoundKeytoneRender(void *param_not_used); +static keytone_info_t g_keytone; +static int stop_flag = 0; + +static +int MMSoundPlugRunKeytoneControlRun(void) +{ + int pre_mask; + int ret = MM_ERROR_NONE; + int fd = -1; + ipc_type data; + int size = 0; + mmsound_codec_info_t info = {0,}; + MMSourceType source = {0,}; + buf_param_t buf_param = {NULL, NULL}; + + debug_enter("\n"); + + /* INIT IPC */ + pre_mask = umask(0); + if (mknod(KEYTONE_PATH,S_IFIFO|0660,0)<0) { + debug_warning ("mknod failed. errno=[%d][%s]\n", errno, strerror(errno)); + } + umask(pre_mask); + + fd = open(KEYTONE_PATH, O_RDWR); + debug_msg("after open file descriptor %d\n", fd); + if (fd == -1) { + debug_warning("Check ipc node %s\n", KEYTONE_PATH); + return MM_ERROR_SOUND_INTERNAL; + } + + /* change access mode so group can use keytone pipe */ + if (fchmod (fd, 0660) == -1) { + debug_warning("Changing keytone access mode is failed. errno=[%d][%s]\n", errno, strerror(errno)); + } + + /* change group due to security request */ + if (fchown (fd, -1, KEYTONE_GROUP) == -1) { + debug_warning("Changing keytone group is failed. errno=[%d][%s]\n", errno, strerror(errno)); + } + + /* Init Audio Handle & internal buffer */ + ret = _MMSoundKeytoneInit(); /* Create two thread and open device */ + if (ret != MM_ERROR_NONE) { + debug_critical("Cannot create keytone\n"); + + } + stop_flag = 1; + source.ptr = NULL; + + debug_msg("[%s] Trace\n", __func__); + size = sizeof(ipc_type); + int once= MMSOUND_TRUE; + g_CreatedFlag = MMSOUND_FALSE; + + while (stop_flag) { + memset(&data, 0, sizeof(ipc_type)); + debug_msg("[%s] The Keytone plugin is running......\n", __func__); + ret = read(fd, (void *)&data, size); + if (ret == -1) { + debug_error("[%s] Fail to read file\n", __func__); + continue; + } + debug_msg("[%s] The Keytone plugin is running......READ returns....\n", __func__); + + pthread_mutex_lock(&g_keytone.sw_lock); + g_keytone.volume_config = data.volume_config; + debug_log("[%s] The volume config is [%x]\n", __func__, g_keytone.volume_config); + + if (g_keytone.state == RENDER_STARTED) { + g_keytone.state = RENDER_STOP; + pthread_cond_wait(&g_keytone.sw_cond, &g_keytone.sw_lock); + } + + ret = mm_source_open_file(data.filename, &source, MM_SOURCE_NOT_DRM_CONTENTS); + if (ret != MM_ERROR_NONE) { + debug_critical("Cannot open files\n"); + pthread_mutex_unlock(&g_keytone.sw_lock); + continue; + } + + + ret = __MMSoundKeytoneParse(&source, &info); + if (ret != MM_ERROR_NONE) { + debug_critical("Fail to parse file\n"); + mm_source_close(&source); + source.ptr = NULL; + pthread_mutex_unlock(&g_keytone.sw_lock); + continue; + } + + if (g_CreatedFlag== MMSOUND_FALSE) { + if(MM_ERROR_NONE != CreateAudioHandle(info)) { + debug_critical("Audio handle creation failed. cannot play keytone\n"); + mm_source_close(&source); + source.ptr = NULL; + pthread_mutex_unlock(&g_keytone.sw_lock); + continue; + } + g_CreatedFlag = MMSOUND_TRUE; + } + + buf_param.info = &info; + buf_param.source = &source; + g_keytone.src = &buf_param; + if (once== MMSOUND_TRUE) { + g_thread_pool_func(NULL, (void*)_MMSoundKeytoneRender); + once= MMSOUND_FALSE; + } + + if (g_keytone.state == RENDER_STOPED_N_WAIT || + g_keytone.state == RENDER_COND_TIMED_WAIT) { + pthread_cond_signal(&g_keytone.sw_cond); + } + + debug_log ("[%s] set state to START, unlock \n", __func__); + g_keytone.state = RENDER_START; + pthread_mutex_unlock(&g_keytone.sw_lock); + + } + + if (fd > -1) + close(fd); + _MMSoundKeytoneFini(); + debug_leave("\n"); + + return MM_ERROR_NONE; +} + +static +int MMSoundPlugRunKeytoneControlStop(void) +{ + stop_flag = 0; /* No impl. Don`t stop */ + return MM_ERROR_NONE; +} + +static +int MMSoundPlugRunKeytoneSetThreadPool(int (*func)(void*, void (*)(void*))) +{ + debug_enter("(func : %p)\n", func); + g_thread_pool_func = func; + debug_leave("\n"); + return MM_ERROR_NONE; +} + +EXPORT_API +int MMSoundPlugRunGetInterface(mmsound_run_interface_t *intf) +{ + debug_enter("\n"); + intf->run = MMSoundPlugRunKeytoneControlRun; + intf->stop = MMSoundPlugRunKeytoneControlStop; + intf->SetThreadPool = MMSoundPlugRunKeytoneSetThreadPool; + debug_leave("\n"); + + return MM_ERROR_NONE; +} + +EXPORT_API +int MMSoundGetPluginType(void) +{ + debug_enter("\n"); + debug_leave("\n"); + return MM_SOUND_PLUGIN_TYPE_RUN; +} + +static int _MMSoundKeytoneInit(void) +{ + + debug_enter("\n"); + + //g_keytone.vol_type = AVSYS_AUDIO_VOLUME_TYPE_SYSTEM; //default value. + + /* Set audio FIXED param */ + + g_keytone.state = RENDER_READY; + if (pthread_mutex_init(&(g_keytone.sw_lock), NULL)) { + debug_error("pthread_mutex_init() failed [%s][%d]\n", __func__, __LINE__); + return MM_ERROR_SOUND_INTERNAL; + } + if (pthread_cond_init(&g_keytone.sw_cond,NULL)) { + debug_error("pthread_cond_init() failed [%s][%d]\n", __func__, __LINE__); + return MM_ERROR_SOUND_INTERNAL; + } + + debug_msg("init\n"); + return MM_ERROR_NONE; +} + +static int _MMSoundKeytoneFini(void) +{ + g_keytone.handle = (avsys_handle_t)-1; + + if (pthread_mutex_destroy(&(g_keytone.sw_lock))) { + debug_error("Fail to destroy mutex\n"); + return MM_ERROR_SOUND_INTERNAL; + } + debug_msg("destroy\n"); + + if (pthread_cond_destroy(&g_keytone.sw_cond)) { + debug_error("Fail to destroy cond\n"); + return MM_ERROR_SOUND_INTERNAL; + } + + return MM_ERROR_NONE; +} + +int CreateAudioHandle(mmsound_codec_info_t info) +{ + int err = MM_ERROR_NONE; + avsys_audio_param_t audio_param; + + memset(&audio_param, 0, sizeof(avsys_audio_param_t)); + + audio_param.mode = AVSYS_AUDIO_MODE_OUTPUT_LOW_LATENCY; + audio_param.channels = info.channels;//AUDIO_CHANNEL; + audio_param.samplerate = info.samplerate;//AUDIO_SAMPLERATE; + audio_param.format = AVSYS_AUDIO_FORMAT_16BIT; + audio_param.vol_type = g_keytone.volume_config; + audio_param.priority = AVSYS_AUDIO_PRIORITY_0; + + + err = avsys_audio_open(&audio_param, &g_keytone.handle, &g_keytone.period); + if (AVSYS_FAIL(err)) { + debug_error("Fail to audio open 0x%08X\n", err); + return MM_ERROR_SOUND_INTERNAL; + } + debug_log("Period size is %d bytes\n", g_keytone.period); + + + //FIXME :: remove dasf buffer size + if (g_keytone.period > MAX_BUFFER_SIZE) { + g_keytone.period = MAX_BUFFER_SIZE; + } + + return err; + +} + +static int _MMSoundKeytoneRender(void *param_not_used) +{ + //static int IsAmpON = MMSOUND_FALSE; //FIXME :: this should be removed + MMSourceType source = {0,}; + mmsound_codec_info_t info = {0,}; + unsigned char *buf = NULL, Outbuf[MAX_BUFFER_SIZE]; + unsigned int size=0; + buf_param_t *param=NULL; + struct timespec timeout; + struct timeval tv; + int stat; + + while(stop_flag) { + pthread_mutex_lock(&g_keytone.sw_lock); + if(g_keytone.state == RENDER_STOPED) { + debug_log ("[%s] set state to STOPPED_N_WAIT and do cond wait\n", __func__); + g_keytone.state = RENDER_STOPED_N_WAIT; + pthread_cond_wait(&g_keytone.sw_cond, &g_keytone.sw_lock); + } + + if(g_keytone.state == RENDER_START) { + //IsAmpON = MMSOUND_TRUE; + + debug_log ("[%s] state is START\n", __func__); + param = (buf_param_t *)g_keytone.src; + + source = *param->source; /* Copy source */ + info = *param->info; + buf = source.ptr+info.doffset; + + size = info.size; + if(buf==NULL) { + size=0; + debug_critical("Ooops.... Not Expected!!!!!!!!\n"); + } + + g_keytone.state = RENDER_STARTED; + } + + pthread_mutex_unlock(&g_keytone.sw_lock); + + + + + while(size && stop_flag) { + pthread_mutex_lock(&g_keytone.sw_lock); + if (g_keytone.state == RENDER_STOP) { + debug_log ("[%s] state is STOP\n", __func__); + pthread_mutex_unlock(&g_keytone.sw_lock); + break; + } + pthread_mutex_unlock(&g_keytone.sw_lock); + + if(sizechunkid != RIFF_CHUNK_ID ||priff->rifftype != RIFF_CHUNK_TYPE) + return MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE; + + if(priff->chunksize != datalen -8) + priff->chunksize = (datalen-8); + + if (priff->chunkid != RIFF_CHUNK_ID ||priff->chunksize != datalen -8 ||priff->rifftype != RIFF_CHUNK_TYPE) { + debug_msg("This contents is not RIFF file\n"); +#if defined(_DEBUG_VERBOS_) + debug_msg("cunkid : %ld, chunksize : %ld, rifftype : 0x%lx\n", priff->chunkid, priff->chunksize, priff->rifftype); + debug_msg("cunkid : %ld, chunksize : %d, rifftype : 0x%lx\n", RIFF_CHUNK_ID, datalen-8, RIFF_CHUNK_TYPE); +#endif + return MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE; + } +#if defined(_DEBUG_VERBOS_) + debug_msg("cunkid : %ld, chunksize : %ld, rifftype : %lx\n", priff->chunkid, priff->chunksize, priff->rifftype); + debug_msg("cunkid : %ld, chunksize : %d, rifftype : %lx\n", RIFF_CHUNK_ID, datalen-8, RIFF_CHUNK_TYPE); +#endif + tSize = sizeof(struct __riff_chunk); + pdata = (struct __data_chunk*)(data+tSize); + + while (pdata->chunkid != FMT_CHUNK_ID && tSize < datalen) { + tSize += (pdata->chunkSize+8); + + if (tSize >= datalen) { + debug_warning("Wave Parsing is Finished : unable to find the Wave Format chunk\n"); + return MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE; + } else { + pdata = (struct __data_chunk*)(data+tSize); + } + } + pwav = (struct __wave_chunk*)(data+tSize); + + if (pwav->chunkid != FMT_CHUNK_ID || + pwav->compression != WAVE_CODE_PCM || /* Only supported PCM */ + pwav->avgbytepersec != pwav->samplerate * pwav->blockkalign || + pwav->blockkalign != (pwav->bitspersample >> 3)*pwav->channels) { + debug_msg("This contents is not supported wave file\n"); +#if defined(_DEBUG_VERBOS_) + debug_msg("chunkid : 0x%lx, comp : 0x%x, av byte/sec : %lu, blockalign : %d\n", pwav->chunkid, pwav->compression, pwav->avgbytepersec, pwav->blockkalign); +#endif + return MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE; + } + + /* Only One data chunk support */ + + tSize += (pwav->chunksize+8); + pdata = (struct __data_chunk *)(data+tSize); + + while (pdata->chunkid != DATA_CHUNK_ID && tSize < datalen) { + tSize += (pdata->chunkSize+8); + if (tSize >= datalen) { + debug_warning("Wave Parsing is Finished : unable to find the data chunk\n"); + return MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE; + } else { + pdata = (struct __data_chunk*)(data+tSize); + } + } + + info->codec = MM_SOUND_SUPPORTED_CODEC_WAVE; + info->channels = pwav->channels; + info->format = pwav->bitspersample; + info->samplerate = pwav->samplerate; + info->doffset = (tSize+8); + info->size = pdata->chunkSize; + debug_msg("info->size:%d\n", info->size); + debug_leave("\n"); + return MM_ERROR_NONE; +} diff --git a/server/plugin/tone/Makefile.am b/server/plugin/tone/Makefile.am new file mode 100644 index 0000000..b061bdd --- /dev/null +++ b/server/plugin/tone/Makefile.am @@ -0,0 +1,21 @@ +lib_LTLIBRARIES = libsoundplugintone.la + +libsoundplugintone_la_SOURCES = mm_sound_plugin_codec_tone.c + +libsoundplugintone_la_CFLAGS = \ + $(MMCOMMON_CFLAGS) \ + -I$(srcdir)/../../../../common/include \ + -I$(srcdir)/../../../include \ + $(MMLOGSVR_CFLAGS) -DMMF_LOG_OWNER=0x020 -DMMF_DEBUG_PREFIX=\"MMF-SOUND\" + +libsoundplugintone_la_LIBADD = \ + $(MMCOMMON_LIBS) \ + $(MMLOGSVR_LIBS) + +libsoundplugintone_la_CFLAGS += $(AVSYSTEM_CFLAGS) +libsoundplugintone_la_LIBADD += $(AVSYSTEM_LIBS) + +install-exec-hook: + mkdir -p $(DESTDIR)$(libdir)/soundplugins + ln -sf /usr/lib/libsoundplugintone.so $(DESTDIR)$(libdir)/soundplugins/libsoundplugintone.so + diff --git a/server/plugin/tone/mm_sound_plugin_codec_tone.c b/server/plugin/tone/mm_sound_plugin_codec_tone.c new file mode 100644 index 0000000..557cf43 --- /dev/null +++ b/server/plugin/tone/mm_sound_plugin_codec_tone.c @@ -0,0 +1,1162 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include + +#include +#include +#include + +#include + +#include "../../include/mm_sound_thread_pool.h" +#include "../../include/mm_sound_plugin_codec.h" +#include +#include +#include + +#include +#include + +/* For Beep */ +#include +#include +#include +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +#ifndef M_PI_2 +#define M_PI_2 1.57079632679489661923 +#endif + +#define SAMPLERATE 44100 + +#define SAMPLE_SIZE 16 +#define CHANNELS 1 +#define MAX_DURATION 100 +#define TONE_COLUMN 6 + +typedef enum { + STATE_NONE = 0, + STATE_READY, + STATE_BEGIN, + STATE_PLAY, + STATE_STOP, +} state_e; + +typedef enum { + CONTROL_STOPPED, + CONTROL_READY, + CONTROL_STARTING, + CONTROL_PLAYING, +} control_e; + +typedef struct { + pthread_mutex_t syncker; + pthread_cond_t cond; + int state; +} tone_control_t; + +typedef struct { + /* AMR Buffer */ + int size; /* sizeof hole amr data */ + + /* Audio Infomations */ + avsys_handle_t audio_handle; + + /* control Informations */ + int repeat_count; + int (*stop_cb)(int); + int cb_param; + int state; + int number; + double volume; + int time; + int pid; + +} tone_info_t; + +typedef enum +{ + LOW_FREQUENCY = 0, + MIDDLE_FREQUENCY, + HIGH_FREQUENCY, + PLAYING_TIME, + LOOP_COUNT, + LOOP_INDEX, +} volume_type_e; + +typedef struct st_tone +{ + float low_frequency; + float middle_frequency; + float high_frequency; + int playingTime; + int loopCnt; + int loopIndx; +} TONE; + + static const int TONE_SEGMENT[][MM_SOUND_TONE_NUM] = + { + {941, 1336, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0},// 0 key: 1336Hz, 941Hz + + {697, 1209, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0},// 1 key: 1209Hz, 697Hz + + {697, 1336, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0},// 2 key: 1336Hz, 697Hz + + {697, 1477, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0}, // 3 key: 1477Hz, 697Hz + + {770, 1209, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0},// 4 key: 1209Hz, 770Hz + + {770, 1336, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0},// 5 key: 1336Hz, 770Hz + + {770, 1477, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0},// 6 key: 1477Hz, 770Hz + + {852, 1209, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0},// 7 key: 1209Hz, 852Hz + + {852, 1336, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0},// 8 key: 1336Hz, 852Hz + + {852, 1477, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0},// 9 key: 1477Hz, 852Hz + + {941, 1209, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0},// * key: 1209Hz, 941Hz + + {941, 1477, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0},// # key: 1477Hz, 941Hz + + {697, 1633, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0},// A key: 1633Hz, 697Hz + + {770, 1633, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0},// B key: 1633Hz, 770Hz + + {852, 1633, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0},// C key: 1633Hz, 852Hz + + {941, 1633, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0}, // D key: 1633Hz, 941Hz + + {425, 0, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Dial tone: CEPT: 425Hz, continuous + + {350, 440, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Dial tone: ANSI (IS-95): 350Hz+440Hz, continuous + + {400, 0, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Dial tone: JAPAN: 400Hz, continuous + + {425, 0, 0, 500, 0, 0, + 0, 0, 0, 500, 0, 0, + -1, -1, -1, -1, 0, 0},//Call supervisory tone, Busy: CEPT: 425Hz, 500ms ON, 500ms OFF... + + {480, 620, 0, 500, 0, 0, + 0, 0, 0, 500, 0, 0, + -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Busy: ANSI (IS-95): 480Hz+620Hz, 500ms ON, 500ms OFF... + + {400, 0, 0, 500, 0, 0, + 0, 0, 0, 500, 0, 0, + -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Busy: JAPAN: 400Hz, 500ms ON, 500ms OFF... + + {425, 0, 0, 200, 0, 0, + 0, 0, 0, 200, 0, 0, + -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Congestion: CEPT, JAPAN: 425Hz, 200ms ON, 200ms OFF + + {480, 620, 0, 250, 0, 0, + 0, 0, 0, 250, 0, 0, + -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Congestion: ANSI (IS-95): 480Hz+620Hz, 250ms ON, 250ms OFF... + + {425, 0, 0, 200, 0, 0, + -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Radio path acknowlegment : CEPT, ANSI: 425Hz, 200ms ON + + {400, 0, 0, 1000, 0, 0, + 0, 0, 0, 2000, 0, 0, + -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Radio path acknowlegment : JAPAN: 400Hz, 1s ON, 2s OFF... + + {425, 0, 0, 200, 0, 0, + 0, 0, 0, 200, 0, 0, + -1, -1, -1, -1, 3, 0}, //Call supervisory tone, Radio path not available: 425Hz, 200ms ON, 200 OFF 3 bursts + + {950, 1400, 1800, 330, 0, 0, + 0, 0, 0, 1000, 0, 0, + -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Error/Special info: 950Hz+1400Hz+1800Hz, 330ms ON, 1s OFF... + + {425, 0, 0, 200, 0, 0, + 0, 0, 0, 600, 0, 0, + 425, 0, 0, 200, 0, 0, + 0, 0, 0, 3000,0, 0, + -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Call Waiting: CEPT, JAPAN: 425Hz, 200ms ON, 600ms OFF, 200ms ON, 3s OFF... + + {440, 0, 0, 300, 0, 0, + 0, 0, 0, 9700, 0, 0, + 440, 0, 0, 100, 0, 0, + 0, 0, 0, 100, 0, 0, + 440, 0, 0, 100, 0, 0, + 0, 0, 0, 9700, 0, 0, + -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Call Waiting: ANSI (IS-95): 440 Hz, 300 ms ON, 9.7 s OFF, (100 ms ON, 100 ms OFF, 100 ms ON, 9.7s OFF ...) + + {425, 0, 0, 1000, 0, 0, + 0, 0, 0, 4000, 0, 0, + -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Ring Tone: CEPT, JAPAN: 425Hz, 1s ON, 4s OFF... + + {440, 480, 0, 2000, 0, 0, + 0, 0, 0, 4000, 0, 0, + -1, -1, -1, -1, 0, 0}, //Call supervisory tone, Ring Tone: ANSI (IS-95): 440Hz + 480Hz, 2s ON, 4s OFF... + + {400, 1200, 0, 35, 0, 0, + -1, -1, -1, -1, 0, 0}, // General beep: 400Hz+1200Hz, 35ms ON + + {1200, 0, 0, 100, 0, 0, + 0, 0, 0, 100, 0, 0, + -1, -1, -1, -1, 2, 0}, //Proprietary tone, positive acknowlegement: 1200Hz, 100ms ON, 100ms OFF 2 bursts + + {300, 400, 500, 400, 0, 0, + -1, -1, -1, -1, 0, 0}, //Proprietary tone, negative acknowlegement: 300Hz+400Hz+500Hz, 400ms ON + + {400, 1200, 0, 200, 0, 0, + -1, -1, -1, -1, 0, 0}, //Proprietary tone, prompt tone: 400Hz+1200Hz, 200ms ON + + {400, 1200, 0, 35, 0, 0, + 0, 0, 0, 200, 0, 0, + 400, 1200, 0, 35, 0, 0, + -1, -1, -1, -1, 0, 0}, //Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + + {440, 0, 0, 250, 0, 0, + 620, 0, 0, 250, 0, 0, + -1, -1, -1, -1, 0, 0}, //Call supervisory tone (IS-95), intercept tone: alternating 440 Hz and 620 Hz tones, each on for 250 ms + + {440, 0, 0, 250, 0, 0, + 620, 0, 0, 250, 0, 0, + -1, -1, -1, -1, 8, 0}, //Call supervisory tone (IS-95), abbreviated intercept: intercept tone limited to 4 seconds + + {480, 620, 0, 250, 0, 0, + 0, 0, 0, 250, 0, 0, + -1, -1, -1, -1, 8, 0 }, //Call supervisory tone (IS-95), abbreviated congestion: congestion tone limited to 4 seconds + + {350, 440, 0, 100, 0, 0, + 0, 0, 0, 100, 0, 0, + -1, -1, -1, -1, 3, 0}, //Call supervisory tone (IS-95), confirm tone: a 350 Hz tone added to a 440 Hz tone repeated 3 times in a 100 ms on, 100 ms off cycle + + {480, 0, 0, 100, 0, 0, + 0, 0, 0, 100, 0, 0, + -1, -1, -1, -1, 4, 0}, //Call supervisory tone (IS-95), pip tone: four bursts of 480 Hz tone (0.1 s on, 0.1 s off). + + { 425, 0, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0}, //425Hz continuous + + {440, 480, 0, 2000, 0, 0, + 0, 0, 0, 4000, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA USA Ringback: 440Hz+480Hz 2s ON, 4000 OFF ... + + {440, 0, 0, 250, 0, 0, + 620, 0, 0, 250, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA Intercept tone: 440Hz 250ms ON, 620Hz 250ms ON ... + + {440, 0, 0, 250, 0, 0, + 620, 0, 0, 250, 0, 0, + -1, -1, -1, -1, 0, 0 }, //CDMA Abbr Intercept tone: 440Hz 250ms ON, 620Hz 250ms ON + + {480, 620, 0, 250, 0, 0, + 0, 0, 0, 250, 0, 0, + -1, -1, -1, -1, 0, 0 }, //CDMA Reorder tone: 480Hz+620Hz 250ms ON, 250ms OFF... + + {480, 620, 0, 250, 0, 0, + 0, 0, 0, 250, 0, 0, + -1, -1, -1, -1, 8, 0}, //CDMA Abbr Reorder tone: 480Hz+620Hz 250ms ON, 250ms OFF repeated for 8 times + + {480, 620, 0, 500, 0, 0, + 0, 0, 0, 500, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA Network Busy tone: 480Hz+620Hz 500ms ON, 500ms OFF continuous + + {350, 440, 0, 100, 0, 0, + 0, 0, 0, 100, 0, 0, + -1, -1, -1, -1, 3, 0}, //CDMA Confirm tone: 350Hz+440Hz 100ms ON, 100ms OFF repeated for 3 times + + {660, 1000, 0, 500, 0, 0, + 0, 0, 0, 100, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA answer tone: silent tone - defintion Frequency 0, 0ms ON, 0ms OFF + + {440, 0, 0, 300, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA Network Callwaiting tone: 440Hz 300ms ON + + {480, 0, 0, 100, 0, 0, + 0, 0, 0, 100, 0, 0, + -1, -1, -1, -1, 4, 0}, //CDMA PIP tone: 480Hz 100ms ON, 100ms OFF repeated for 4 times + + {2090, 0, 0, 32, 0, 0, + 2556, 0, 0, 64, 19, 0, + 2090, 0, 0, 32, 0, 0, + 2556, 0, 0, 48, 0, 0, + 0, 0, 0, 4000, 0, 0, + -1, -1, -1, -1, 0, 0}, //ISDN Call Signal Normal tone: {2091Hz 32ms ON, 2556 64ms ON} 20 times, 2091 32ms ON, 2556 48ms ON, 4s OFF + + {2091, 0, 0, 32, 0, 0, + 2556, 0, 0, 64, 7, 0, + 2091, 0, 0, 32, 0, 0, + 0, 0, 0, 400, 0, 0, + 2091, 0, 0, 32, 0, 0, + 2556, 0, 0, 64, 7, 4, + 2091, 0, 0, 32, 0, 0, + 0, 0, 0, 4000, 0, 0, + -1, -1, -1, -1, 0, 0}, //ISDN Call Signal Intergroup tone: {2091Hz 32ms ON, 2556 64ms ON} 8 times, 2091Hz 32ms ON, 400ms OFF, {2091Hz 32ms ON, 2556Hz 64ms ON} 8times, 2091Hz 32ms ON, 4s OFF. + + {2091, 0, 0, 32, 0, 0, + 2556, 0, 0, 64, 3, 0, + 2091, 0, 0, 32, 0, 0, + 0, 0, 0, 200, 0, 0, + 2091, 0, 0, 32, 0, 0, + 2556, 0, 0, 64, 3, 4, + 2091, 0, 0, 32, 0, 0, + 0, 0, 0, 200, 0, 0, + -1, -1, -1, -1, 0, 0},//ISDN Call Signal SP PRI tone:{2091Hz 32ms ON, 2556 64ms ON} 4 times 2091Hz 16ms ON, 200ms OFF, {2091Hz 32ms ON, 2556Hz 64ms ON} 4 times, 2091Hz 16ms ON, 200ms OFF + + {0, 0, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0}, //ISDN Call sign PAT3 tone: silent tone + + {2091, 0, 0, 32, 0, 0, + 2556, 0, 0, 64, 4, 0, + 2091, 0, 0, 20, 0, 0, + -1, -1, -1, -1, 0, 0}, //ISDN Ping Ring tone: {2091Hz 32ms ON, 2556Hz 64ms ON} 5 times 2091Hz 20ms ON + + {0, 0, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0}, //ISDN Pat5 tone: silent tone + + {0, 0, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0}, //ISDN Pat6 tone: silent tone + + {0, 0, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0}, //ISDN Pat7 tone: silent tone + + {3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 39, 0, + 0, 0, 0, 4000, 0, 0, + -1, -1, -1, -1, 0, 0}, //TONE_CDMA_HIGH_L tone: {3700Hz 25ms, 4000Hz 25ms} 40 times 4000ms OFF, Repeat .... + + {2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 39, 0, + 0, 0, 0, 4000, 0, 0, + -1, -1, -1, -1, 0, 0},//TONE_CDMA_MED_L tone: {2600Hz 25ms, 2900Hz 25ms} 40 times 4000ms OFF, Repeat .... + + {1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 39, 0, + 0, 0, 0,4000, 0, 0, + -1, -1, -1, -1, 0, 0}, //TONE_CDMA_LOW_L tone: {1300Hz 25ms, 1450Hz 25ms} 40 times, 4000ms OFF, Repeat .... + + {3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 15, 0, + 0, 0, 0, 400, 0, 0, + -1, -1, -1, -1, 0, 0},//CDMA HIGH SS tone: {3700Hz 25ms, 4000Hz 25ms} repeat 16 times, 400ms OFF, repeat .... + + {2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 15, 0, + 0, 0, 0,400, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA MED SS tone: {2600Hz 25ms, 2900Hz 25ms} repeat 16 times, 400ms OFF, repeat .... + + {1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 15, 0, + 0, 0, 0, 400, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA LOW SS tone: {1300z 25ms, 1450Hz 25ms} repeat 16 times, 400ms OFF, repeat .... + + {3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 7, 0, + 0, 0, 0, 200, 0, 0, + 3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 7, 3, + 0, 0, 0, 200, 0, 0, + 3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 15, 6, + 0, 0, 0, 4000,0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA HIGH SSL tone: {3700Hz 25ms, 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} repeat 8 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} repeat 16 times, 4000ms OFF, repeat ... + + {2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 7, 0, + 0, 0, 0, 200, 0, 0, + 2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 7, 3, + 0, 0, 0, 200, 0, 0, + 2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 15, 6, + 0, 0, 0, 4000,0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA MED SSL tone: {2600Hz 25ms, 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} repeat 8 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} repeat 16 times, 4000ms OFF, repeat ... + + {1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 7, 0, + 0, 0, 0, 200, 0, 0, + 1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 7, 3, + 0, 0, 0, 200, 0, 0, + 1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 15, 6, + 0, 0, 0, 4000,0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA LOW SSL tone: {1300Hz 25ms, 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} repeat 8 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} repeat 16 times, 4000ms OFF, repeat ... + + {3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 19, 0, + 0, 0, 0, 1000, 0, 0, + 3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 19, 3, + 0, 0, 0, 3000, 0, 0, + -1, -1, -1, -1, 0, 0 },//CDMA HIGH SS2 tone: {3700Hz 25ms, 4000Hz 25ms} 20 times, 1000ms OFF, {3700Hz 25ms, 4000Hz 25ms} 20 times, 3000ms OFF, repeat .... + + {2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 19, 0, + 0, 0, 0, 1000, 0, 0, + 2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 19, 3, + 0, 0, 0, 3000, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA MED SS2 tone: {2600Hz 25ms, 2900Hz 25ms} 20 times, 1000ms OFF, {2600Hz 25ms, 2900Hz 25ms} 20 times, 3000ms OFF, repeat .... + + {1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 19, 0, + 0, 0, 0, 1000, 0, 0, + 1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 19, 3, + 0, 0, 0, 3000, 0, 0, + -1, -1, -1, -1, 0, 0 }, //CDMA LOW SS2 tone: {1300Hz 25ms, 1450Hz 25ms} 20 times, 1000ms OFF, {1300Hz 25ms, 1450Hz 25ms} 20 times, 3000ms OFF, repeat .... + + {3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 9, 0, + 0, 0, 0, 500, 0, 0, + 3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 19, 3, + 0, 0, 0, 500, 0, 0, + 3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 9, 6, + 0, 0, 0, 3000, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA HIGH SLS tone: {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 20 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 3000ms OFF, REPEAT + + {2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 9, 0, + 0, 0, 0, 500, 0, 0, + 2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 19, 3, + 0, 0, 0, 500, 0, 0, + 2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 9, 6, + 0, 0, 0, 3000, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA MED SLS tone: {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 20 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 3000ms OFF, REPEAT + + {1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 9, 0, + 0, 0, 0, 500, 0, 0, + 1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 19, 3, + 0, 0, 0, 500, 0, 0, + 1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 9, 6, + 0, 0, 0, 3000, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA LOW SLS tone: {1300Hz 25ms, 1450Hz 25ms} 10 times, 500ms OFF, {1300Hz 25ms, 1450Hz 25ms} 20 times, 500ms OFF, {1300Hz 25ms, 1450Hz 25ms} 10 times, 3000ms OFF, REPEAT// + + {3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 9, 0, + 0, 0, 0, 500, 0, 0, + 3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 9, 3, + 0, 0, 0, 500, 0, 0, + 3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 9, 6, + 0, 0, 0, 2500, 0, 0, + -1, -1, -1, -1, 0, 0}, ////CDMA HIGH S X4 tone: {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 2500ms OFF, REPEAT.... + + {2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 9, 0, + 0, 0, 0, 500, 0, 0, + 2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 9, 4, + 0, 0, 0, 500, 0, 0, + 2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 9, 6, + 0, 0, 0, 2500, 0, 0, + -1, -1, -1, -1, 0, 0 },//CDMA MED S X4 tone: {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 2500ms OFF, REPEAT.... + + {1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 9, 0, + 0, 0, 0, 500, 0, 0, + 1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 9, 3, + 0, 0, 0, 500, 0, 0, + 1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 9, 6, + 0, 0, 0, 2500, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA LOW S X4 tone: {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 2500ms OFF, REPEAT.... + + {3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 19, 0, + 0, 0, 0, 2000, 0, 0, + -1, -1, -1, -1, 0, 0 },//CDMA HIGH PBX L: {3700Hz 25ms, 4000Hz 25ms}20 times, 2000ms OFF, REPEAT.... + + {2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 19, 0, + 0, 0, 0, 2000, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA MED PBX L: {2600Hz 25ms, 2900Hz 25ms}20 times, 2000ms OFF, REPEAT.... + + {1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 19, 0, + 0, 0, 0, 2000, 0, 0, + -1, -1, -1, -1, 0, 0 },//CDMA LOW PBX L: {1300Hz 25ms,1450Hz 25ms}20 times, 2000ms OFF, REPEAT.... + + {3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 7, 0, + 0, 0, 0, 200, 0, 0, + 3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 7, 3, + 0, 0, 0, 2000, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA HIGH PBX SS tone: {3700Hz 25ms, 4000Hz 25ms} 8 times 200 ms OFF, {3700Hz 25ms 4000Hz 25ms}8 times, 2000ms OFF, REPEAT.... + + {2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 7, 0, + 0, 0, 0, 200, 0, 0, + 2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 7, 3, + 0, 0, 0, 2000, 0, 0, + -1, -1, -1, -1, 0, 0 }, //CDMA MED PBX SS tone: {2600Hz 25ms, 2900Hz 25ms} 8 times 200 ms OFF, {2600Hz 25ms 2900Hz 25ms}8 times, 2000ms OFF, REPEAT.... + + {1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 7, 0, + 0, 0, 0, 200, 0, 0, + 1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 7, 3, + 0, 0, 0, 2000, 0, 0, + -1, -1, -1, -1, 0, 0 },//CDMA LOW PBX SS tone: {1300Hz 25ms, 1450Hz 25ms} 8 times 200 ms OFF, {1300Hz 25ms 1450Hz 25ms}8 times, 2000ms OFF, REPEAT.... + + {3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 7, 0, + 0, 0, 0, 200, 0, 0, + 3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 7, 3, + 0, 0, 0, 200, 0, 0, + 3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 15, 6, + 0, 0, 0, 1000, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA HIGH PBX SSL tone:{3700Hz 25ms, 4000Hz 25ms} 8 times 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 16 times, 1000ms OFF, REPEAT....// + + {2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 7, 0, + 0, 0, 0, 200, 0, 0, + 2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 7, 3, + 0, 0, 0, 200, 0, 0, + 2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 15, 6, + 0, 0, 0, 1000, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA MED PBX SSL tone:{2600Hz 25ms, 2900Hz 25ms} 8 times 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 16 times, 1000ms OFF, REPEAT....// + + {1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 7, 0, + 0, 0, 0, 200, 0, 0, + 1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 7, 3, + 0, 0, 0, 200, 0, 0, + 1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 15, 6, + 0, 0, 0, 1000, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA LOW PBX SSL tone:{1300Hz 25ms, 1450Hz 25ms} 8 times 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 16 times, 1000ms OFF, REPEAT....// + + {3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 15, 0, + 0, 0, 0, 200, 0, 0, + 3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 7, 3, + 0, 0, 0, 1000, 0, 0, + -1, -1, -1, -1, 0, 0 },//CDMA HIGH PBX SLS tone:{3700Hz 25ms, 4000Hz 25ms} 8 times 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 16 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 8 times, 1000ms OFF, REPEAT.... // + + {2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 15, 0, + 0, 0, 0, 200, 0, 0, + 2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 7, 3, + 0, 0, 0, 1000,0, 0, + -1, -1, -1, -1, 0, 0 }, //CDMA HIGH PBX SLS tone:{2600Hz 25ms, 2900Hz 25ms} 8 times 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 16 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 8 times, 1000ms OFF, REPEAT....// + + {1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 15, 0, + 0, 0, 0, 200, 0, 0, + 1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 7, 3, + 0, 0, 0, 1000, 0, 0, + -1, -1, -1, -1, 0, 0 }, //CDMA HIGH PBX SLS tone:{1300Hz 25ms, 1450Hz 25ms} 8 times 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 16 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 8 times, 1000ms OFF, REPEAT....// + + {3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 7, 0, + 0, 0, 0, 200, 0, 0, + 3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 7, 3, + 0, 0, 0, 200, 0, 0, + 3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 7, 6, + 0, 0, 0, 200, 0, 0, + 3700, 0, 0, 25, 0, 0, + 4000, 0, 0, 25, 7, 9, + 0, 0, 0, 800, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA HIGH PBX X S4 tone: {3700Hz 25ms 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms 4000Hz 25ms} 8 times, 800ms OFF, REPEAT... + + {2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 7, 0, + 0, 0, 0, 200, 0, 0, + 2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 7, 3, + 0, 0, 0, 200, 0, 0, + 2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 7, 6, + 0, 0, 0, 200, 0, 0, + 2600, 0, 0, 25, 0, 0, + 2900, 0, 0, 25, 7, 9, + 0, 0, 0, 800, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA MED PBX X S4 tone: {2600Hz 25ms 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms 2900Hz 25ms} 8 times, 800ms OFF, REPEAT... + + {1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 7, 0, + 0, 0, 0, 200, 0, 0, + 1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 7, 3, + 0, 0, 0, 200, 0, 0, + 1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 7, 6, + 0, 0, 0, 200, 0, 0, + 1300, 0, 0, 25, 0, 0, + 1450, 0, 0, 25, 7, 9, + 0, 0, 0, 800, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA LOW PBX X S4 tone: {1300Hz 25ms 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms 1450Hz 25ms} 8 times, 800ms OFF, REPEAT... + + {1109, 0, 0, 62, 0, 0, + 784, 0, 0, 62, 0, 0, + 740, 0, 0, 62, 0, 0, + 622, 0, 0, 62, 0, 0, + 1109, 0, 0, 62, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA Alert Network Lite tone: 1109Hz 62ms ON, 784Hz 62ms ON, 740Hz 62ms ON 622Hz 62ms ON, 1109Hz 62ms ON + + {1245, 0, 0, 62, 0, 0, + 659, 0, 0, 62, 0, 0, + 1245, 0, 0, 62, 0, 0, + 659, 0, 0, 62, 0, 0, + 1245, 0, 0, 62, 0, 0, + 659, 0, 0, 62, 0, 0, + 1245, 0, 0, 62, 0, 0, + -1, -1, -1, -1, 0, 0},//CDMA Alert Auto Redial tone: {1245Hz 62ms ON, 659Hz 62ms ON} 3 times, 1245 62ms ON// + + {1150, 770, 0, 400, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA One Min Beep tone: 1150Hz+770Hz 400ms ON// + + {941, 1477, 0, 120, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA KEYPAD Volume key lite tone: 941Hz+1477Hz 120ms ON + + {587, 0, 0, 375, 0, 0, + 1175, 0, 0, 125, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA PRESSHOLDKEY LITE tone: 587Hz 375ms ON, 1175Hz 125ms ON + + {587, 0, 0, 62, 0, 0, + 784, 0, 0, 62, 0, 0, + 831, 0, 0, 62, 0, 0, + 784, 0, 0, 62, 0, 0, + 1109, 0, 0, 62, 0, 0, + 784, 0, 0, 62, 0, 0, + 831, 0, 0, 62, 0, 0, + 784, 0, 0, 62, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA ALERT INCALL LITE tone: 587Hz 62ms, 784 62ms, 831Hz 62ms, 784Hz 62ms, 1109 62ms, 784Hz 62ms, 831Hz 62ms, 784Hz 62ms + + {941, 0, 0, 125, 0, 0, + 0, 0, 0, 10, 0, 0, + 941, 0, 0, 125, 0, 0, + 0, 0, 0, 10, 0, 0, + 1245, 0, 0, 62, 0, 0, + 0, 0, 0, 10, 0, 0, + 0, 0, 0, 4990, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA EMERGENCY RINGBACK tone: {941Hz 125ms ON, 10ms OFF} 3times 4990ms OFF, REPEAT... + + {1319, 0, 0, 125, 0, 0, + 0, 0, 0, 125, 0, 0, + -1, -1, -1, -1, 3, 0 }, //CDMA ALERT CALL GUARD tone: {1319Hz 125ms ON, 125ms OFF} 3 times + + {1047, 0, 0, 125, 0, 0, + 370, 0, 0, 125, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA SOFT ERROR LITE tone: 1047Hz 125ms ON, 370Hz 125ms + + {1480, 0, 0, 125, 0, 0, + 1397, 0, 0, 125, 0, 0, + 784, 0, 0, 125, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA CALLDROP LITE tone: 1480Hz 125ms, 1397Hz 125ms, 784Hz 125ms// + + {425, 0, 0, 125, 0, 0, + 0, 0, 0, 125, 0, 0, + -1, -1, -1, -1, 0, 0},//CDMA_NETWORK_BUSY_ONE_SHOT tone: 425Hz 500ms ON, 500ms OFF. + + {1150, 770, 0, 400, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA_ABBR_ALERT tone: 1150Hz+770Hz 400ms ON + + {0, 0, 0, -1, 0, 0, + -1, -1, -1, -1, 0, 0}, //CDMA_SIGNAL_OFF - silent tone + }; + +static tone_control_t g_control; +static int (*g_thread_pool_func)(void*, void (*)(void*)) = NULL; + +static int _MMSoundToneInit(void); +static int _MMSoundToneFini(void); +static void _running_tone(void *param); + + + +int* MMSoundPlugCodecToneGetSupportTypes(void) +{ + debug_enter("\n"); + static int suported[2] = {MM_SOUND_SUPPORTED_CODEC_DTMF, 0}; + debug_leave("\n"); + return suported; +} + +int MMSoundPlugCodecToneParse(MMSourceType *source, mmsound_codec_info_t *info) +{ + debug_enter("\n"); + // do nothing + debug_leave("\n"); + return MM_ERROR_NONE; +} + +int MMSoundPlugCodecToneCreate(mmsound_codec_param_t *param, mmsound_codec_info_t *info, MMHandleType *handle) +{ + avsys_audio_param_t audio_param; + tone_info_t *toneInfo; + + int result = AVSYS_STATE_SUCCESS; + + debug_enter("\n"); + + toneInfo = (tone_info_t *)malloc(sizeof(tone_info_t)); + if (toneInfo == NULL) { + debug_error("memory allocation error\n"); + return MM_ERROR_OUT_OF_MEMORY; + } + + memset(toneInfo, 0, sizeof(tone_info_t)); + + toneInfo->state = STATE_READY; + + /* set audio param */ + memset (&audio_param, 0, sizeof(avsys_audio_param_t)); + + /* Set sound player parameter */ + audio_param.samplerate = SAMPLERATE; + audio_param.channels = CHANNELS; + audio_param.format = AVSYS_AUDIO_FORMAT_16BIT; + audio_param.mode = AVSYS_AUDIO_MODE_OUTPUT; + audio_param.vol_type = param->volume_config; + audio_param.priority = AVSYS_AUDIO_PRIORITY_0; + + result = avsys_audio_open(&audio_param, &toneInfo->audio_handle, &toneInfo->size); + if (AVSYS_FAIL(result)) { + debug_error("Device Open Error 0x%x\n", result); + goto Error; + } + debug_log("Create audio_handle is %d\n", toneInfo->audio_handle); + + debug_msg("tone : %d\n", param->tone); + debug_msg("repeat : %d\n", param->repeat_count); + debug_msg("volume config : %x\n", param->volume_config); + debug_msg("callback : %p\n", param->stop_cb); + debug_msg("pid : %d\n", param->pid); + + toneInfo->number = param->tone; + toneInfo->time = param->repeat_count; + toneInfo->stop_cb = param->stop_cb; + toneInfo->cb_param = param->param; + toneInfo->pid = param->pid; + toneInfo->volume = param->volume; + + result = g_thread_pool_func(toneInfo, _running_tone); + if (result != 0) { + debug_error("pthread_create() fail in pcm thread\n"); + result = MM_ERROR_SOUND_INTERNAL; + goto Error; + } + + *handle = (MMHandleType)toneInfo; + + debug_leave("\n"); + return MM_ERROR_NONE; + +Error: + if(toneInfo) { + if(toneInfo->audio_handle) + avsys_audio_close(toneInfo->audio_handle); + + free(toneInfo); + } + + return result; + +} + +int MMSoundPlugCodecToneDestroy(MMHandleType handle) +{ + tone_info_t *toneInfo = (tone_info_t*) handle; + int err = MM_ERROR_NONE; + if (!toneInfo) { + debug_critical("Confirm the hadle (is NULL)\n"); + return MM_ERROR_SOUND_INTERNAL; + } + + debug_enter("(handle %x)\n", handle); + + if (toneInfo) + free (toneInfo); + + debug_leave("\n"); + return err; +} + +static +int MMSoundPlugCodecTonePlay(MMHandleType handle) +{ + tone_info_t *toneInfo = (tone_info_t *) handle; + + debug_enter("(handle %x)\n", handle); + + toneInfo->state = STATE_BEGIN; + debug_msg("sent start signal\n"); + + debug_leave("\n"); + + return MM_ERROR_NONE; +} + +static char* +_create_tone (double *sample, TONE _TONE, double volume, int *toneSize) +{ + short *pbuf; + double i = 0; + double amplitude, f1, f2, f3; + int quota= 0; + float low_frequency = _TONE.low_frequency; + float middle_frequency = _TONE.middle_frequency; + float high_frequency = _TONE.high_frequency; + int sample_size = 0; + + if(sample == NULL) { + debug_error("Sample buffer is not allocated\n"); + return NULL; + } + + /* Create a buffer for the tone */ + if((_TONE.playingTime > MAX_DURATION) || (_TONE.playingTime == -1) ) { + *toneSize = ((MAX_DURATION / 1000.) * SAMPLERATE * SAMPLE_SIZE * CHANNELS) / 8; + } else { + *toneSize = ((_TONE.playingTime / 1000.) * SAMPLERATE * SAMPLE_SIZE * CHANNELS) / 8; + } + *toneSize = ((*toneSize+1)>>1)<<1; + sample_size = (*toneSize) / (SAMPLE_SIZE / 8); + + debug_log("_TONE.playing_time: %d toneSize: %d\n", _TONE.playingTime, *toneSize); + char* buffer = g_malloc (*toneSize); + + if(buffer == NULL) { + debug_error("Buffer is not allocated\n"); + return NULL; + } else { + pbuf = (short*)buffer; + + if(_TONE.low_frequency > 0) { + quota++; + } + if(_TONE.middle_frequency > 0) { + quota++; + } + if(_TONE.high_frequency > 0) { + quota++; + } + + for (i = 0; i < sample_size; i++) { + /* + * We add the fundamental frequencies together. + */ + + f1 = sin (2 * M_PI * low_frequency * ((*sample) / SAMPLERATE)); + f2 = sin (2 * M_PI * middle_frequency * ((*sample) / SAMPLERATE)); + f3 = sin (2 * M_PI * high_frequency * ((*sample) / SAMPLERATE)); + + if(f1 + f2 + f3 != 0) { + amplitude = (f1 + f2 + f3) / quota; + /* Adjust the volume */ + amplitude *= volume; + + /* Make the [-1:1] interval into a [-32767:32767] interval */ + amplitude *= 32767; + } else { + amplitude = 0; + } + + /* Store it in the data buffer */ + *(pbuf++) = (short) amplitude; + + (*sample)++; + } + } + return buffer; +} + +static TONE +_mm_get_tone(int key, int CurIndex) +{ + TONE _TONE; + + _TONE.low_frequency = TONE_SEGMENT[key][CurIndex * TONE_COLUMN + LOW_FREQUENCY]; + _TONE.middle_frequency = TONE_SEGMENT[key][CurIndex * TONE_COLUMN + MIDDLE_FREQUENCY]; + _TONE.high_frequency = TONE_SEGMENT[key][CurIndex * TONE_COLUMN + HIGH_FREQUENCY]; + _TONE.playingTime = TONE_SEGMENT[key][CurIndex * TONE_COLUMN + PLAYING_TIME]; + _TONE.loopCnt = TONE_SEGMENT[key][CurIndex * TONE_COLUMN + LOOP_COUNT]; + _TONE.loopIndx = TONE_SEGMENT[key][CurIndex * TONE_COLUMN + LOOP_INDEX]; + + return _TONE; +} + +static int +_mm_get_waveCnt_PlayingTime(int toneTime, TONE _TONE, int *waveCnt, int *waveRestPlayTime) +{ + int ret = MM_ERROR_NONE; + if(waveCnt == NULL || waveRestPlayTime == NULL) { + debug_error("waveCnt || waveRestPlayTime buffer is NULL\n"); + return MM_ERROR_SOUND_INTERNAL; + } + /*Set wave count and wave playing time*/ + if( _TONE.playingTime == -1) { + *waveCnt = abs(toneTime) /MAX_DURATION; + *waveRestPlayTime = abs(toneTime) % MAX_DURATION; + } else { + *waveCnt = _TONE.playingTime /MAX_DURATION; + *waveRestPlayTime = _TONE.playingTime % MAX_DURATION; + } + return ret; +} + +static int +_mm_get_CurIndex(TONE _TONE, int *CurArrayPlayCnt, int *CurIndex) +{ + int ret = MM_ERROR_NONE; + if(CurArrayPlayCnt == NULL || CurIndex == NULL) { + debug_error("CurArrayPlayCnt || CurIndex buffer is NULL\n"); + return MM_ERROR_SOUND_INTERNAL; + } + + if(_TONE.loopCnt != 0 && *CurArrayPlayCnt <= _TONE.loopCnt) { + (*CurArrayPlayCnt)++; + if(*CurArrayPlayCnt >_TONE.loopCnt) { + (*CurIndex)++; + *CurArrayPlayCnt = 0; + } else { + *CurIndex = _TONE.loopIndx; + } + } else { + (*CurIndex)++; + } + debug_log("CurIndex: %d, CurArrayPlayCnt :%d", *CurIndex, *CurArrayPlayCnt); + return ret; +} + +static void _running_tone(void *param) +{ + int result = AVSYS_STATE_SUCCESS; + char *ptoneBuf = NULL; + char filename[100]; + + if(param == NULL) { + debug_error("param Buffer is not allocated\n"); + return; + } + tone_info_t *toneInfo = (tone_info_t*) param; + int toneKey = 0; + int toneTime =0; + int prePlayingTime = 0; + int duration = 0; + int playingTime = 0; + int toneSize = 0; + int CurWaveIndex = 0; + int numWave = 0; + int waveRestPlayTime = 0; + int CurIndex = 0; + int CurArrayPlayCnt = 0; + + debug_enter("\n"); + double sample = 0; + toneTime = toneInfo->time; + if(toneTime != 0) { + toneKey = toneInfo->number; + debug_msg ("toneKey number = %d\n", toneKey); + + /* Set pid check file */ + snprintf(filename, sizeof(filename), "/proc/%d/cmdline", toneInfo->pid); + + debug_msg("Wait start signal\n"); + while(toneInfo->state == STATE_READY) + usleep(10); + debug_msg("Recv start signal\n"); + toneInfo->state = STATE_PLAY; + } else { + return; + } + + while (1) { + TONE _TONE = _mm_get_tone(toneKey, CurIndex); /*Pop one of Tone Set */ + if(_mm_get_waveCnt_PlayingTime(toneTime, _TONE, &numWave, &waveRestPlayTime) != MM_ERROR_NONE) { + debug_error("_mm_get_waveCnt_PlayingTime return value error\n"); + goto exit; + } + debug_log ("Predefined Tone[%d] Total Play time (ms) : %d, _TONE.playing_time: %d _numWave = %d low_frequency: %0.f, middle_frequency: %0.f, high_frequency: %0.f\n", + CurIndex, toneTime, _TONE.playingTime, numWave, _TONE.low_frequency, _TONE.middle_frequency, _TONE.high_frequency); + + if (_TONE.low_frequency == -1) { /* skip frequency which's value is -1*/ + CurIndex = _TONE.loopIndx; + continue; + } + + /* Write pcm data */ + + for(CurWaveIndex = 0; CurWaveIndex < numWave+1; CurWaveIndex++) { + if(CurWaveIndex == numWave ) { /* play the last tone set*/ + playingTime = waveRestPlayTime; + } else { + playingTime = MAX_DURATION; + } + duration = playingTime; + + if(playingTime == 0) { + break; + } + + if(prePlayingTime + playingTime > toneTime && toneTime != -1) { + playingTime = toneTime - prePlayingTime; + } + + ptoneBuf = _create_tone (&sample, _TONE, toneInfo->volume, &toneSize); + if(ptoneBuf == NULL) { + debug_error("Tone Buffer is not allocated\n"); + goto exit; + } + debug_log ("[TONE] Play.....%dth %dms\n", CurWaveIndex, playingTime); + avsys_audio_write(toneInfo->audio_handle, ptoneBuf, ((toneSize * playingTime /duration + 1)>>1)<<1); + prePlayingTime += playingTime; + debug_log ("previous_sum: %d\n", prePlayingTime); + g_free (ptoneBuf); + ptoneBuf = NULL; + + if(prePlayingTime == toneTime || toneInfo->state != STATE_PLAY) { + debug_log ("Finished.....on Total Playing Time : %d _TONE.playing_time: %d\n", prePlayingTime, _TONE.playingTime); + avsys_audio_drain(toneInfo->audio_handle); + debug_log ("Finished.....quit loop\n"); + goto exit; + } + } + if(_mm_get_CurIndex(_TONE, &CurArrayPlayCnt, &CurIndex) != MM_ERROR_NONE) { + debug_error("_mm_get_CurIndex return value error\n"); + goto exit; + } + + debug_log ("CurIndex: %d previous_sum: %d CurArrayPlayCnt: %d\n", CurIndex, prePlayingTime, CurArrayPlayCnt); + } + +exit : + result = avsys_audio_close(toneInfo->audio_handle); + if(AVSYS_FAIL(result)) { + debug_error("Device Close Error 0x%x\n", result); + } + + pthread_mutex_destroy(&g_control.syncker); + + debug_msg("Play end\n"); + toneInfo->state = STATE_STOP; + + if (toneInfo->stop_cb) + toneInfo->stop_cb(toneInfo->cb_param); + + debug_leave("\n"); +} + +static +int MMSoundPlugCodecToneStop(MMHandleType handle) +{ + tone_info_t *toneInfo = (tone_info_t*) handle; + + debug_enter("(handle %x)\n", handle); + toneInfo->state = STATE_STOP; + debug_msg("sent stop signal\n"); + debug_leave("\n"); + + return MM_ERROR_NONE; +} + +static +int MMSoundPlugCodecToneSetThreadPool(int (*func)(void*, void (*)(void*))) +{ + debug_enter("(func : 0x%x)\n", func); + g_thread_pool_func = func; + debug_leave("\n"); + return MM_ERROR_NONE; +} + +static int _MMSoundToneInit(void) +{ + memset(&g_control, 0, sizeof(tone_control_t)); + pthread_mutex_init(&g_control.syncker, NULL); + return MM_ERROR_NONE; +} + +static int _MMSoundToneFini(void) +{ + pthread_mutex_destroy(&g_control.syncker); + return MM_ERROR_NONE; +} + +EXPORT_API +int MMSoundGetPluginType(void) +{ + debug_enter("\n"); + debug_leave("\n"); + return MM_SOUND_PLUGIN_TYPE_CODEC; +} + +EXPORT_API +int MMSoundPlugCodecGetInterface(mmsound_codec_interface_t *intf) +{ + debug_enter("\n"); + + intf->GetSupportTypes = MMSoundPlugCodecToneGetSupportTypes; + intf->Parse = MMSoundPlugCodecToneParse; + intf->Create = MMSoundPlugCodecToneCreate; + intf->Destroy = MMSoundPlugCodecToneDestroy; + intf->Play = MMSoundPlugCodecTonePlay; + intf->Stop = MMSoundPlugCodecToneStop; + intf->SetThreadPool = MMSoundPlugCodecToneSetThreadPool; + + debug_leave("\n"); + + return MM_ERROR_NONE; +} + diff --git a/server/plugin/wav/Makefile.am b/server/plugin/wav/Makefile.am new file mode 100644 index 0000000..7031ace --- /dev/null +++ b/server/plugin/wav/Makefile.am @@ -0,0 +1,21 @@ +lib_LTLIBRARIES = libsoundpluginwave.la + +libsoundpluginwave_la_SOURCES = mm_sound_plugin_codec_wave.c + +libsoundpluginwave_la_CFLAGS = \ + $(MMCOMMON_CFLAGS) \ + -I$(srcdir)/../../../include \ + -I$(srcdir)/../../include \ + $(MMLOGSVR_CFLAGS) -DMMF_LOG_OWNER=0x020 -DMMF_DEBUG_PREFIX=\"MMF-SOUND\" + +libsoundpluginwave_la_LIBADD = $(MMCOMMON_LIBS) \ + $(MMLOGSVR_LIBS) \ + $(srcdir)/../../../common/libmmfsoundcommon.la + +libsoundpluginwave_la_CFLAGS += $(AVSYSTEM_CFLAGS) +libsoundpluginwave_la_LIBADD += $(AVSYSTEM_LIBS) + +install-exec-hook: + mkdir -p $(DESTDIR)$(libdir)/soundplugins + ln -sf /usr/lib/libsoundpluginwave.so $(DESTDIR)$(libdir)/soundplugins/libsoundpluginwave.so + diff --git a/server/plugin/wav/mm_sound_plugin_codec_wave.c b/server/plugin/wav/mm_sound_plugin_codec_wave.c new file mode 100644 index 0000000..82cb862 --- /dev/null +++ b/server/plugin/wav/mm_sound_plugin_codec_wave.c @@ -0,0 +1,560 @@ +/* + * libmm-sound + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include "../../include/mm_sound.h" +#include "../../include/mm_ipc.h" +#include "../../include/mm_sound_thread_pool.h" +#include "../../include/mm_sound_plugin_codec.h" +#include "../../../include/mm_sound_private.h" + + +#define SAMPLE_COUNT 128 +enum { + WAVE_CODE_UNKNOWN = 0, + WAVE_CODE_PCM = 1, + WAVE_CODE_ADPCM = 2, + WAVE_CODE_G711 = 3, + WAVE_CODE_IMA_ADPCM = 17, + WAVE_CODE_G723_ADPCM = 20, + WAVE_CODE_GSM = 49, + WAVE_CODE_G721_ADPCM = 64, + WAVE_CODE_MPEG = 80, +}; + +#define MAKE_FOURCC(a, b, c, d) ((a) | (b) << 8) | ((c) << 16 | ((d) << 24)) +#define RIFF_CHUNK_ID ((unsigned long) MAKE_FOURCC('R', 'I', 'F', 'F')) +#define RIFF_CHUNK_TYPE ((unsigned long) MAKE_FOURCC('W', 'A', 'V', 'E')) +#define FMT_CHUNK_ID ((unsigned long) MAKE_FOURCC('f', 'm', 't', ' ')) +#define DATA_CHUNK_ID ((unsigned long) MAKE_FOURCC('d', 'a', 't', 'a')) + +enum { + STATE_NONE = 0, + STATE_READY, + STATE_BEGIN, + STATE_PLAY, + STATE_STOP, +}; + +typedef struct +{ + char *ptr_current; + int size; + int transper_size; + avsys_handle_t audio_handle; + int period; + int tone; + int keytone; + int repeat_count; + int (*stop_cb)(int); + int cb_param; + int state; + pthread_mutex_t mutex; + MMSourceType *source; + char buffer[48000 / 1000 * SAMPLE_COUNT * 2 *2];//segmentation fault when above 22.05KHz stereo + int handle_route; +} wave_info_t; + +static void _runing(void *param); + +static int (*g_thread_pool_func)(void*, void (*)(void*)) = NULL; + +int MMSoundPlugCodecWaveSetThreadPool(int (*func)(void*, void (*)(void*))) +{ + debug_enter("(func : %p)\n", func); + g_thread_pool_func = func; + debug_leave("\n"); + return MM_ERROR_NONE; +} + +int* MMSoundPlugCodecWaveGetSupportTypes(void) +{ + debug_enter("\n"); + static int suported[2] = {MM_SOUND_SUPPORTED_CODEC_WAVE, 0}; + debug_leave("\n"); + return suported; +} + +int MMSoundPlugCodecWaveParse(MMSourceType *source, mmsound_codec_info_t *info) +{ + struct __riff_chunk + { + long chunkid; + long chunksize; + long rifftype; + }; + + struct __wave_chunk + { + long chunkid; + long chunksize; + unsigned short compression; + unsigned short channels; + unsigned long samplerate; + unsigned long avgbytepersec; + unsigned short blockkalign; + unsigned short bitspersample; + }; + + struct __data_chunk + { + long chunkid; + long chunkSize; + }; + + struct __riff_chunk *priff = NULL; + struct __wave_chunk *pwav = NULL; + struct __data_chunk *pdata = NULL; +// struct __fmt_chunk *pfmt = NULL; + + int datalen = -1; + char *data = NULL; + unsigned int tSize; + + debug_enter("\n"); + + data = MMSourceGetPtr(source); + debug_msg("[CODEC WAV] source ptr :[%p]\n", data); + + datalen = MMSourceGetCurSize(source); + debug_msg("[CODEC WAV] source size :[0x%08X]\n", datalen); + + priff = (struct __riff_chunk *) data; + + /* Must be checked, Just for wav or not */ + if (priff->chunkid != RIFF_CHUNK_ID ||priff->rifftype != RIFF_CHUNK_TYPE) + return MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE; + + if(priff->chunksize != datalen -8) + priff->chunksize = (datalen-8); + + if (priff->chunkid != RIFF_CHUNK_ID ||priff->chunksize != datalen -8 ||priff->rifftype != RIFF_CHUNK_TYPE) { + debug_msg("[CODEC WAV] This contents is not RIFF file\n"); + debug_msg("[CODEC WAV] cunkid : %ld, chunksize : %ld, rifftype : 0x%lx\n", priff->chunkid, priff->chunksize, priff->rifftype); + //debug_msg("[CODEC WAV] cunkid : %ld, chunksize : %d, rifftype : 0x%lx\n", RIFF_CHUNK_ID, datalen-8, RIFF_CHUNK_TYPE); + return MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE; + } + + debug_msg("[CODEC WAV] cunkid : %ld, chunksize : %ld, rifftype : 0x%lx\n", priff->chunkid, priff->chunksize, priff->rifftype); + //debug_msg("[CODEC WAV] cunkid : %ld, chunksize : %d, rifftype : 0x%lx\n", RIFF_CHUNK_ID, datalen-8, RIFF_CHUNK_TYPE); + + tSize = sizeof(struct __riff_chunk); + pdata = (struct __data_chunk*)(data+tSize); + + while (pdata->chunkid != FMT_CHUNK_ID && tSize < datalen) { + tSize += (pdata->chunkSize+8); + + if (tSize >= datalen) { + debug_warning("[CODEC WAV] Parsing finished : unable to find the Wave Format chunk\n"); + return MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE; + } else { + pdata = (struct __data_chunk*)(data+tSize); + } + } + pwav = (struct __wave_chunk*)(data+tSize); + + if (pwav->chunkid != FMT_CHUNK_ID || + pwav->compression != WAVE_CODE_PCM || /* Only supported PCM */ + pwav->avgbytepersec != pwav->samplerate * pwav->blockkalign || + pwav->blockkalign != (pwav->bitspersample >> 3)*pwav->channels) { + debug_msg("[CODEC WAV] This contents is not supported wave file\n"); + debug_msg("[CODEC WAV] chunkid : 0x%lx, comp : 0x%x, av byte/sec : %lu, blockalign : %d\n", pwav->chunkid, pwav->compression, pwav->avgbytepersec, pwav->blockkalign); + return MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE; + } + + /* Only One data chunk support */ + + tSize += (pwav->chunksize+8); + pdata = (struct __data_chunk *)(data+tSize); + + while (pdata->chunkid != DATA_CHUNK_ID && tSize < datalen) { + tSize += (pdata->chunkSize+8); + if (tSize >= datalen) { + debug_warning("[CODEC WAV] Parsing finished : unable to find the data chunk\n"); + return MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE; + } else { + pdata = (struct __data_chunk*)(data+tSize); + } + } + + info->codec = MM_SOUND_SUPPORTED_CODEC_WAVE; + info->channels = pwav->channels; + info->format = pwav->bitspersample; + info->samplerate = pwav->samplerate; + info->doffset = (tSize+8); + info->size = pdata->chunkSize; + debug_msg("info->size:%d\n", info->size); + + debug_leave("\n"); + return MM_ERROR_NONE; +} + + + +int MMSoundPlugCodecWaveCreate(mmsound_codec_param_t *param, mmsound_codec_info_t *info, MMHandleType *handle) +{ + int ret = MM_ERROR_NONE; + wave_info_t* p = NULL; + + avsys_audio_param_t audio_param; + + static avsys_handle_t keytone_handle = (avsys_handle_t)-1; + MMSourceType *source; + + static int keytone_period = 0; + + debug_enter("\n"); + debug_msg("[CODEC WAV] Local keytone_period : %d\n", keytone_period); + debug_msg("[CODEC WAV] Local keytone_handle : %d\n", (int)keytone_handle); + + debug_msg("[CODEC WAV] Type %s\n", info->codec == MM_SOUND_SUPPORTED_CODEC_WAVE ? "PCM Wave" : "Unknown"); + debug_msg("[CODEC WAV] channels : %d\n", info->channels); + debug_msg("[CODEC WAV] format : %d\n", info->format); + debug_msg("[CODEC WAV] samplerate : %d\n", info->samplerate); + debug_msg("[CODEC WAV] doffset : %d\n", info->doffset); + + debug_msg("[CODEC WAV] priority : %d\n", param->priority); + debug_msg("[CODEC WAV] repeat : %d\n", param->repeat_count); + debug_msg("[CODEC WAV] volume type : %d\n", param->volume); + debug_msg("[CODEC WAV] callback : %p\n", param->stop_cb); + debug_msg("[CODEC WAV] Keytonemode : %08x\n", param->keytone); + debug_msg("[CODEC WAV] handle route : %d\n", param->handle_route); + + source = param->source; + + if (g_thread_pool_func == NULL) { + debug_error("[CODEC WAV] Need thread pool!\n"); + return MM_ERROR_SOUND_INTERNAL; + } + + p = (wave_info_t *) malloc(sizeof(wave_info_t)); + + if (p == NULL) { + debug_error("[CODEC WAV] memory allocation failed\n"); + return MM_ERROR_OUT_OF_MEMORY; + } + + memset(p, 0, sizeof(wave_info_t)); + p->audio_handle = (avsys_handle_t)-1; + + p->ptr_current = MMSourceGetPtr(source) + info->doffset; + + p->size = info->size; + p->transper_size = info->samplerate / 1000 * SAMPLE_COUNT * (info->format >> 3) * info->channels; + + p->tone = param->tone; + p->repeat_count = param ->repeat_count; + p->stop_cb = param->stop_cb; + p->cb_param = param->param; + p->source = source; + // pthread_mutex_init(&p->mutex, NULL); + + debug_msg("[CODEC WAV] transper_size : %d\n", p->transper_size); + debug_msg("[CODEC WAV] size : %d\n", p->size); + + + /* audio param setting */ + memset (&audio_param, 0, sizeof(avsys_audio_param_t)); + audio_param.mode = AVSYS_AUDIO_MODE_OUTPUT; + audio_param.priority = param->priority; + audio_param.vol_type = param->volume_config; + audio_param.channels = info->channels; + audio_param.samplerate = info->samplerate; + if(param->handle_route == MM_SOUND_HANDLE_ROUTE_USING_CURRENT) /* normal, solo */ + audio_param.handle_route = AVSYS_AUDIO_HANDLE_ROUTE_FOLLOWING_POLICY; + else /* loud solo */ + audio_param.handle_route = AVSYS_AUDIO_HANDLE_ROUTE_HANDSET_ONLY; + p->handle_route = param->handle_route; + + switch(info->format) + { + case 8: + audio_param.format = AVSYS_AUDIO_FORMAT_8BIT; + break; + case 16: + audio_param.format = AVSYS_AUDIO_FORMAT_16BIT; + break; + default: + audio_param.format = AVSYS_AUDIO_FORMAT_16BIT; + break; + } + + debug_msg("[CODEC WAV] PARAM mode : [%d]\n", audio_param.mode); + debug_msg("[CODEC WAV] PARAM priority: [%d]\n", audio_param.priority); + debug_msg("[CODEC WAV] PARAM channels : [%d]\n", audio_param.channels); + debug_msg("[CODEC WAV] PARAM samplerate : [%d]\n", audio_param.samplerate); + debug_msg("[CODEC WAV] PARAM format : [%d]\n", audio_param.format); + debug_msg("[CODEC WAV] PARAM volume type : [%x]\n", audio_param.vol_type); + + ret = avsys_audio_open(&audio_param, &p->audio_handle, &p->period); + if (ret != MM_ERROR_NONE) + debug_critical("[CODEC WAV] Can not open audio handle\n"); + + + + if (p->audio_handle == (avsys_handle_t)-1) { + debug_critical("[CODEC WAV] audio_handle is not created !! \n"); + if (p) + free(p); + return MM_ERROR_SOUND_INTERNAL; + } + + + p->state = STATE_READY; + + g_thread_pool_func(p, _runing); + debug_msg("[CODEC WAV] Thread pool start\n"); + *handle = (MMHandleType)p; + + debug_leave("\n"); + + return MM_ERROR_NONE; +} + + +int MMSoundPlugCodecWavePlay(MMHandleType handle) +{ + wave_info_t *p = (wave_info_t *) handle; + + debug_enter("(handle %x)\n", handle); + + if (p->size <= 0) { + debug_error("[CODEC WAV] end of file\n"); + return MM_ERROR_END_OF_FILE; + } + debug_msg("[CODEC WAV] send start signal\n"); + p->state = STATE_BEGIN; + + debug_leave("\n"); + + return MM_ERROR_NONE; + } + + + +static void _runing(void *param) +{ + wave_info_t *p = (wave_info_t*) param; + int nread = 0; + char *org_cur = NULL; + int org_size = 0; + int stop_size; + char *dummy = NULL; + int ret; + + int gain, out, in, option; + int gain_after, out_after, in_after, option_after; + + + debug_enter("[CODEC WAV] (Slot ID %d)\n", p->cb_param); + + /* Set the thread schedule */ + org_cur = p->ptr_current; + org_size = p->size; + + dummy = malloc(p->period); + if(!dummy) { + debug_error("[CODEC WAV] not enough memory"); + return; + } + memset(dummy, 0, p->period); + p->transper_size = p->period; + stop_size = org_size > p->period ? org_size : p->period; + + debug_msg("[CODEC WAV] Wait start signal\n"); + + while(p->state == STATE_READY) + usleep(4); + + /* + * set path here + */ + switch(p->handle_route) + { + case MM_SOUND_HANDLE_ROUTE_SPEAKER: + case MM_SOUND_HANDLE_ROUTE_SPEAKER_NO_RESTORE: + debug_msg("[CODEC WAV] Save backup path\n"); + avsys_audio_get_path_ex(&gain, &out, &in, &option); + + /* if current out is not speaker, then force set path to speaker */ + if (out != AVSYS_AUDIO_PATH_EX_SPK) { + debug_msg("[CODEC WAV] current out is not SPEAKER, set path to SPEAKER now!!!\n"); + avsys_audio_set_path_ex(AVSYS_AUDIO_GAIN_EX_AUDIOPLAYER, AVSYS_AUDIO_PATH_EX_SPK, AVSYS_AUDIO_PATH_EX_NONE, AVSYS_AUDIO_PATH_OPTION_NONE); + } + break; + case MM_SOUND_HANDLE_ROUTE_USING_CURRENT: + default: + break; + } + + debug_msg("[CODEC WAV] Recv start signal\n"); + debug_msg("[CODEC WAV] repeat : %d\n", p->repeat_count); + debug_msg("[CODEC WAV] transper_size : %d\n", p->transper_size); + + if (p->state != STATE_STOP) { + debug_msg("[CODEC WAV] Play start\n"); + p->state = STATE_PLAY; + } else { + debug_warning ("[CODEC WAV] state is already STATE_STOP\n"); + } + + while (((p->repeat_count == -1)?(1):(p->repeat_count--)) && p->state == STATE_PLAY) { + while (p->state == STATE_PLAY && p->size > 0) { + if (p->size >= p->transper_size) { + nread = p->transper_size; + memcpy(p->buffer, p->ptr_current, nread); + avsys_audio_write(p->audio_handle, p->buffer, nread); + p->ptr_current += nread; + p->size -= nread; + debug_msg("[CODEC WAV] Playing, nRead_data : %d Size : %d \n", nread, p->size); + } else { + /* Write remain size */ + nread = p->size; + memcpy(p->buffer, p->ptr_current, nread); + avsys_audio_write(p->audio_handle, p->buffer, nread); + avsys_audio_write(p->audio_handle, dummy, (p->transper_size-nread)); + //avsys_audio_drain(p->audio_handle); + //debug_error("Drain is called\n"); + p->ptr_current += nread; + p->size = 0; + } + } + p->ptr_current = org_cur; + p->size = org_size; + } + + debug_msg("[CODEC WAV] End playing\n"); + p->state = STATE_STOP; + + if (p->audio_handle == (avsys_handle_t)-1) { + usleep(200000); + debug_warning("[CODEC WAV] audio already unrealize !!\n"); + } else { + //usleep(75000); + + if(AVSYS_FAIL(avsys_audio_drain(p->audio_handle))) + { + debug_error("avsys_audio_drain() failed\n"); + } + + /* + * Restore path here + */ + if (p->handle_route == MM_SOUND_HANDLE_ROUTE_SPEAKER) { + avsys_audio_get_path_ex(&gain_after, &out_after, &in_after, &option_after); + + /* If current path is not same as before playing sound, restore the sound path */ + if (gain_after != gain || out_after != out || in_after != in || option_after != option) { + + debug_msg("[CODEC WAV] Restore path to previous one\n"); + ret = avsys_audio_set_path_ex(gain, out, in, option); + if(AVSYS_FAIL(ret)) { + debug_error("[CODEC WAV] Can not restore sound path\n"); + } + } + } + + ret = avsys_audio_close(p->audio_handle); + if (AVSYS_FAIL(ret)) { + debug_critical("[CODEC WAV] Can not close audio handle\n"); + } + + } + p->audio_handle = (avsys_handle_t)-1; + + p->state = STATE_NONE; + + free(dummy); + if (p->stop_cb) + { + debug_msg("[CODEC WAV] Play is finished, Now start callback\n"); + p->stop_cb(p->cb_param); + } + debug_leave("\n"); +} + + +int MMSoundPlugCodecWaveStop(MMHandleType handle) +{ + wave_info_t *p = (wave_info_t*) handle; + if (!p) { + debug_error("The handle is NULL\n"); + return MM_ERROR_SOUND_INTERNAL; + } + debug_msg("[CODEC WAV] Current state is state %d\n", p->state); + debug_msg("[CODEC WAV] Handle 0x%08X stop requested\n", handle); + + p->state = STATE_STOP; + + return MM_ERROR_NONE; +} + +int MMSoundPlugCodecWaveDestroy(MMHandleType handle) +{ + wave_info_t *p = (wave_info_t*) handle; + + if(!p) { + debug_warning("Can not destroy handle :: handle is null\n"); + return MM_ERROR_SOUND_INVALID_POINTER; + } + + if(p->source) { + mm_source_close(p->source); + free(p->source); + } + + free(p); + + return MM_ERROR_NONE; +} + +EXPORT_API +int MMSoundGetPluginType(void) +{ + return MM_SOUND_PLUGIN_TYPE_CODEC; +} + +EXPORT_API +int MMSoundPlugCodecGetInterface(mmsound_codec_interface_t *intf) +{ + intf->GetSupportTypes = MMSoundPlugCodecWaveGetSupportTypes; + intf->Parse = MMSoundPlugCodecWaveParse; + intf->Create = MMSoundPlugCodecWaveCreate; + intf->Destroy = MMSoundPlugCodecWaveDestroy; + intf->Play = MMSoundPlugCodecWavePlay; + intf->Stop = MMSoundPlugCodecWaveStop; + intf->SetThreadPool = MMSoundPlugCodecWaveSetThreadPool; + + return MM_ERROR_NONE; +} + + diff --git a/server/sounds/dock.wav b/server/sounds/dock.wav new file mode 100755 index 0000000000000000000000000000000000000000..033d81514f53dc19d15f30a93e1ccec8157cfc44 GIT binary patch literal 151246 zcmeF26mO-EsH2|HOTB z+3<$NTAV$5X7--%d}h?Ze*L}-gF(jk9M^Z=($x|Q1OkDA)#nZbvUdU$0)tQ>b7rod zc@_N4|Nr`bZGl|KW=JI@8@eCrf=+_{fOUnJ!?O{$5NXI8$TZX~R2KR_bT;NTCLMbf z%f%hS#c_-9fADPxhX`6iYvM-YDq;s>i13K8lprGf#;?PR@$YccaUtwcYzp=XAaIk2lxCUid}mROn4#wW&q$NI!xL|aGyi=;)ag_F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OMW!qivdgp_;-RXe4YVA%3Y&&4f0WSCAR9&d8HKev4ear*yv+dC1 z4%+_!J?#!B9d`Q3k3Q-6(;lXut^4H|R~&ovwrz*`q4zuZ*yFYxbCUPmVatB|Z{4rk zwRpge^SA2cBkzC6wquU))dwGU+%YE|b>y*rQG0D=dvQc>?eL=xKH}JeR9LT2MeV)+ z!FmDrJLO@gZa?gd(;s*E8QULw$`iKkx7fRO#&HimdfP##o_6Ne{T6F$dmni4QO9os zeXlI`Zr!h*x3Nb*@r>bf9#pt&p7kAQy+WEMxMUQDu3J=+fRP9J6h$|{n|FWP#xB={|8FCd!_&Y literal 0 HcmV?d00001 diff --git a/testsuite/01_Touch.wav b/testsuite/01_Touch.wav new file mode 100755 index 0000000000000000000000000000000000000000..35b69518598a7b3a3825fd09ad9e267e97eea420 GIT binary patch literal 42412 zcmeIb2~<^O_b`6$1PCI73@QjBGKq?S1I~&QPB?{QW~P?qo2ixQYg$^SS*clO<&?8V znmFQwikgawq96hah^Po6GAZ2g+xu?!`hJMy1s!x-_=SDOi)9Ce|-q#Sq zci8&rj^NmkxcA~Op7u)`m)a?3W8vuMfl8hIH;oUr7#b4L$vLum!2V(Wqaw#Wd%fiw z4<`h@t{wC4Ym1_%_HW*!sQv9=51$OzZnn#eNoD;XwYc+B%B2hG3FU`7>`VB4-H!WP zH*C4K<=@-Z?sWg7Fs?k_<4n(_&Z!Tw-3r%Mc2(T1-@j3`@5R<%b)4L@d(`vj8L#~~ zX4v@OUjOv<+;JJBKOT8{$c=uNyC=1O68x4=j9ZEAbkm*k#RW_5y54-_(xTHl;!EOY z{V{OYqU{0Ox^26#{rE1&JqPxGeRRQ@_me_Xw`Q+Q#`YfbWz5IJ-3G7d`>5Nn_Ibgle7xOT)Gw2+R9-A}%YBgc z)|EYHD~?AUy87qZ*dx0-@ATR^ZI^4T`=3(|W*wWJSd!E~by#+OK~j01vAkZ6%fG!> z1WDmrx{T;uGGNNkUq;R!r5O`Arg+rI*QN~%AC%T-YB#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3hy{ft8RbA9t(Lw9t-J)3-A4k81R`*h9UP=bf;m4Kt2)Wfhfg35%IwJ@tQCM1U`vK za)maFvm(TVB#iH7O#9P`N;G@PH!vo8P!gKne?I + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include + +#define debug_log(msg, args...) fprintf(stderr, msg, ##args) +#define avsys_info(msg, args...) fprintf(stderr, msg, ##args) +#define MAX_STRING_LEN 256 +#define MAX_PATH_LEN 1024 +#define MIN_TONE_PLAY_TIME 300 +#include "../include/mm_sound.h" +#include "../include/mm_sound_private.h" + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#define POWERON_FILE "/usr/share/keysound/poweron.wav" + + +// For testsuite status +enum { + CURRENT_STATUS_MAINMENU = 0, + CURRENT_STATUS_FILENAME = 1, + CURRENT_STATUS_POSITION = 2, + CURRENT_STATUS_DIRNAME = 3, +}; + +int g_menu_state = CURRENT_STATUS_MAINMENU; + +volume_type_t g_volume_type = VOLUME_TYPE_MEDIA; +unsigned int g_volume_value; + +GIOChannel *stdin_channel; +char g_file_name[MAX_STRING_LEN]; +char g_dir_name[MAX_PATH_LEN]; + + +GMainLoop* g_loop; + +// Function +static void interpret (char *buf); +gboolean timeout_menu_display(void *data); +gboolean timeout_quit_program(void *data); +gboolean input (GIOChannel *channel); + +static char* __get_playback_device_str (mm_sound_device_out out); +static char* __get_capture_device_str (mm_sound_device_in in); +static char* __get_route_str (mm_sound_route route); +static int __mm_sound_foreach_available_route_cb (mm_sound_route route, void *user_data); +static void __mm_sound_available_route_changed_cb (mm_sound_route route, bool available, void *user_data); +static void __mm_sound_active_device_changed_cb (mm_sound_device_in device_in, mm_sound_device_out device_out, void *user_data); + +void mycallback(void *data) +{ + char *str = (char*)data; + if(data != NULL) + debug_log("mycallback called (user data:%s)\n", str); + else + debug_log("mycallback called (no user data)\n"); +} +volatile char test_callback_done; +void test_callback(void *data) +{ + debug_log("test_callback is called\n"); + test_callback_done = 1; +} +void quit_program() +{ + g_main_loop_quit(g_loop); +} + +static void displaymenu() +{ + if (g_menu_state == CURRENT_STATUS_MAINMENU) { + g_print("==================================================================\n"); + g_print(" Sound Path APIs\n"); + g_print("==================================================================\n"); + g_print("1. Play speaker \t"); + g_print("2. Play headset \n"); + g_print("3. (blank) \n"); + g_print("4. Rec. with mic \t"); + g_print("5. (blank) \t"); + g_print("6. Call receiver \n"); + g_print("7. Call end \t"); + g_print("8. VT call speaker \t"); + g_print("9. VT call end \n"); + g_print("==================================================================\n"); + g_print(" Sound Play APIs\n"); + g_print("==================================================================\n"); + g_print("k : Key Sound \t"); + g_print("a : play sound \t"); + g_print("A : play loud solo\n"); + g_print("c : play sound ex \t"); + g_print("F : Play DTMF \t"); + g_print("b : Play directory\n"); + g_print("s : Stop play \n"); + g_print("==================================================================\n"); + g_print(" Volume APIs\n"); + g_print("==================================================================\n"); + g_print("q : Get media \t"); + g_print("w : Inc. media \t"); + g_print("e : Dec. media \n"); + g_print("r : Get system \t"); + g_print("t : Inc. system \t"); + g_print("y : Dec. system \n"); + g_print("==================================================================\n"); + g_print(" Audio route APIs\n"); + g_print("==================================================================\n"); + g_print("u : Foreach Available Routes \t"); + g_print("i : Get Active Devices \n"); + g_print("o : Add Available Routes Callback \t"); + g_print("O : Remove Available Routes Callback \n"); + g_print("p : Add Active Route Callback\t"); + g_print("P : Remove Active Route Callback \n"); + g_print("{ : Get BT A2DP Status\n"); + g_print("==================================================================\n"); + g_print(" Session Test\n"); + g_print("==================================================================\n"); + g_print("z : Call start \t"); + g_print("Z : VideoCall start \t"); + g_print("v : Call/VideoCall end \t"); + g_print("V : Current Status \n"); + g_print("==================================================================\n"); + g_print("d : Input Directory \t"); + g_print("f : Input File name \t"); + g_print("x : Exit Program \n"); + g_print("==================================================================\n"); + g_print(" Input command >>>>>>>> "); + } + else if (g_menu_state == CURRENT_STATUS_FILENAME) { + g_print(">>>>Input file name to play : "); + } + else if (g_menu_state == CURRENT_STATUS_DIRNAME) { + g_print(">>>>Input directory which contain audio files : "); + } + else { + g_print("**** Unknown status.\n"); + quit_program(); + } +} + +gboolean timeout_menu_display(void* data) +{ + displaymenu(); + return FALSE; +} + +gboolean timeout_quit_program(void* data) +{ + quit_program(); + return FALSE; +} + +gboolean input (GIOChannel *channel) +{ + char buf[MAX_STRING_LEN + 3]; + gsize read; + + g_io_channel_read(channel, buf, MAX_STRING_LEN, &read); + buf[read] = '\0'; + g_strstrip(buf); + interpret (buf); + return TRUE; +} + + +static void input_filename(char *filename) +{ + strncpy(g_file_name, filename, sizeof(g_file_name)-1); + g_print("\nThe input filename is '%s' \n\n",g_file_name); + +} + +static void input_dirname(char *dirname) +{ + strncpy(g_dir_name, dirname, sizeof(g_dir_name)-1); + g_print("\nThe input directory is '%s' \n\n",g_dir_name); +} + +static char* __get_playback_device_str (mm_sound_device_out out) +{ + switch (out) { + case MM_SOUND_DEVICE_OUT_SPEAKER: return "SPEAKER"; + case MM_SOUND_DEVICE_OUT_RECEIVER: return "RECEIVER"; + case MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY: return "HEADSET"; + case MM_SOUND_DEVICE_OUT_BT_SCO: return "BTSCO"; + case MM_SOUND_DEVICE_OUT_BT_A2DP: return "BTA2DP"; + case MM_SOUND_DEVICE_OUT_DOCK: return "DOCK"; + case MM_SOUND_DEVICE_OUT_HDMI: return "HDMI"; + case MM_SOUND_DEVICE_OUT_WFD: return "WFD"; + case MM_SOUND_DEVICE_OUT_USB_AUDIO: return "USB"; + default: return NULL; + } +} + +static char* __get_capture_device_str (mm_sound_device_in in) +{ + switch (in) { + case MM_SOUND_DEVICE_IN_MIC: return "MAINMIC"; + case MM_SOUND_DEVICE_IN_WIRED_ACCESSORY: return "HEADSET"; + case MM_SOUND_DEVICE_IN_BT_SCO: return "BTMIC"; + default: return NULL; + } +} + +static char* __get_route_str (mm_sound_route route) +{ + switch (route) { + case MM_SOUND_ROUTE_OUT_SPEAKER: return "OUT_SPEAKER"; + case MM_SOUND_ROUTE_OUT_WIRED_ACCESSORY: return "OUT_WIRED_ACCESSORY"; + case MM_SOUND_ROUTE_OUT_BLUETOOTH: return "OUT_BLUETOOTH"; + case MM_SOUND_ROUTE_OUT_DOCK: return "OUT_DOCK"; + case MM_SOUND_ROUTE_OUT_HDMI: return "OUT_HDMI"; + case MM_SOUND_ROUTE_OUT_WFD: return "OUT_WFD"; + case MM_SOUND_ROUTE_OUT_USB_AUDIO: return "OUT_USB"; + case MM_SOUND_ROUTE_IN_MIC: return "IN_MIC"; + case MM_SOUND_ROUTE_IN_WIRED_ACCESSORY: return "IN_WIRED_ACCESSORY"; + case MM_SOUND_ROUTE_IN_MIC_OUT_RECEIVER: return "IN_MIC_OUT_RECEIVER"; + case MM_SOUND_ROUTE_IN_MIC_OUT_SPEAKER: return "IN_MIC_OUT_SPEAKER"; + case MM_SOUND_ROUTE_IN_MIC_OUT_HEADPHONE: return "IN_MIC_OUT_HEADPHONE"; + case MM_SOUND_ROUTE_INOUT_HEADSET: return "INOUT_HEADSET"; + case MM_SOUND_ROUTE_INOUT_BLUETOOTH: return "INOUT_BLUETOOTH"; + default: return NULL; + } +} + +static int __mm_sound_foreach_available_route_cb (mm_sound_route route, void *user_data) +{ + g_print ("[%s] route = [0x%08x][%s]\n", __func__, route, __get_route_str(route)); + return true; +} + +static void __mm_sound_available_route_changed_cb (mm_sound_route route, bool available, void *user_data) +{ + g_print ("[%s] route = [%d][0x%08x][%s]\n", __func__, available, route, __get_route_str(route)); +} + +static void __mm_sound_active_device_changed_cb (mm_sound_device_in device_in, mm_sound_device_out device_out, void *user_data) +{ + g_print ("[%s] in[0x%08x][%s], out[0x%08x][%s]\n", __func__, + device_in, __get_capture_device_str(device_in), device_out, __get_playback_device_str(device_out)); +} + +static void interpret (char *cmd) +{ + int ret=0; + static int handle = -1; + MMSoundPlayParam soundparam = {0,}; + + switch (g_menu_state) + { + case CURRENT_STATUS_MAINMENU: + if(strncmp(cmd, "k", 1) == 0) + { + ret = mm_sound_play_keysound(POWERON_FILE, 8); + if(ret < 0) + debug_log("keysound play failed with 0x%x\n", ret); + } + else if(strncmp(cmd, "q", 1) == 0) + {//get media volume + unsigned int value = 100; + ret = mm_sound_volume_get_value(g_volume_type, &value); + if(ret < 0) { + debug_log("mm_sound_volume_get_value 0x%x\n", ret); + } + else{ + g_print("*** MEDIA VOLUME : %u ***\n", value); + g_volume_value = value; + } + } + else if(strncmp(cmd, "w", 1) == 0) + {//set media volume up + unsigned int value = 100; + ret = mm_sound_volume_get_value(g_volume_type, &value); + if(ret < 0) { + debug_log("mm_sound_volume_get_value 0x%x\n", ret); + } + else { + debug_log("Loaded media volume is %d\n", value); + int step; + value++; + mm_sound_volume_get_step(g_volume_type, &step); + if(value >= step) { + value = step-1; + } + ret = mm_sound_volume_set_value(g_volume_type, value); + if(ret < 0) { + debug_log("mm_sound_volume_set_value 0x%x\n", ret); + } + } + } + else if(strncmp(cmd, "e", 1) == 0) + {//set media volume down + unsigned int value = 100; + ret = mm_sound_volume_get_value(g_volume_type, &value); + if(ret < 0) { + debug_log("mm_sound_volume_get_value 0x%x\n", ret); + } + else { + if(value != 0) { + value--; + } + + ret = mm_sound_volume_set_value(g_volume_type, value); + if(ret < 0) { + debug_log("mm_sound_volume_set_value 0x%x\n", ret); + } + } + } + else if(strncmp(cmd, "r", 1) == 0) + {//get media volume + unsigned int value = 100; + ret = mm_sound_volume_get_value(VOLUME_TYPE_SYSTEM, &value); + if(ret < 0) { + debug_log("mm_sound_volume_get_value 0x%x\n", ret); + } + else{ + g_print("*** SYSTEM VOLUME : %u ***\n", value); + g_volume_value = value; + } + } + else if(strncmp(cmd, "t", 1) == 0) + {//set media volume up + unsigned int value = 100; + ret = mm_sound_volume_get_value(VOLUME_TYPE_SYSTEM, &value); + if(ret < 0) { + debug_log("mm_sound_volume_get_value 0x%x\n", ret); + } + else { + debug_log("Loaded system volume is %d\n", value); + int step; + value++; + mm_sound_volume_get_step(VOLUME_TYPE_SYSTEM, &step); + if(value >= step) { + value = step-1; + } + ret = mm_sound_volume_set_value(VOLUME_TYPE_SYSTEM, value); + if(ret < 0) { + debug_log("mm_sound_volume_set_value 0x%x\n", ret); + }else { + g_print("Current System volume is %d\n", value); + } + } + } + else if(strncmp(cmd, "y", 1) == 0) + {//set media volume down + unsigned int value = 100; + ret = mm_sound_volume_get_value(VOLUME_TYPE_SYSTEM, &value); + if(ret < 0) { + debug_log("mm_sound_volume_get_value 0x%x\n", ret); + } + else { + if(value != 0) { + value--; + } + + ret = mm_sound_volume_set_value(VOLUME_TYPE_SYSTEM, value); + if(ret < 0) { + debug_log("mm_sound_volume_set_value 0x%x\n", ret); + }else { + g_print("Current System volume is %d\n", value); + } + } + } + else if(strncmp(cmd, "a", 1) == 0) + { + debug_log("volume is %d type, %d\n", g_volume_type, g_volume_value); + ret = mm_sound_play_sound(g_file_name, g_volume_type, mycallback ,"USERDATA", &handle); + if(ret < 0) + debug_log("mm_sound_play_sound() failed with 0x%x\n", ret); + } + else if(strncmp(cmd, "A", 1) == 0) + { + debug_log("volume is %d type, %d\n", g_volume_type, g_volume_value); + ret = mm_sound_play_loud_solo_sound(g_file_name, g_volume_type, mycallback ,"USERDATA", &handle); + if(ret < 0) + debug_log("mm_sound_play_sound_loud_solo() failed with 0x%x\n", ret); + } + else if(strncmp(cmd, "F", 1) == 0) + { + char num = 0; + char input_string[128] = ""; + char *tok = NULL; + int tonetime=0; + double volume=1.0; + int volume_type = -1; + MMSoundTone_t tone = MM_SOUND_TONE_DTMF_0; + + while(num != 'q') { + fflush(stdin); + g_print("enter number(0~H exit:q), volume type(0~7), volume(0.0~1.0), time(ms):\t "); + fgets(input_string, sizeof(input_string)-1, stdin); + tok = strtok(input_string, " "); + if(!tok) continue; + if(tok[0] == 'q') { + break; + } + else if(tok[0] < '0' || tok[0] > '~') { + if(tok[0] == '*' || tok[0] == '#') + ; + else + continue; + } + num = tok[0]; + if(num >= '0' && num <= '9') { + tone = (MMSoundTone_t)(num - '0'); + } + else if(num == '*') { + tone = MM_SOUND_TONE_DTMF_S; + } + else if(num == '#') { + tone =MM_SOUND_TONE_DTMF_P; + } + else if(num == 'A') { tone = MM_SOUND_TONE_DTMF_A; } + else if(num == 'B') { tone = MM_SOUND_TONE_DTMF_B; } + else if(num == 'C') { tone = MM_SOUND_TONE_DTMF_C; } + else if(num == 'D') { tone = MM_SOUND_TONE_DTMF_D; } + else if(num == 'E') { tone = MM_SOUND_TONE_SUP_DIAL; } + else if(num == 'F') { tone = MM_SOUND_TONE_ANSI_DIAL; } + else if(num == 'G') { tone = MM_SOUND_TONE_JAPAN_DIAL; } + else if(num == 'H') { tone = MM_SOUND_TONE_SUP_BUSY; } + else if(num == 'I') { tone = MM_SOUND_TONE_ANSI_BUSY; } + else if(num == 'J') { tone = MM_SOUND_TONE_JAPAN_BUSY; } + else if(num == 'K') { tone = MM_SOUND_TONE_SUP_CONGESTION; } + else if(num == 'L') { tone = MM_SOUND_TONE_ANSI_CONGESTION; } + else if(num == 'M') { tone = MM_SOUND_TONE_SUP_RADIO_ACK; } + else if(num == 'N') { tone = MM_SOUND_TONE_JAPAN_RADIO_ACK; } + else if(num == 'O') { tone = MM_SOUND_TONE_SUP_RADIO_NOTAVAIL; } + else if(num == 'P') { tone = MM_SOUND_TONE_SUP_ERROR; } + else if(num == 'Q') { tone = MM_SOUND_TONE_SUP_CALL_WAITING; } + else if(num == 'R') { tone = MM_SOUND_TONE_ANSI_CALL_WAITING; } + else if(num == 'S') { tone = MM_SOUND_TONE_SUP_RINGTONE; } + else if(num == 'T') { tone = MM_SOUND_TONE_ANSI_RINGTONE; } + else if(num == 'U') { tone = MM_SOUND_TONE_PROP_BEEP; } + else if(num == 'V') { tone = MM_SOUND_TONE_PROP_ACK; } + else if(num == 'W') { tone = MM_SOUND_TONE_PROP_NACK; } + else if(num == 'X') { tone = MM_SOUND_TONE_PROP_PROMPT; } + else if(num == 'Y') { tone = MM_SOUND_TONE_PROP_BEEP2; } + else if(num == 'Z') { tone =MM_SOUND_TONE_CDMA_HIGH_SLS; } + else if(num == '[') { tone = MM_SOUND_TONE_CDMA_MED_SLS; } + else if(num == ']') { tone = MM_SOUND_TONE_CDMA_LOW_SLS; } + else if(num == '^') { tone =MM_SOUND_TONE_CDMA_HIGH_S_X4; } + else if(num == '_') { tone =MM_SOUND_TONE_CDMA_MED_S_X4; } + else if(num == 'a') { tone =MM_SOUND_TONE_CDMA_LOW_S_X4; } + else if(num == 'b') { tone =MM_SOUND_TONE_CDMA_HIGH_PBX_L; } + else if(num == 'c') { tone =MM_SOUND_TONE_CDMA_MED_PBX_L; } + else if(num == 'd') { tone =MM_SOUND_TONE_CDMA_LOW_PBX_L; } + else if(num == 'e') { tone =MM_SOUND_TONE_CDMA_HIGH_PBX_SS; } + else if(num == 'f') { tone =MM_SOUND_TONE_CDMA_MED_PBX_SS; } + else if(num == 'g') { tone =MM_SOUND_TONE_CDMA_LOW_PBX_SS; } + else if(num == 'h') { tone =MM_SOUND_TONE_CDMA_HIGH_PBX_SSL; } + else if(num == 'i') { tone =MM_SOUND_TONE_CDMA_MED_PBX_SSL; } + else if(num == 'j') { tone =MM_SOUND_TONE_CDMA_LOW_PBX_SSL; } + else if(num == 'k') { tone =MM_SOUND_TONE_CDMA_HIGH_PBX_SLS; } + else if(num == 'l') { tone =MM_SOUND_TONE_CDMA_MED_PBX_SLS; } + else if(num == 'm') { tone =MM_SOUND_TONE_CDMA_LOW_PBX_SLS; } + else if(num == 'n') { tone =MM_SOUND_TONE_CDMA_HIGH_PBX_S_X4; } + else if(num == 'o') { tone =MM_SOUND_TONE_CDMA_MED_PBX_S_X4; } + else if(num == 'p') { tone =MM_SOUND_TONE_CDMA_LOW_PBX_S_X4; } + else if(num == 'q') { tone =MM_SOUND_TONE_CDMA_ALERT_NETWORK_LITE; } + else if(num == 'r') { tone =MM_SOUND_TONE_CDMA_ALERT_AUTOREDIAL_LITE; } + else if(num == 's') { tone =MM_SOUND_TONE_CDMA_ONE_MIN_BEEP; } + else if(num == 't') { tone =MM_SOUND_TONE_CDMA_KEYPAD_VOLUME_KEY_LITE; } + else if(num == 'u') { tone =MM_SOUND_TONE_CDMA_PRESSHOLDKEY_LITE; } + else if(num == 'v') { tone =MM_SOUND_TONE_CDMA_ALERT_INCALL_LITE; } + else if(num == 'w') { tone =MM_SOUND_TONE_CDMA_EMERGENCY_RINGBACK; } + else if(num == 'x') { tone =MM_SOUND_TONE_CDMA_ALERT_CALL_GUARD; } + else if(num == 'y') { tone =MM_SOUND_TONE_CDMA_SOFT_ERROR_LITE; } + else if(num == 'z') { tone =MM_SOUND_TONE_CDMA_CALLDROP_LITE; } + else if(num == '{') { tone =MM_SOUND_TONE_CDMA_NETWORK_BUSY_ONE_SHOT; } + else if(num == '}') { tone =MM_SOUND_TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING; } + else if(num == '~') { tone =MM_SOUND_TONE_CDMA_SIGNAL_OFF; } + tok = strtok(NULL, " "); + if(tok) volume_type = (double)atoi(tok); + + tok = strtok(NULL, " "); + if(tok) volume = (double)atof(tok); + + tok = strtok(NULL, " "); + if(tok) + { + tonetime = atoi(tok); + } + else + { + tonetime = MIN_TONE_PLAY_TIME; + } + + debug_log("volume type: %d\t volume is %f\t tonetime: %d \n", volume_type, volume, tonetime); + ret = mm_sound_play_tone(tone, volume_type, volume, tonetime, &handle); + if(ret<0) + debug_log ("[magpie] Play DTMF sound cannot be played ! %d\n", handle); + } + } + else if (strncmp (cmd, "b",1) == 0) + { + DIR *basedir; + struct dirent *entry; + struct stat file_stat; + char fullpath[MAX_PATH_LEN]=""; + struct timespec start_time = {0,}; + struct timespec current_time = {0,}; + + if(g_dir_name[strlen(g_dir_name)-1] == '/') + g_dir_name[strlen(g_dir_name)-1] = '\0'; + + basedir = opendir(g_dir_name); + if(basedir != NULL) + { + while( (entry = readdir(basedir)) != NULL) + { + int playfail =0; + int mywait = 0; + if(entry->d_name[0] == '.') + continue; + memset(fullpath, '\0' ,sizeof(fullpath)); + snprintf(fullpath, sizeof(fullpath)-1,"%s/%s", g_dir_name, entry->d_name); + debug_log("Try %s\n", fullpath); + + if (lstat(fullpath, &file_stat) == -1) + continue; + + if(S_ISREG(file_stat.st_mode)) + { + test_callback_done = 0 ; + start_time.tv_sec = (long int)(time(NULL)); + start_time.tv_nsec = 0; + ret = mm_sound_play_sound(fullpath, g_volume_type, test_callback, NULL, &handle); + if(ret != MM_ERROR_NONE) + { + debug_log("Play file error : %s\n", fullpath); + sleep(4); + playfail = 1; + } + } + else + { + debug_log("this is not regular file : %s\n", fullpath); + playfail = 1; + } + while((test_callback_done == 0) && (playfail ==0)) + { + current_time.tv_sec = (long int)(time(NULL)); + current_time.tv_nsec = 0; + if(current_time.tv_sec - start_time.tv_sec > 200) + { + if((++mywait)%5 == 0) + { + debug_log("I'm waiting callback for %d seconds after play %s\n", + (int)(current_time.tv_sec - start_time.tv_sec), + fullpath); + } + } + sleep(2); + } + debug_log("goto next file\n"); + } + closedir(basedir); + } + else + { + debug_log("Cannot Open such a directory %s\n", g_dir_name); + } + + } + + else if (strncmp (cmd, "c",1) == 0) + { + soundparam.volume = g_volume_value; + soundparam.loop = -1; /* loop case */ + soundparam.callback = mycallback; + soundparam.data = NULL; + soundparam.mem_ptr = NULL; + soundparam.mem_size = 0; + soundparam.filename = g_file_name; + soundparam.volume_config = g_volume_type; + + if ((mm_sound_play_sound_ex (&soundparam, &handle))<0) + debug_log ("Play EX sound cannot be played !\n"); + + debug_log ("Ex sound is played Handle is [%d]\n", handle); + } + else if (strncmp (cmd, "f",1) == 0) { + g_menu_state=CURRENT_STATUS_FILENAME; + } + + else if (strncmp (cmd, "d",1) == 0) { + g_menu_state=CURRENT_STATUS_DIRNAME; + } + else if (strncmp (cmd, "s",1) == 0) { + if(mm_sound_stop_sound(handle)) + debug_log (" Cannot stop sound !!! %d \n", handle); + } + else if (strncmp (cmd, "1",1) == 0) { + //ap to spk + if (mm_sound_set_path (MM_SOUND_GAIN_KEYTONE, MM_SOUND_PATH_SPK, MM_SOUND_PATH_NONE, MM_SOUND_PATH_OPTION_NONE)<0) + debug_log ("Fail to set sound path !!!\n"); + g_print("Set path for speaker playback\n"); + } + + else if (strncmp (cmd, "2",1) == 0) { + //ap to headset + if (mm_sound_set_path(MM_SOUND_GAIN_KEYTONE, MM_SOUND_PATH_HEADSET, MM_SOUND_PATH_NONE, MM_SOUND_PATH_OPTION_NONE)<0) + debug_log ("Fail to set sound path !!!\n"); + g_print("Set path for headset playback\n"); + } + else if (strncmp (cmd, "3",1) == 0) { + + } + else if (strncmp (cmd, "4",1) == 0) { + //recording + if (mm_sound_set_path(MM_SOUND_GAIN_VOICEREC, MM_SOUND_PATH_NONE, MM_SOUND_PATH_MIC, MM_SOUND_PATH_OPTION_NONE)<0) + debug_log ("Fail to set sound path !!!\n"); + g_print("Set path for recording with main mic\n"); + } + else if (strncmp (cmd, "5",1) == 0) { + + } + else if (strncmp (cmd, "6",1) == 0) { + //voice call + if (mm_sound_set_path(MM_SOUND_GAIN_VOICECALL, MM_SOUND_PATH_RECV, MM_SOUND_PATH_MIC, MM_SOUND_PATH_OPTION_NONE)<0) + debug_log ("Fail to set sound path !!!\n"); + g_print("Set path for voicecall\n"); + } + else if (strncmp (cmd, "7",1) == 0) { + //voicecall release + if (mm_sound_set_path(MM_SOUND_GAIN_VOICECALL, MM_SOUND_PATH_NONE, MM_SOUND_PATH_NONE, MM_SOUND_PATH_OPTION_NONE)<0) + debug_log ("Fail to set sound path !!!\n"); + g_print("release path for voicecall\n"); + } + else if (strncmp (cmd, "8",1) == 0) { + //voice call + if (mm_sound_set_path(MM_SOUND_GAIN_VIDEOCALL, MM_SOUND_PATH_SPK, MM_SOUND_PATH_MIC, MM_SOUND_PATH_OPTION_NONE)<0) + debug_log ("Fail to set sound path !!!\n"); + g_print("Set path for VT call\n"); + } + + else if (strncmp (cmd, "9",1) == 0) { + //voicecall release + if (mm_sound_set_path(MM_SOUND_GAIN_VIDEOCALL, MM_SOUND_PATH_NONE, MM_SOUND_PATH_NONE, MM_SOUND_PATH_OPTION_NONE)<0) + debug_log ("[magpie] Fail to set sound path !!!\n"); + g_print("release path for VT call\n"); + } + + /* -------------------------- Route Test : Starts -------------------------- */ +#if 0 + g_print("==================================================================\n"); + g_print(" Audio route APIs\n"); + g_print("==================================================================\n"); + g_print("u : Foreach Available Routes \t"); + g_print("i : Get Active Devices \n"); + g_print("o : Add Available Routes Callback \t"); + g_print("O : Remove Available Routes Callback \n"); + g_print("p : Add Active Route Callback\t"); + g_print("P : Remove Active Route Callback \n"); + g_print("{ : Get BT A2DP Status\n"); +#endif + else if (strncmp(cmd, "u", 1) == 0) { + int ret = 0; + ret = mm_sound_foreach_available_route_cb(__mm_sound_foreach_available_route_cb, NULL); + if (ret == MM_ERROR_NONE) { + g_print ("### mm_sound_foreach_available_route_cb() Success\n\n"); + } else { + g_print ("### mm_sound_foreach_available_route_cb() Error : errno [%x]\n\n", ret); + } + } + else if (strncmp(cmd, "i", 1) == 0) { + int ret = 0; + mm_sound_device_in in; + mm_sound_device_out out; + ret = mm_sound_get_active_device(&in, &out); + if (ret == MM_ERROR_NONE) { + g_print ("### mm_sound_get_active_device() Success : in[0x%08x][%s], out[0x%08x][%s]\n\n", + in, __get_capture_device_str(in), out, __get_playback_device_str(out)); + } else { + g_print ("### mm_sound_get_active_device() Error : errno [%x]\n\n", ret); + } + } + else if (strncmp(cmd, "o", 1) == 0) { + int ret = 0; + ret = mm_sound_add_available_route_changed_callback(__mm_sound_available_route_changed_cb, NULL); + if (ret == MM_ERROR_NONE) { + g_print ("### mm_sound_add_available_route_changed_callback() Success\n\n"); + } else { + g_print ("### mm_sound_add_available_route_changed_callback() Error : errno [%x]\n\n", ret); + } + } + else if (strncmp(cmd, "O", 1) == 0) { + int ret = 0; + ret = mm_sound_remove_available_route_changed_callback(); + if (ret == MM_ERROR_NONE) { + g_print ("### mm_sound_remove_available_route_changed_callback() Success\n\n"); + } else { + g_print ("### mm_sound_remove_available_route_changed_callback() Error : errno [%x]\n\n", ret); + } + } + else if (strncmp(cmd, "p", 1) == 0) { + int ret = 0; + ret = mm_sound_add_active_device_changed_callback(__mm_sound_active_device_changed_cb, NULL); + if (ret == MM_ERROR_NONE) { + g_print ("### mm_sound_add_active_device_changed_callback() Success\n\n"); + } else { + g_print ("### mm_sound_add_active_device_changed_callback() Error : errno [%x]\n\n", ret); + } + } + else if (strncmp(cmd, "P", 1) == 0) { + int ret = 0; + ret = mm_sound_remove_active_device_changed_callback(); + if (ret == MM_ERROR_NONE) { + g_print ("### mm_sound_remove_active_device_changed_callback() Success\n\n"); + } else { + g_print ("### mm_sound_remove_active_device_changed_callback() Error : errno [%x]\n\n", ret); + } + } + else if (strncmp(cmd, "{", 1) == 0) { + int ret = 0; + int connected = 0; + char* bt_name = NULL; + + ret = mm_sound_route_get_a2dp_status (&connected, &bt_name); + if (ret == MM_ERROR_NONE) { + g_print ("### mm_sound_route_get_a2dp_status() Success : connected=[%d] name=[%s]\n", connected, bt_name); + if (bt_name) + free (bt_name); + } else { + g_print ("### mm_sound_route_get_a2dp_status() Error : errno [%x]\n", ret); + } + } + + else if(strncmp(cmd, "}", 1) == 0) + { + int ret = 0; + char input_string[128]; + mm_sound_route route = MM_SOUND_ROUTE_OUT_SPEAKER; + char num; + + fflush(stdin); + g_print ("1. MM_SOUND_ROUTE_OUT_SPEAKER\n"); + g_print ("2. MM_SOUND_ROUTE_OUT_WIRED_ACCESSORY\n"); + g_print ("3. MM_SOUND_ROUTE_OUT_BLUETOOTH\n"); + g_print ("4. MM_SOUND_ROUTE_OUT_DOCK\n"); + g_print ("5. MM_SOUND_ROUTE_OUT_HDMI\n"); + g_print ("6. MM_SOUND_ROUTE_OUT_WFD\n"); + g_print ("7. MM_SOUND_ROUTE_OUT_USB_AUDIO\n"); + g_print ("8. MM_SOUND_ROUTE_IN_MIC\n"); + g_print ("9. MM_SOUND_ROUTE_IN_WIRED_ACCESSORY\n"); + g_print ("0. MM_SOUND_ROUTE_IN_MIC_OUT_RECEIVER\n"); + g_print ("a. MM_SOUND_ROUTE_IN_MIC_OUT_SPEAKER\n"); + g_print ("b. MM_SOUND_ROUTE_IN_MIC_OUT_HEADPHONE\n"); + g_print ("c. MM_SOUND_ROUTE_INOUT_HEADSET\n"); + g_print ("d. MM_SOUND_ROUTE_INOUT_BLUETOOTH\n"); + g_print("> select route number : "); + + fgets(input_string, sizeof(input_string)-1, stdin); + num = input_string[0]; + + if(num == '1') { route = MM_SOUND_ROUTE_OUT_SPEAKER; } + else if(num == '2') { route = MM_SOUND_ROUTE_OUT_WIRED_ACCESSORY; } + else if(num == '3') { route = MM_SOUND_ROUTE_OUT_BLUETOOTH; } + else if(num == '4') { route = MM_SOUND_ROUTE_OUT_DOCK; } + else if(num == '5') { route = MM_SOUND_ROUTE_OUT_HDMI; } + else if(num == '6') { route = MM_SOUND_ROUTE_OUT_WFD; } + else if(num == '7') { route = MM_SOUND_ROUTE_OUT_USB_AUDIO; } + else if(num == '8') { route = MM_SOUND_ROUTE_IN_MIC; } + else if(num == '9') { route = MM_SOUND_ROUTE_IN_WIRED_ACCESSORY; } + else if(num == '0') { route = MM_SOUND_ROUTE_IN_MIC_OUT_RECEIVER; } + else if(num == 'a') { route = MM_SOUND_ROUTE_IN_MIC_OUT_SPEAKER; } + else if(num == 'b') { route = MM_SOUND_ROUTE_IN_MIC_OUT_HEADPHONE; } + else if(num == 'c') { route = MM_SOUND_ROUTE_INOUT_HEADSET; } + else if(num == 'd') { route = MM_SOUND_ROUTE_INOUT_BLUETOOTH; } + + ret = mm_sound_set_active_route(route); + if (ret == MM_ERROR_NONE) { + g_print ("### mm_sound_set_active_route(%s) Success\n\n", __get_route_str (route)); + } else { + g_print ("### mm_sound_set_acstive_route(%s) Error : errno [%x]\n\n", __get_route_str (route), ret); + } + } + + else if(strncmp(cmd, "z", 1) ==0) { + if(MM_ERROR_NONE != mm_session_init(MM_SESSION_TYPE_CALL)) + { + g_print("Call session init failed\n"); + } + } + else if(strncmp(cmd, "Z", 1) ==0) { + if(MM_ERROR_NONE != mm_session_init(MM_SESSION_TYPE_VIDEOCALL)) + { + g_print("VideoCall session init failed\n"); + } + } + else if(strncmp(cmd, "v", 1) ==0) { + if(MM_ERROR_NONE != mm_session_finish()) + { + g_print("Call session finish failed\n"); + } + } + + else if(strncmp(cmd, "V", 1) ==0) { + int value; + if(vconf_get_int(SOUND_STATUS_KEY, &value)) { + g_print("Can not get %s\n", SOUND_STATUS_KEY); + } + else + { + if(value == ASM_STATUS_NONE || value == ASM_STATUS_MONITOR) + { + g_print("No Session Instance\n"); + } + if(value & ASM_STATUS_SHARE_MMPLAYER) { + g_print("SHARE - PLAYER\n"); + } + if(value & ASM_STATUS_EXCLUSIVE_MMPLAYER) { + g_print("EXCLUSIVE - PLAYER\n"); + } + if(value & ASM_STATUS_SHARE_MMSOUND) { + g_print("SHARE - SOUND\n"); + } + if(value & ASM_STATUS_EXCLUSIVE_MMSOUND) { + g_print("EXCLUSIVE - SOUND\n"); + } + if(value & ASM_STATUS_SHARE_MMCAMCORDER) { + g_print("SHARE - CAMCORDER\n"); + } + if(value & ASM_STATUS_EXCLUSIVE_MMCAMCORDER) { + g_print("EXCLUSIVE - CAMCORDER\n"); + } + if(value & ASM_STATUS_SHARE_OPENAL) { + g_print("SHARE - OPENAL\n"); + } + if(value & ASM_STATUS_EXCLUSIVE_OPENAL) { + g_print("EXCLUSIVE - OPENAL\n"); + } + if(value & ASM_STATUS_SHARE_AVSYSTEM) { + g_print("SHARE - AVSYSTEM\n"); + } + if(value & ASM_STATUS_EXCLUSIVE_AVSYSTEM) { + g_print("EXCLUSIVE - AVSYSTEM\n"); + } + if(value & ASM_STATUS_NOTIFY) { + g_print("NOTIFY\n"); + } + if(value & ASM_STATUS_ALARM) { + g_print("ALARM\n"); + } + if(value & ASM_STATUS_CALL) { + g_print("CALL\n"); + } + if(value & ASM_STATUS_VIDEOCALL) { + g_print("VIDEOCALL\n"); + } + } + } + + // End of sound & avsystem interpret + else if (strncmp(cmd, "x", 1) == 0) { + quit_program(); + } + break; + + case CURRENT_STATUS_FILENAME: + input_filename(cmd); + g_menu_state=CURRENT_STATUS_MAINMENU; + break; + + case CURRENT_STATUS_DIRNAME: + input_dirname(cmd); + g_menu_state=CURRENT_STATUS_MAINMENU; + break; + case CURRENT_STATUS_POSITION: + break; + } + //g_timeout_add(100, timeout_menu_display, 0); +} + +void volume_change_callback(void* data) +{ + volume_type_t* type = (volume_type_t*) data; + + g_volume_type = *type; + mm_sound_volume_get_value(g_volume_type, &g_volume_value); + g_print("Volume Callback Runs :::: MEDIA VALUME %d\n", g_volume_value); +} + + +void audio_route_policy_changed_callback(void* data, system_audio_route_t policy) +{ + int dummy = (int) data; + system_audio_route_t lv_policy; + char *str_route[SYSTEM_AUDIO_ROUTE_POLICY_MAX] = { + "DEFAULT","IGN_A2DP","HANDSET" + }; + g_print("Audio Route Policy has changed to [%s]\n", str_route[policy]); + g_print("...read....current....policy...to cross check..%d\n", dummy); + if(0 > mm_sound_route_get_system_policy(&lv_policy)) { + g_print("Can not get policy...in callback function\n"); + } + else { + g_print("...readed policy [%s]\n", str_route[lv_policy]); + } +} + +int main(int argc, char *argv[]) +{ + stdin_channel = g_io_channel_unix_new(0); + g_io_add_watch(stdin_channel, G_IO_IN, (GIOFunc)input, NULL); + g_loop = g_main_loop_new (NULL, 1); + + g_print("callback function addr :: %p\n", volume_change_callback); + g_volume_type = VOLUME_TYPE_MEDIA; + mm_sound_volume_get_value(g_volume_type, &g_volume_value); + mm_sound_volume_add_callback(g_volume_type, volume_change_callback, (void*) &g_volume_type); + displaymenu(); + g_main_loop_run (g_loop); + + return 0; +} + -- 2.7.4